Site Editor: Fix the 'Browse all' link in the template details modal#48301
Site Editor: Fix the 'Browse all' link in the template details modal#48301
Conversation
| // TODO: We should update this to filter by template part's areas as well. | ||
| const browseAllLinkProps = useLink( { | ||
| // TODO: We should update this to filter by template part's areas as well. | ||
| canvas: 'view', | ||
| postType: template.type, | ||
| postId: undefined, | ||
| path: '/' + template.type + '/all', |
There was a problem hiding this comment.
The broweAllLink version from the sidebar navigation component doesn't work in the edit mode.
|
@youknowriad, the new required I'll fix the "Template Parts" link for hybrid themes and include E2E tests to catch similar regressions sooner, but an alternative solution would be to handle this BC breakage somewhere in the router. |
|
Size Change: +17 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 2417357. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4240106350
|
The reason I didn't handle the path is because we now have two template lists pages. The one that shows all the templates in the frame and the one that shows all the templates in the sidebar. So there's an ambiguity about which to load. That said, it's arguable that we could default to "browse all" but it might add some complex logic to |
|
That's a good point, and I don't think we want to introduce complex logical changes in Linking these pages probably isn't that useful outside of the core cases. I'll create a core patch to fix regression for hybrid themes. |
|
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: d5dbe59 |
What?
Fixes #48289.
PR fixes the "Browse" all link in the template details modal.
Why?
The
useLinkhook now requires thepathargument and canvas to be in theviewmode.A possible regression after #48063.
Testing Instructions
Screenshots or screencast