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
Theme editor: Changes to error messages and behaviour when saving preset names #2382
Comments
For part a), there is already similar functionality in the user area if you attempt to change a users password to nothing. I think it makes sense to implement that here (pictured) For parts b) and c) we need to be able to show errors on the manage presets modal. Before I implement this, please can we agree on styling? How do you both feel about the following (I'd make sure colours/font sizes match the previous image): I don't know how easy it will be to get that error icon shown in picture 1 as it's part of sweet alert, I can have a quick look but I don't think it's worth putting lots of effort into making sure it is there? |
Thanks @tomgreenfield Are you suggesting we go with this style for just the edit existing preset modal or both? |
Not fussed; just the edit modal is fine. |
Testing Update: Attempting to rename a preset to its original name after the error message 'A preset with that name already exists' will not save. Steps to reproduce:
|
^ Separate issue raised here for this edge case #2424 |
Expected Behaviour
When creating or managing edit presets, error messages should appear when attempting to use taken preset names or save changes to the preset when the name field is empty.
Actual Behaviour
a. During preset creation, user can still save when the name field is empty. The preset isn't saved and a 500 error appears in the browser console tool instead. Can the user be prevented from doing this, and an error modal warning about the field being empty appear?
b. During preset management, user can still save when the name field is empty. The error modal displays "Error [object Object]". Please can the previous preset name be kept instead of being overwritten by nothing, and the resulting error message be similar to part (a)?
c. During preset management, the user can edit a preset's name to be the same as another preset (for that base theme). This is prevented during preset creation. Please can presets be prevented from being edited to have the same name as other presets within that base theme?
Steps to Reproduce
1a. In Theme editor, click Save as preset. Open the browser dev console.
2a. With the name field empty, click Ok. Notice that the modal closes, yet the preset isn't saved, and a 500 error appears in the browser console.
1b. In Theme editor, click Manage presets.
2b. Click Edit name next to a preset. Clear the field.
3b. Click Save changes. Notice that the error modal reads "Error [object Object]", and that the name has been saved as an empty field.
1c. In Theme editor, click Manage presets.
2c. Click Edit name next to a preset. Edit the name to another preset on the list.
3c. Click Save changes. Notice that the changes are saved.
Versions
The text was updated successfully, but these errors were encountered: