Bug 37209

Summary: Improve record overlay rules validation and styling
Product: Koha Reporter: Jan Kissig <bibliothek>
Component: System AdministrationAssignee: Jan Kissig <bibliothek>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: trivial    
Priority: P5 - low CC: david, gmcharlt, martin.renvoize, ovezina
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 36880    
Bug Blocks:    
Attachments: Bug 37209: improve Record overlay rules validation and styling
Bug 37209: improve Record overlay rules validation and styling
Bug 37209: improve Record overlay rules validation and styling
Bug 37209: (QA follow-up) Add default op value to form

Description Jan Kissig 2024-06-27 10:25:08 UTC
As mentioned in BUG 36880#11 this page needs an update on the following points:

- validation of input "Tag" as per coding guidelines
- change styling of "required" class on input "Tag" to be consistent with other required input lements
Comment 1 Jan Kissig 2024-07-03 13:09:51 UTC
Created attachment 168447 [details] [review]
Bug 37209: improve Record overlay rules validation and styling

This patch adds jquery form validation to the input named tag. It also changes the behavior for save and edit actions which now both can be triggered by pressing enter. Batch deletion will be only possible if no edit is taking place.

Test plan:
1)
 a) open http://localhost:8081/cgi-bin/koha/admin/marc-overlay-rules.pl
 b) just click + Add rule
 c) the input 'tag' gets highlighted and the form won't submit

2)
 a) edit an existing rule
 b) empty input value for tag
 c) notice the checkboxes for batch deletion on other rules if existing
 d) click Save and check the input 'tag' gets highlighted and the form won't submit

apply patch
1) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required.

2) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. Also checkboxes for batchremove actions are gone.



Current depends: 36880
Comment 2 David Nind 2024-07-04 01:02:37 UTC
Added assignee.
Comment 3 Olivier Vezina 2024-09-09 16:35:44 UTC
Created attachment 171215 [details] [review]
Bug 37209: improve Record overlay rules validation and styling

This patch adds jquery form validation to the input named tag. It also changes the behavior for save and edit actions which now both can be triggered by pressing enter. Batch deletion will be only possible if no edit is taking place.

Test plan:
1)
 a) open http://localhost:8081/cgi-bin/koha/admin/marc-overlay-rules.pl
 b) just click + Add rule
 c) the input 'tag' gets highlighted and the form won't submit

2)
 a) edit an existing rule
 b) empty input value for tag
 c) notice the checkboxes for batch deletion on other rules if existing
 d) click Save and check the input 'tag' gets highlighted and the form won't submit

apply patch
1) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required.

2) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. Also checkboxes for batchremove actions are gone.

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Comment 4 Martin Renvoize (ashimema) 2024-10-28 14:43:00 UTC
Created attachment 173543 [details] [review]
Bug 37209: improve Record overlay rules validation and styling

This patch adds jquery form validation to the input named tag. It also changes the behavior for save and edit actions which now both can be triggered by pressing enter. Batch deletion will be only possible if no edit is taking place.

Test plan:
1)
 a) open http://localhost:8081/cgi-bin/koha/admin/marc-overlay-rules.pl
 b) just click + Add rule
 c) the input 'tag' gets highlighted and the form won't submit

2)
 a) edit an existing rule
 b) empty input value for tag
 c) notice the checkboxes for batch deletion on other rules if existing
 d) click Save and check the input 'tag' gets highlighted and the form won't submit

apply patch
1) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required.

2) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. Also checkboxes for batchremove actions are gone.

Signed-off-by: Olivier Vezina <olivier.vezina@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-10-29 14:59:52 UTC
Always happy to see patches from our growing 'German community' :)
Comment 6 Katrin Fischer 2024-10-29 15:17:12 UTC
I am sorry, not quite ready to push this yet as it breaks the test:

xt/find-missing-op-in-forms.t .... 1/1 
#   Failed test 'The <form> in the following files are missing it's corresponding op parameter, or op does not start with 'cud-' (see bug 34478)'
#   at xt/find-missing-op-in-forms.t line 43.
#          got: '1'
#     expected: '0'
# $VAR1 = 'koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt:72';
# Looks like you failed 1 test of 1.
xt/find-missing-op-in-forms.t .... Dubious, test returned 1 (wstat 256, 0x100)

Please provide the fix as a separate follow-up patch and reset to PQA.
Comment 7 Jan Kissig 2024-10-29 19:11:07 UTC
Created attachment 173686 [details] [review]
Bug 37209: (QA follow-up) Add default op value to form
Comment 8 Katrin Fischer 2024-10-30 06:48:37 UTC
Pushed for 24.11!

Well done everyone, thank you!