User story: As a Commons user, when I'm adding or editing a qualifier, I want feedback if I enter an invalid value.
We have this: When a user adds a new coordinate location qualifier, the publish button is disabled until complete and valid data is entered. However, if a user changes an existing qualifier to an invalid value, they can hit publish and the qualifier is removed with no error message. To replicate:
- Add a coordinate location qualifier, publish
- Click edit and change latitude or longitude to something erroneous, e.g. over 180
- Hit publish and be confused...
I tested quantity locally (by editing the quantity to be blank) and the behavior was similar.
We want this: The qualifier is getting removed before the submit() method runs, therefore there is no error to catch and nothing is shown to the user. We either need to disable the publish button when there is invalid data (recommended) or ensure that an error message can be shown on publish.
Acceptance Criteria:
- When an invalid value is input, the Publish button becomes disabled and an error message is shown to the user. Once the input becomes valid, the Publish button is enabled.
OR
- When an invalid qualifier value is input, on publish, the process fails and an error message is shown to the user, and the qualifier is not removed.
During development, please test the following:
- Test this feature while logged in AND logged out
- Test this feature on at least one mobile browser
- Test that this feature works on the file page AND the Add Data step on UploadWizard (if applicable, some features only exist on one or the other)