-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Global styles: add revisions UI (#50089)
* initial commit. * Adding state for revisions Adding revisions global styles sidebar UI Adding revisions fill Adding revisions components and styles. Added e2e tests * Making selectors more consistent in e2e tests * This commit: - redesigns the revisions list to show a timeline view - changes the revisions endpoint response (and tests) to return a human friendly diff only. The frontend can format dates on the fly - Adds a slot to the edit side sidebar that can position a component at the bottom of the interface sidebar - updates e2e tests * This commit: - adds wordpress/date to package-lock.jdon - ensures that we correctly modify the user revisions to add unsaved and islatest flags * This commit: - extends the e2e test a little bit and adds a TODO to do it better - Adds ally labels to the color panel * This commit: - uses a clientside human-readable time diff method instead of the server side one. This is to make the response as close to the post revisions response as possible (for now) - makes the current timeline dot blue This commit: * This commit: - removes the specific author/user properties from the rest controller - grabs revision author information in the JS - shows a loading wheel while we grab revisions and user data * Label titles * Style adjustments Adding a reset to theme default item to the revisions list. Adding a dependencies to the `useMemo` so that it knows to update when the number of revisions change. This is so we can ensure we add the right metadata in the right order, e.g., `isLatest` Extracted hooks and components from screen revisions monster file * Adding tests for the useGetGlobalStylesRevisions hook * Extracting SCSS to external file Renaming date > meta in classname of DIV that wraps revision date and author meta Extra checks so that we don't render the meta block at all if there's no data * Reverting the reset theme default button and ensuring that revisions panel only display when there are more than two revisions. Updated tests accordingly. bumping gravatar size to 48 Updating other E2E tests after having added aria labels to the color controls Update e2e button spec after changes to button labels * This commit: - refactors useGlobalOutput by splitting out the build logic into a separate hook so that we can pass a custom config - uses wp.date.getSettings().formats.datetimeAbbreviated for formatted date in the revisions buttons - removes unnecessary role on the ordered list - updated copy - replacing modal component with the confirm dialog component - minor code optimizations - making the revisions store methods stable - updating tests - removing shouldShowClose button prop on the editor-canvas-container update e2e * Tweaked the revisions buttons copy, shifting the date and meta around. Updated tests --------- Co-authored-by: James Koster <james@jameskoster.co.uk>
- Loading branch information
1 parent
f4f5e37
commit 81cd233
Showing
36 changed files
with
1,375 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
81cd233
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 81cd233.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4910773476
📝 Reported issues:
/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js
/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js
specs/editor/various/autosave.test.js