-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Template creation: Fixed a problem that when a new template is created, the template is not displayed in the select box. #32735
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
Conversation
|
Size Change: +154 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
| yield controls.dispatch( editorStore, 'updateEditorSettings', { | ||
| ...settings, | ||
| availableTemplates: newAvailableTemplates, | ||
| } ); |
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.
Thanks for fixing this :)
While this works, it feels a bit like a hack to me because it address only one use-case: the template being created from the template sidebar. Other plugins could have their own UIs and rely on actions directly.
I think the ideal solution for me would be to drop the availableTemplates entirely and use a getEntityRecords selector call to fill the the template selector instead.
Do you think it's possible to explore this alternative and compare solutions?
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.
@youknowriad Thanks! I've modified it to use getEntityRecords.
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.
I actually think you misunderstand my suggestion 😬. I was proposing to keep this PR as is and open another when we don't update the action but instead update the template selector UI to not rely on getSettings().availableTemplates but to use getEntityRecords call directly (or an alternative REST API endpoint).
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.
|
Closing this as fixed in #32744 |
Description
When creating a new template and returning to the editor, the new template is not displayed in the select box. It shows up when the browser is reloaded. Fixed this problem.
2021-06-16.21.04.09.mov
How has this been tested?
Screenshots
Types of changes
Bug fix
Checklist:
*.native.jsfiles for terms that need renaming or removal).