Created attachment 154319 [details] [review] Bug 34497: Dialog component should allow for optional input options on confirmation modal Currently supports 'Text' or 'Date' inputs
Currently missing cypress tests for this.
(In reply to Pedro Amorim from comment #2) > Currently missing cypress tests for this. Cypress tests will come in the ERM sushi submission, where the code that makes use of this exists. Coming up with a test patch for this.
Created attachment 154329 [details] [review] Bug 34497: [DO NOT PUSH] Test patch only Test plan (Apply both patches, including TEST PATCH): 1) Go to ERM /cgi-bin/koha/erm/agreements 2) Add a new agreement, with whatever values 3) Go back to agreements list, click 'delete' on that agreement 4) Verify the confirmation dialog now shows 2 inputs from the test patch 5) Change the values in the inputs and confirm the dialog 6) Notice that not only the agreement gets deleted, but console now shows the values submitted 7) Bonus: Test both Text and Date input types and required: true or false
Created attachment 154332 [details] [review] Bug 34497: Dialog component should allow for optional input options on confirmation modal Currently supports 'Text' or 'Date' inputs
Created attachment 154333 [details] [review] Bug 34497: [DO NOT PUSH] Test patch only Test plan (Apply both patches, including TEST PATCH): 1) Go to ERM /cgi-bin/koha/erm/agreements 2) Add a new agreement, with whatever values 3) Go back to agreements list, click 'delete' on that agreement 4) Verify the confirmation dialog now shows 2 inputs from the test patch 5) Change the values in the inputs and confirm the dialog 6) Notice that not only the agreement gets deleted, but console now shows the values submitted 7) Bonus: Test both Text and Date input types and required: true or false
Created attachment 157519 [details] [review] Bug 34497: Dialog component should allow for optional input options on confirmation modal Currently supports 'Text' or 'Date' inputs
Created attachment 157520 [details] [review] Bug 34497: [DO NOT PUSH] Test patch only Test plan (Apply both patches, including TEST PATCH): 1) Go to ERM /cgi-bin/koha/erm/agreements 2) Add a new agreement, with whatever values 3) Go back to agreements list, click 'delete' on that agreement 4) Verify the confirmation dialog now shows 2 inputs from the test patch 5) Change the values in the inputs and confirm the dialog 6) Notice that not only the agreement gets deleted, but console now shows the values submitted 7) Bonus: Test both Text and Date input types and required: true or false
Looks good to me.. adding my signoff to keep it moving along.
Created attachment 157521 [details] [review] Bug 34497: Dialog component should allow for optional input options on confirmation modal Currently supports 'Text' or 'Date' inputs Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 157522 [details] [review] Bug 34497: [DO NOT PUSH] Test patch only Test plan (Apply both patches, including TEST PATCH): 1) Go to ERM /cgi-bin/koha/erm/agreements 2) Add a new agreement, with whatever values 3) Go back to agreements list, click 'delete' on that agreement 4) Verify the confirmation dialog now shows 2 inputs from the test patch 5) Change the values in the inputs and confirm the dialog 6) Notice that not only the agreement gets deleted, but console now shows the values submitted 7) Bonus: Test both Text and Date input types and required: true or false Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
"required" does not work. - input => input.required && input.value == null + input => input.required && input.value == "" Works for input, but still not working for dates.
Created attachment 157527 [details] [review] Bug 34497: Fix required text field input.value can be either null (if flatpickr date field empty) or '' (if simple text input empty), so check for !input.value instead to account for both situations. Add missing 'required' attribute to text inputs.
Created attachment 157530 [details] [review] Bug 34497: (QA follow-up):Fix required text field input.value can be either null (if flatpickr date field empty) or '' (if simple text input empty), so account for both situations. Add missing 'required' attribute to text inputs.
Created attachment 157531 [details] [review] Bug 34497: Dialog component should allow for optional input options on confirmation modal Currently supports 'Text' or 'Date' inputs Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 157532 [details] [review] Bug 34497: (QA follow-up):Fix required text field input.value can be either null (if flatpickr date field empty) or '' (if simple text input empty), so account for both situations. Add missing 'required' attribute to text inputs. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x