Summary: | Problems introduced by bug 25728 | ||
---|---|---|---|
Product: | Koha | Reporter: | Klas Blomberg <klas.blomberg> |
Component: | Cataloging | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, kyle, m.de.rooy, margaret |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00
|
|
Bug Depends on: | |||
Bug Blocks: | 29137 | ||
Attachments: |
Bug 29030: Make authorized value and description fields required
Bug 29030: Make authorized value and description fields required Bug 29030: Make authorized value and description fields required |
Description
Klas Blomberg
2021-09-15 13:20:57 UTC
At the very least the authorized value and description fields should be mandatory in the modal form. Created attachment 124905 [details] [review] Bug 29030: Make authorized value and description fields required This patch modifies the markup of the "Create a new authorized value" modal so that a minimum set of fields is required: Authorized value and description. The patch also modifies the JavaScript which handles the submission so that the jQuery Validation plugin can handle the field checks. The spelling "authorised" is changed to "authorized" following coding guidelines. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Locate a record in the catalog which has items and open an item for editing. - In the add item form, test the process of adding an authorized value on the fly with the following fields: Withdrawn, Lost, Damaged, Use restrictions, Not for loan, Collection code, Shelving location, and Shelving control number. - In each case you should be able to type a new value in the dropdown's search box and be shown the option "Select to create." - Selecting should trigger a modal window, "Create a new authorized value." - Test that both "Authorized value" and "Description" fields are required, and the form can't be submitted without them. - Test that an error message shows up when you submit an authorized value which already exists, e.g. authval "1" for "DAMAGED." - After triggering this error, click the "Cancel" button and try creating another new authorized value. When the modal reopens the form should be reset: No previously-entered data, no error messages. - Submitting a valid form with a new authorized value should work correctly. The modal window should close automatically. (In reply to Owen Leonard from comment #1) > At the very least the authorized value and description fields should be > mandatory in the modal form. My patch makes this change along with some other interface improvements. It would be nice if errors triggered by duplicate authorized values were better handled... Right now it triggers a 500 error which shows up in the browser console. Created attachment 124920 [details] [review] Bug 29030: Make authorized value and description fields required This patch modifies the markup of the "Create a new authorized value" modal so that a minimum set of fields is required: Authorized value and description. The patch also modifies the JavaScript which handles the submission so that the jQuery Validation plugin can handle the field checks. The spelling "authorised" is changed to "authorized" following coding guidelines. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Locate a record in the catalog which has items and open an item for editing. - In the add item form, test the process of adding an authorized value on the fly with the following fields: Withdrawn, Lost, Damaged, Use restrictions, Not for loan, Collection code, Shelving location, and Shelving control number. - In each case you should be able to type a new value in the dropdown's search box and be shown the option "Select to create." - Selecting should trigger a modal window, "Create a new authorized value." - Test that both "Authorized value" and "Description" fields are required, and the form can't be submitted without them. - Test that an error message shows up when you submit an authorized value which already exists, e.g. authval "1" for "DAMAGED." - After triggering this error, click the "Cancel" button and try creating another new authorized value. When the modal reopens the form should be reset: No previously-entered data, no error messages. - Submitting a valid form with a new authorized value should work correctly. The modal window should close automatically. Signed-off-by: David Nind <david@davidnind.com> Created attachment 125337 [details] [review] Bug 29030: Make authorized value and description fields required This patch modifies the markup of the "Create a new authorized value" modal so that a minimum set of fields is required: Authorized value and description. The patch also modifies the JavaScript which handles the submission so that the jQuery Validation plugin can handle the field checks. The spelling "authorised" is changed to "authorized" following coding guidelines. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Locate a record in the catalog which has items and open an item for editing. - In the add item form, test the process of adding an authorized value on the fly with the following fields: Withdrawn, Lost, Damaged, Use restrictions, Not for loan, Collection code, Shelving location, and Shelving control number. - In each case you should be able to type a new value in the dropdown's search box and be shown the option "Select to create." - Selecting should trigger a modal window, "Create a new authorized value." - Test that both "Authorized value" and "Description" fields are required, and the form can't be submitted without them. - Test that an error message shows up when you submit an authorized value which already exists, e.g. authval "1" for "DAMAGED." - After triggering this error, click the "Cancel" button and try creating another new authorized value. When the modal reopens the form should be reset: No previously-entered data, no error messages. - Submitting a valid form with a new authorized value should work correctly. The modal window should close automatically. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Error display change: Before: https://snipboard.io/oGy94Y.jpg After : https://snipboard.io/cN1FnV.jpg Looks better! Klas, is this patch answering your need? If not, please open a new bug report. Pushed to master for 21.11, thanks to everybody involved! |