-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix Nav Block Link UI regression for blocks with id but no binding - make UI opt in #72171
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -829,6 +829,59 @@ test.describe( 'Navigation block', () => { | |
| await expect( linkInput ).toBeEnabled(); | ||
| await expect( linkInput ).toHaveValue( '' ); | ||
| } ); | ||
|
|
||
| test( 'existing links with id but no binding remain editable', async ( { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed this test doesn't actually open Link UI. I think we need to augment BOTH tests in this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow up Issue #72204 |
||
| editor, | ||
| page, | ||
| admin, | ||
| navigation, | ||
| requestUtils, | ||
| } ) => { | ||
| await admin.createNewPost(); | ||
|
|
||
| // Create a menu with an existing link that has id but no binding | ||
| // This simulates existing sites before the binding feature | ||
| const menu = await requestUtils.createNavigationMenu( { | ||
| title: 'Test Menu', | ||
| content: `<!-- wp:navigation-link {"label":"Support","type":"page","id":${ testPage1.id },"url":"${ testPage1.link }","kind":"post-type"} /-->`, | ||
| } ); | ||
|
|
||
| await editor.insertBlock( { | ||
| name: 'core/navigation', | ||
| attributes: { | ||
| ref: menu.id, | ||
| }, | ||
| } ); | ||
|
|
||
| // Select the Navigation Link block | ||
| const navBlock = navigation.getNavBlock(); | ||
| await editor.selectBlocks( navBlock ); | ||
|
|
||
| const navLinkBlock = navBlock | ||
| .getByRole( 'document', { | ||
| name: 'Block: Page Link', | ||
| } ) | ||
| .first(); | ||
|
|
||
| await editor.selectBlocks( navLinkBlock ); | ||
|
|
||
| // Check the Inspector controls for the Nav Link block | ||
| // to verify the Link field is enabled (not locked in entity mode) | ||
| await editor.openDocumentSettingsSidebar(); | ||
| const settingsControls = page | ||
| .getByRole( 'region', { name: 'Editor settings' } ) | ||
| .getByRole( 'tabpanel', { name: 'Settings' } ); | ||
|
|
||
| await expect( settingsControls ).toBeVisible(); | ||
|
|
||
| const linkInput = settingsControls.getByRole( 'textbox', { | ||
| name: 'Link', | ||
| } ); | ||
|
|
||
| // For existing links with id but no binding, the input should be enabled | ||
| await expect( linkInput ).toBeEnabled(); | ||
| await expect( linkInput ).toHaveValue( testPage1.link ); | ||
| } ); | ||
| } ); | ||
| } ); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.