Core Data: Move the template lookup to core-data selectors/resolvers#55883
Core Data: Move the template lookup to core-data selectors/resolvers#55883youknowriad merged 2 commits intotrunkfrom
Conversation
| }, | ||
| [ slug, isCustom ] | ||
| ); | ||
| } |
There was a problem hiding this comment.
@jorgefilipecosta can you help me test the start templates please.
There was a problem hiding this comment.
I tested that by creating a new template and verifying the proper fallback template is suggested in the modal. Alternatively you 'empty' a template completely, save and reload, in order for the modal to show up. It seems it's working fine.
|
Size Change: +1.22 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
ntsekouras
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
| ( query ) => | ||
| async ( { dispatch } ) => { | ||
| const template = await apiFetch( { | ||
| path: addQueryArgs( '/wp/v2/templates/lookup', query ), |
There was a problem hiding this comment.
I've discovered a different issue here while testing. If the current default template is empty the REST endpoint returns the next one available from template hierarchy. That's an issue, because front end and the editor show different things. I'll create an issue for this.
|
Flaky tests detected in 15f0adc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6782750343
|
What?
Extracted from #55844
This PR adds
getDefaultTemplateIdselectors to core-data to avoid the adhoc apiFetch calls. The main reason I'm doing this PR is because I want to deprecate thesetPageaction in the site editor because it does too much and replace it with a React hook like done in #55844Testing Instructions
1- Test navigation between different sections of the site editor (pages, single pages...)
2- Test starter templates.