-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editor: Refactor page templates to use Redux state #7229
Conversation
); | ||
} | ||
|
||
EditorDrawerLabel.propTypes = { |
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.
Nice - This could be used in Tags & Categories 👍
Testing out well for me 🚢 |
👍 The code here looks good and I wasn't able to break this while testing. |
d04e317
to
34d71ab
Compare
Ran into a couple issues during final round of testing:
To the latter point, this reminds me that I'd once considered perhaps keying page templates by theme rather than by site, since this would allow us to reuse the page templates between two sites both using the same theme. Looking into this some more, aside from potential conflicts on theme slug, there's also the issue that themes can be enhanced with more page templates on a per-site basis. For example, a standard WordPress.com site enables an "Eventbrite Events" page template for the Twenty Sixteen theme, which wouldn't be available for a Jetpack site using the same theme. |
34d71ab
to
c956700
Compare
Good catch - I knew there was a bug I had fixed in this component before and that was it. There are a few themes with only one page template, comics is one for example, and confirmed it is now properly showing the drop down with default and full-width as options 👍
Definitely an edge case, but maybe multiple tabs could be open to arrive at such a global state. Tested again, still looking good 🚢 |
c956700
to
6dc92e6
Compare
This pull request seeks to deprecate Flux-based page templates state in favor of global Redux-based state introduced in #7174. It introduces a new
<QueryPageTemplates />
query component, refactoring the<EditorPageTemplates />
component to make use of it. Since this is the only area of the application using Flux-based state and the<PageTemplatesData />
component, both of these were removed.Testing instructions:
Verify that page template options are shown and can be managed, especially with the following considerations:
Test live: https://calypso.live/?branch=update/editor-page-templates