Updated error message shown when trying to overwrite a default theme (#20301)

ref
https://linear.app/tryghost/issue/ONC-57/trying-to-overwrite-the-default-source-theme-crashes-ghost

- No functional change, just an update to the error message to follow
our writing guidelines for error messages
This commit is contained in:
Chris Raible 2024-05-31 14:01:44 -07:00 committed by GitHub
parent 46cb819feb
commit 9891abd61c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -92,13 +92,13 @@ const ThemeToolbar: React.FC<ThemeToolbarProps> = ({
const existingThemeNames = themes.map(t => t.name);
if (isDefaultOrLegacyTheme({name: themeFileName})) {
NiceModal.show(ConfirmationModal, {
title: 'Cannot overwrite theme',
title: 'Upload failed',
cancelLabel: 'Cancel',
okLabel: '',
prompt: (
<>
<p>Sorry, <strong>{themeFileName}</strong> is a default theme and cannot be overwritten.</p>
<p>Please rename your zip file and try again.</p>
<p>The default <strong>{themeFileName}</strong> theme cannot be overwritten.</p>
<p>Rename your zip file and try again.</p>
</>
),
onOk: async (confirmModal) => {

View File

@ -243,6 +243,6 @@ test.describe('Theme settings', async () => {
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(`${__dirname}/../../utils/responses/source.zip`);
await expect(page.getByTestId('confirmation-modal')).toHaveText(/Cannot overwrite theme/);
await expect(page.getByTestId('confirmation-modal')).toHaveText(/Upload failed/);
});
});