Skip to content
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

Closed
canstudios-kent opened this issue Jul 10, 2019 · 7 comments
Assignees
Labels

Comments

@canstudios-kent
Copy link

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

  • Authoring Tool Version: v0.9.0
  • Framework Version:
@canstudios-kent canstudios-kent changed the title Theme editor: Changes to error messages Theme editor: Changes to error messages and behaviour when saving preset names Jul 10, 2019
@canstudios-nicolaw canstudios-nicolaw added this to the Bugpatch milestone Jul 10, 2019
@canstudios-nicolaw canstudios-nicolaw self-assigned this Jul 16, 2019
@canstudios-nicolaw canstudios-nicolaw added the S: in-progress Issues currently being worked on - leave these be! label Jul 16, 2019
@canstudios-nicolaw
Copy link
Contributor

@tomgreenfield @dancgray

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)

preseterror

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):

manageerrorstyle

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?

@tomgreenfield
Copy link
Contributor

I wouldn't try too hard matching Sweet Alert's styling; we could go with something as simple as in the scaffold:

error

@canstudios-nicolaw
Copy link
Contributor

Thanks @tomgreenfield

Are you suggesting we go with this style for just the edit existing preset modal or both?

@tomgreenfield
Copy link
Contributor

Not fussed; just the edit modal is fine.

@canstudios-nicolaw canstudios-nicolaw added S: awaiting-review Completed issues waiting on reviews S: merged Completed, reviewed, and merged issues and removed S: in-progress Issues currently being worked on - leave these be! S: awaiting-review Completed issues waiting on reviews labels Jul 24, 2019
@canstudios-scottd
Copy link

canstudios-scottd commented Aug 19, 2019

Testing results:

If a user selects [cancel] before saving a preset, or after attempting to save a preset with a blank name, a preset names 'false' is created automatically. The user is able to do this multiple times, creating many presets with the same name (false).

From preset manager, attempting to save the 'false' preset causes an error to show 'There is already a preset with this name'. This occurs even if 'false' is the only preset in the manager with this name. However renaming or editing 'false' will save the preset as expected.

Screenshot from 2019-08-19 11-15-29

Screenshot from 2019-08-19 11-14-32

Screenshot from 2019-08-19 11-14-08

@canstudios-nicolaw canstudios-nicolaw removed the S: merged Completed, reviewed, and merged issues label Aug 19, 2019
@canstudios-scottd
Copy link

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:

  1. Create 2 presets, in this case 'rain' and 'coffee'
  2. Rename 'rain' to 'coffee' and see the error message appear
  3. Change this preset back to 'rain'
  4. Notice how clicking [Save changes] at this point does nothing

@canstudios-nicolaw
Copy link
Contributor

^ Separate issue raised here for this edge case #2424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants