Changed button labels in Navigation modal (#20579)

Fixes
https://linear.app/tryghost/issue/DES-474/update-navigation-modal-to-use-close-and-save-buttons

We've changed buttons throughout the product to Close/Save, rather than
Cancel/OK. This applies the same pattern to the Navigation modal in the
Admin.
This commit is contained in:
Daniël van der Winden 2024-07-10 13:12:46 +02:00 committed by GitHub
parent a8533c9dc9
commit 8feb37cf59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -43,8 +43,9 @@ const NavigationModal = NiceModal.create(() => {
updateRoute('navigation');
}}
buttonsDisabled={saveState === 'saving'}
cancelLabel='Close'
dirty={localSettings.some(setting => setting.dirty)}
okLabel={saveState === 'saving' ? 'Saving...' : 'OK'}
okLabel={saveState === 'saving' ? 'Saving...' : 'Save'}
scrolling={true}
size='lg'
stickyFooter={true}

View File

@ -39,7 +39,7 @@ test.describe('Navigation settings', async () => {
await secondaryNavigationTab.getByTestId('new-navigation-item').getByLabel('URL').fill('https://google.com');
await secondaryNavigationTab.getByTestId('new-navigation-item').getByLabel('URL').blur();
await modal.getByRole('button', {name: 'OK'}).click();
await modal.getByRole('button', {name: 'Save'}).click();
await expect(modal).not.toBeVisible();
@ -68,7 +68,7 @@ test.describe('Navigation settings', async () => {
await primaryItem.getByLabel('URL').press('Backspace');
await primaryItem.getByLabel('URL').fill('google.com');
await modal.getByRole('button', {name: 'OK'}).click();
await modal.getByRole('button', {name: 'Save'}).click();
await expect(primaryItem.getByText('You must specify a label')).toHaveCount(1);
await expect(primaryItem.getByText('You must specify a valid URL or relative path')).toHaveCount(1);
@ -149,7 +149,7 @@ test.describe('Navigation settings', async () => {
await newItem.getByTestId('add-button').click();
await modal.getByRole('button', {name: 'Cancel'}).click();
await modal.getByRole('button', {name: 'Close'}).click();
await expect(page.getByTestId('confirmation-modal')).toHaveText(/leave/i);