Site editor: use constants rather than hard coded template strings#54586
Conversation
|
Size Change: +24 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
fdea1c8 to
e79b67c
Compare
5831500 to
a2b821f
Compare
andrewserong
left a comment
There was a problem hiding this comment.
Nice follow-up!
This PR includes an empty file for packages/edit-site/src/components/block-editor/get-block-editor-provider.js — looks like as a result of a rebase? I think that onej ust needs to be removed.
The code changes all look good and match to the right constants. Gave the following areas a smoke test, too:
✅ Pattern / template part creation and patterns screens
✅ Navigation
✅ Document actions
✅ Added by
✅ New template part
✅ Template and template parts pages
✅ Save hub
✅ Page and Pages screens
✅ Template actions
Once that empty file is removed, this LGTM! ✨
Follow up on #54484 to consolidate constants
a2b821f to
929f1e5
Compare
|
Flaky tests detected in 929f1e5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6258331378
|
929f1e5 to
c759dd2
Compare
kevin940726
left a comment
There was a problem hiding this comment.
Thank you!
Just a tiny thing that would be nice to squeeze it in this PR but totally acceptable to do it in another PR too 😆.
…ttern/use-pattern-details.js Co-authored-by: Kai Hao <kevin830726@gmail.com>
…54586) * Initial commit: Follow up on #54484 to consolidate constants * More using constants instead of hard-coded strings * Rename TEMPLATE_CUSTOM_SOURCE to TEMPLATE_ORIGINS * Update packages/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js Co-authored-by: Kai Hao <kevin830726@gmail.com> --------- Co-authored-by: Kai Hao <kevin830726@gmail.com>
|
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: 988971a |
What?
Hello!
This is a follow up to
The effort continues to consolidate constants. 🔨
❗ To reduce the amount of files and testing involved, this PR doesn't replace all instances of hard-coded strings. There will be more follow ups.
Why?
To centralize names for post types and so on. Ease of management. Giving search and replace a well-deserved rest.
How?
Replacing the following strings with constants
NAVIGATION_POST_TYPETEMPLATE_POST_TYPETEMPLATE_PART_POST_TYPETEMPLATE_CUSTOM_SOURCEPATTERN_TYPES.userTEMPLATE_ORIGINS.customTEMPLATE_ORIGINS.themeTEMPLATE_ORIGINS.pluginPATTERN_SYNC_TYPES.unsyncedTesting Instructions