-
Notifications
You must be signed in to change notification settings - Fork 4.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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The broweAllLink
version from the sidebar navigation component doesn't work in the edit mode.
gutenberg/packages/edit-site/src/components/sidebar-navigation-screen-templates/index.js
Lines 63 to 65 in b80d848
const browseAllLink = useLink( { | |
path: '/' + postType + '/all', | |
} ); |
@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
useLink
hook now requires thepath
argument and canvas to be in theview
mode.A possible regression after #48063.
Testing Instructions
Screenshots or screencast