Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-992] UI changes #272

Merged
merged 203 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 193 commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
d83bbab
add initial admin interface class
jazzsequence May 8, 2024
bb0c5f1
some more scaffolding
jazzsequence May 8, 2024
bde071d
require at least 6.4
jazzsequence May 8, 2024
3bac423
don't show notices if wp_admin_notice doesn't exist
jazzsequence May 8, 2024
202e267
add notice if mu-plugin was not found
jazzsequence May 8, 2024
d90d1da
add notice if the mu-plugin is old
jazzsequence May 8, 2024
92e6e79
fix link and change decimal to string
jazzsequence May 8, 2024
fb49566
use spaces instead of line breaks
jazzsequence May 8, 2024
d6301dc
add helper function to get current max age
jazzsequence May 8, 2024
7b0a8e2
add notice if less than 1 week but not == 600 seconds
jazzsequence May 8, 2024
47b8695
add docblock
jazzsequence May 8, 2024
afa6669
add translator comments
jazzsequence May 8, 2024
0a08657
update tested up to and requires at least values in readmes
jazzsequence May 8, 2024
25c45fb
version bump
jazzsequence May 8, 2024
11a315d
bump composer deps
jazzsequence May 8, 2024
df506ff
don't display the warnings if we aren't on the pantheon cache admin page
jazzsequence May 8, 2024
286c791
convert static class to a namespace
jazzsequence May 8, 2024
6dfabdc
add a bootstrapper for namespace-only files
jazzsequence May 8, 2024
adc5409
lint
jazzsequence May 8, 2024
78993a0
escape the wp_die message
jazzsequence May 8, 2024
76759f9
use a helper for humanized time calculations
jazzsequence May 13, 2024
ab425d0
we still need to test the current max age
jazzsequence May 13, 2024
eb8ae55
pass the current max age to the message, too
jazzsequence May 13, 2024
70fbca8
use the filterable value for default max age
jazzsequence May 13, 2024
adc0169
add a helper function for retrieving the default max age
jazzsequence May 13, 2024
5185da9
also display the seconds in the successful test
jazzsequence May 13, 2024
26bb13d
rank the max age value
jazzsequence May 13, 2024
a138c4d
add caching to the ranked compare
jazzsequence May 13, 2024
dea4ac4
make the color more severe if it's a bigger issue
jazzsequence May 13, 2024
1340fbd
change the color of the admin notice based on the severity of the diff
jazzsequence May 13, 2024
5ec92e7
clear the transient when the option is updated
jazzsequence May 13, 2024
0214223
break notice type into a variable
jazzsequence May 13, 2024
914ec62
fix the translator note
jazzsequence May 13, 2024
65a8136
keep the rank but hide it from the dom
jazzsequence May 13, 2024
e916fcd
add unit tests
jazzsequence May 13, 2024
20cca9a
add initial behat test
jazzsequence May 13, 2024
f5a80fc
fix failing test
jazzsequence May 13, 2024
a291485
specify the element where the notices are
jazzsequence May 13, 2024
4e70779
add site health check test
jazzsequence May 13, 2024
c397078
actually save the changes
jazzsequence May 13, 2024
e565e43
remove max age check
jazzsequence May 14, 2024
01a65c9
simplify the site health check
jazzsequence May 14, 2024
0d3a028
add the message when you expand the accordion
jazzsequence May 14, 2024
2914e99
add other site health things
jazzsequence May 14, 2024
192846f
change press to click?
jazzsequence May 14, 2024
861de5b
add "open the accordion" as a custom step
jazzsequence May 14, 2024
dc6bbe0
move behat stuff around
jazzsequence May 14, 2024
b061514
move stuff around again
jazzsequence May 14, 2024
6f242ae
update the behat.yml
jazzsequence May 14, 2024
38e8cae
remove custom context and try "when I follow"
jazzsequence May 14, 2024
1fc2044
move to checking the text inside the elements
jazzsequence May 14, 2024
e38858f
target the hidden element
jazzsequence May 14, 2024
f4f73df
use hidden='hidden'
jazzsequence May 14, 2024
9f037cd
call it a div
jazzsequence May 14, 2024
583f285
simplify the tests
jazzsequence May 14, 2024
a528229
remove press
jazzsequence May 14, 2024
451c162
it did actually find the right heading
jazzsequence May 14, 2024
de80f0c
add @\since tags
jazzsequence May 14, 2024
487e097
add changelog and upgrade notice
jazzsequence May 14, 2024
ae8e591
let's try checking for some of the hidden text
jazzsequence May 14, 2024
208c1e4
period at the end of the sentence
jazzsequence May 14, 2024
cc82816
add the ranks back
jazzsequence May 14, 2024
a45d829
add the messages
jazzsequence May 14, 2024
51423ec
remove age rank tests
jazzsequence May 14, 2024
989a644
add github testing badge
jazzsequence May 14, 2024
e40e6a6
add script to maybe skip behat tests if we don't need to run them
jazzsequence May 14, 2024
2c5dcfe
add step to workflow
jazzsequence May 14, 2024
46c6616
do not run if the circle config changes
jazzsequence May 14, 2024
fde1cee
also ignore if scripts (that aren't behat-related) have changed
jazzsequence May 14, 2024
ed5001b
fix the logic (again)
jazzsequence May 14, 2024
ce5608b
one more flippity flip
jazzsequence May 14, 2024
9e5d68c
remove the "ignoring" message
jazzsequence May 14, 2024
414bfee
use function to determine if a file should be ignored
jazzsequence May 15, 2024
5b97f15
update changelog to note mu-plugin updates
jazzsequence May 15, 2024
a78d57a
add functionality to automatically set the default_ttl if it was set …
jazzsequence May 15, 2024
8c9ba4f
trigger the setting change and display an admin notice informing user…
jazzsequence May 15, 2024
affb574
add unit tests for set_max_age_to_default
jazzsequence May 15, 2024
aca0eb1
move the max age update notice to the bootstrap
jazzsequence May 16, 2024
833e025
remove the set_max_age_updated helper
jazzsequence May 16, 2024
0e0679e
use a new option for the updated flag
jazzsequence May 16, 2024
9576525
add _notice to the user meta key so it's distinct from the new option
jazzsequence May 16, 2024
51efffa
update tests for new changes
jazzsequence May 16, 2024
9bc655a
add translator note
jazzsequence May 16, 2024
64f0183
user notice about 600 second update is not dismissable
jazzsequence May 16, 2024
7f3f2e8
don't show seconds in updated notice
jazzsequence May 16, 2024
b2b9b15
pass the function into the apply_filter hook
jazzsequence May 16, 2024
16e1964
add docblock
jazzsequence May 16, 2024
8d02020
add test for the notice
jazzsequence May 16, 2024
7f98fb4
return the value of disable_notices
jazzsequence May 16, 2024
f2c78a1
Add scenario to set max-age to 600 and auto-update to the default value
jazzsequence May 16, 2024
ca7688a
here's a behat test that might not work
jazzsequence May 16, 2024
f2d2f46
fixed it based on upstream tests
jazzsequence May 16, 2024
3aaa252
refresh the page
jazzsequence May 16, 2024
5258e5a
go to instead of refresh
jazzsequence May 16, 2024
0bb8e6c
remove all the old npm stuff and use all new npm stuff
jazzsequence May 16, 2024
df570a3
add node build to the build & tag workflow
jazzsequence May 16, 2024
1a84cce
add del package
jazzsequence May 16, 2024
85ded1e
repurpos gruntfile into gulpfile
jazzsequence May 16, 2024
4005c1c
repackage gulpfile and package.json as a module
jazzsequence May 16, 2024
d053085
add additional test failure messaging
jazzsequence May 16, 2024
e6613d7
Merge branch 'cmsp-994' into cmsp-992-ui
jazzsequence May 16, 2024
39ea90b
gitignore assets
jazzsequence May 16, 2024
d665076
don't export the gulpfile
jazzsequence May 16, 2024
ccbb7b4
invoke sass correctly
jazzsequence May 16, 2024
281a434
proper sassing
jazzsequence May 16, 2024
b979b73
add a main.scss file
jazzsequence May 16, 2024
3b872a8
Merge branch 'develop' into cmsp-992-ui
jazzsequence May 17, 2024
7929d7d
compiler tweaks
jazzsequence May 17, 2024
636be80
use concat
jazzsequence May 17, 2024
c31497e
initial styles
jazzsequence May 17, 2024
fb251a3
enqueue css
jazzsequence May 17, 2024
641d10f
use the filter added in https://github.com/pantheon-systems/pantheon-…
jazzsequence May 17, 2024
bf7eaab
some initial styles for the max age box
jazzsequence May 17, 2024
10f8f42
add a global admin notice that appears once
jazzsequence May 17, 2024
e64cdec
remove seconds from the notice
jazzsequence May 17, 2024
a88295a
test the new notice
jazzsequence May 17, 2024
3cb25eb
set dismissable depending on which notice we're showing
jazzsequence May 17, 2024
868ebe4
show the max age rank html comment
jazzsequence May 17, 2024
b440367
fix the conditionals for cs
jazzsequence May 17, 2024
35afd76
update behat tests for new notice language
jazzsequence May 17, 2024
83e095d
bugfix: don't update user meta that max_age was updated if it hasn't …
jazzsequence May 17, 2024
e563086
add one more thing to test in behat
jazzsequence May 20, 2024
ac1f985
add a test for the error, specifically
jazzsequence May 20, 2024
2d6b35c
add a test for the warning
jazzsequence May 20, 2024
ffc3c0b
simplify the conditionals
jazzsequence May 20, 2024
3843a26
lint
jazzsequence May 20, 2024
9438b72
specify the pages that we're on?
jazzsequence May 20, 2024
ad4b900
remove specific element
jazzsequence May 20, 2024
42e37e8
fix typo
jazzsequence May 20, 2024
d878914
take out the dashboard main page goto
jazzsequence May 20, 2024
6b0325e
validate the setting was saved
jazzsequence May 20, 2024
1e090af
let's just remove the 5 days notice
jazzsequence May 20, 2024
3573171
just remove the test
jazzsequence May 20, 2024
1e05a11
we can actually remove current_max_age >= WEEK_IN_SECONDS
jazzsequence May 20, 2024
c946d92
if we're only comparing two things, we don't need to break the if cla…
jazzsequence May 20, 2024
08f3349
we do want to warn users if they have manually set their max age to 600
jazzsequence May 20, 2024
83112dc
Merge branch 'cmsp-995-one-more-notice' into cmsp-992-ui
jazzsequence May 20, 2024
34878c4
there should only be one css file
jazzsequence May 20, 2024
343dc08
remove seconds
jazzsequence May 20, 2024
2da4d34
check stored default_ttl value
jazzsequence May 20, 2024
40d1999
fix failing test
jazzsequence May 20, 2024
613112a
fix translators note
jazzsequence May 20, 2024
8e383e4
remove seconds
jazzsequence May 20, 2024
836ca50
remove redundant check
jazzsequence May 20, 2024
afb7e03
tweak the logic again
jazzsequence May 20, 2024
18325db
fix the test by updating the default ttl
jazzsequence May 20, 2024
5f48ec5
add the description after the input
jazzsequence May 20, 2024
42269e5
styles for box and info bar
jazzsequence May 20, 2024
fc29a57
update the filter name
jazzsequence May 20, 2024
3847023
filter the input box
jazzsequence May 20, 2024
55480b9
add a padding helper
jazzsequence May 20, 2024
f55aeb7
...and use it
jazzsequence May 20, 2024
b14844b
lint
jazzsequence May 20, 2024
812c92c
Merge branch 'develop' into cmsp-992-ui
jazzsequence May 20, 2024
3c8d69d
add styling for links in the info bar.
jazzsequence May 21, 2024
dddcc8e
no padding on the right
jazzsequence May 21, 2024
8d17e7c
adjust h3 margin
jazzsequence May 21, 2024
333ab2a
style the select input
jazzsequence May 21, 2024
41113c3
don't render the info bar
jazzsequence May 21, 2024
d12f199
use wp_kses_post instead of esc_html_e
jazzsequence May 21, 2024
bf7c382
helper function for available dropdown options and make it filterable
jazzsequence May 21, 2024
f7fe554
Refactor default_ttl_input function to handle custom options and filt…
jazzsequence May 21, 2024
51b0cbf
remove seconds from behat tests
jazzsequence May 21, 2024
e760c49
add a period for dumb lint rule
jazzsequence May 21, 2024
b186b06
remove hyphen from max-age
jazzsequence May 21, 2024
e96a5b9
update the tests
jazzsequence May 21, 2024
4d4266f
conditionally append a timestamp to the css version
jazzsequence May 21, 2024
9e518bf
don't show the input box if the ttl is unset
jazzsequence May 21, 2024
31f3168
remove filters in teardown
jazzsequence May 21, 2024
e74d391
remove hyphen in tests
jazzsequence May 21, 2024
6111764
specify method visibility
jazzsequence May 21, 2024
8803886
test the setting description callback
jazzsequence May 21, 2024
937ccf0
test the default ttl option input callback
jazzsequence May 21, 2024
56cba0e
test max_age_options and filter
jazzsequence May 21, 2024
6cf03ba
add a behat test for the select input
jazzsequence May 21, 2024
45cc9ee
maybe change the then
jazzsequence May 21, 2024
67b9067
remove all hyphens
jazzsequence May 21, 2024
44adc3e
be more specific about the select input
jazzsequence May 21, 2024
23a3eba
try using the class and the select
jazzsequence May 21, 2024
7d699d7
let's try checking to see if the response contains the selected option
jazzsequence May 21, 2024
313dd8d
print for debugging
jazzsequence May 21, 2024
ddd3df4
one last try before I give up
jazzsequence May 21, 2024
4e777af
remove the new behat test
jazzsequence May 21, 2024
3ebdec1
use a simple true/false gate for max_age header
jazzsequence May 21, 2024
6a4ec88
display a warning if the default_ttl is saved to a value that's not o…
jazzsequence May 21, 2024
54fd9ed
show the dropdown with the custom value
jazzsequence May 21, 2024
55d8b54
remove placeholder comment
jazzsequence May 21, 2024
a9e9404
gix the global warning shown logic
jazzsequence May 21, 2024
9da90e5
make sure to take into consideration custom and filtered
jazzsequence May 21, 2024
29a7d4e
bail early if the max age is filtered
jazzsequence May 21, 2024
37cc606
better comment
jazzsequence May 21, 2024
8f9dc67
remove value range entirely
jazzsequence May 21, 2024
87fd545
remove recommendation if filtered
jazzsequence May 21, 2024
7576f0c
break out custom and filtered outputs
jazzsequence May 21, 2024
670f39e
update tests
jazzsequence May 21, 2024
e7d8a07
translator note
jazzsequence May 21, 2024
358f2dd
move the debug note
jazzsequence May 21, 2024
5bfb024
add since and return values
jazzsequence May 21, 2024
d603656
push the description down a bit
jazzsequence May 22, 2024
9f1dfb3
personalized message based on current cache max age
jazzsequence May 22, 2024
cdc80c7
remove current when not necessary
jazzsequence May 22, 2024
1dfe6dc
update tests, add a data provider
jazzsequence May 22, 2024
33c7b05
use boolean variable names
jazzsequence May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
/composer.json export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/Gruntfile.js export-ignore
/gulpfile.mjs export-ignore
jazzsequence marked this conversation as resolved.
Show resolved Hide resolved
/package-lock.json export-ignore
/package.json export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/README.md export-ignore
1 change: 1 addition & 0 deletions .github/workflows/build-tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ jobs:
with:
gh_token: ${{ github.token }}
readme_md: README.md
build_node_assets: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Thumbs.db
wp-cli.local.yml
node_modules/
vendor/
assets/css/styles.css
assets/css/*.css.map

# wpunit helpers
bin/helpers.sh
Expand Down
23 changes: 0 additions & 23 deletions Gruntfile.js

This file was deleted.

Empty file removed assets/css/main.css
Empty file.
62 changes: 62 additions & 0 deletions assets/sass/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.pantheon-page-cache {
hr {
display: none;
}

tr.cache-default-max-age {
display: block;
padding: $padding;
background: $white;
color: $charcoal;
box-shadow: $shadow;

td {
padding: 0;
}

.pantheon-cache-default-max-age {
padding: 0 $padding $padding 0;

h3 {
margin-top: 0.5em;
}

i {
margin-right: $padding;
line-height: 1.0em;
}

&-info-bar {
background: $blue;
color: $white;
padding: $padding 0 $padding $padding;
text-align: left;
display: block;
width: 100%;
margin-bottom: 1em;

a {
color: $white;
text-decoration: underline;
}

a:hover, a:active {
color: $white;
text-decoration: none;
}
}

select {
background-color: $white;
color: $charcoal;
border: 1px solid $gray;
border-radius: 0;
}

&-description {
color: $gray;
margin-bottom: 0;
}
}
}
}
9 changes: 9 additions & 0 deletions assets/sass/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Colors
$blue: #1d7afc;
$white: #ffffff;
$gray: #757575;
$charcoal: #1e1e1e;

$shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);

$padding: 10px;
2 changes: 2 additions & 0 deletions assets/sass/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'mixins';
@import 'main';
23 changes: 23 additions & 0 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { deleteAsync } from 'del';
import gulp from 'gulp';
import csso from 'gulp-csso';
import * as sassCompiler from 'sass';
import gulpSass from 'gulp-sass';

const sass = gulpSass(sassCompiler);

gulp.task('styles', () => {
return gulp.src('assets/sass/styles.scss') // Only compile the main file
.pipe(sass().on('error', sass.logError)) // Compile SASS to CSS
.pipe(csso()) // Minify CSS
.pipe(gulp.dest('assets/css')); // Save the CSS file
});

gulp.task('clean', () => {
return deleteAsync('assets/css');
});

gulp.task('build', gulp.series('clean', 'styles'));
gulp.task('watch', () => {
gulp.watch('assets/sass/**/*.scss', gulp.series('clean', 'styles'));
});
Loading
Loading