Bug 34497

Summary: Vue - Dialog component should allow for confirmation input options
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ERMAssignee: Pedro Amorim <pedro.amorim>
Status: RESOLVED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Bug Depends on:    
Bug Blocks: 34587, 35120    
Attachments: Bug 34497: Dialog component should allow for optional input options on confirmation modal
Bug 34497: [DO NOT PUSH] Test patch only
Bug 34497: Dialog component should allow for optional input options on confirmation modal
Bug 34497: [DO NOT PUSH] Test patch only
Bug 34497: Dialog component should allow for optional input options on confirmation modal
Bug 34497: [DO NOT PUSH] Test patch only
Bug 34497: Dialog component should allow for optional input options on confirmation modal
Bug 34497: [DO NOT PUSH] Test patch only
Bug 34497: Fix required text field
Bug 34497: (QA follow-up):Fix required text field
Bug 34497: Dialog component should allow for optional input options on confirmation modal
Bug 34497: (QA follow-up):Fix required text field

Description Pedro Amorim 2023-08-08 16:07:16 UTC

    
Comment 1 Pedro Amorim 2023-08-08 16:08:16 UTC
Created attachment 154319 [details] [review]
Bug 34497: Dialog component should allow for optional input options on confirmation modal

Currently supports 'Text' or 'Date' inputs
Comment 2 Pedro Amorim 2023-08-08 16:08:47 UTC
Currently missing cypress tests for this.
Comment 3 Pedro Amorim 2023-08-09 08:31:17 UTC
(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.
Comment 4 Pedro Amorim 2023-08-09 08:39:32 UTC
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
Comment 5 Pedro Amorim 2023-08-09 15:51:16 UTC
Created attachment 154332 [details] [review]
Bug 34497: Dialog component should allow for optional input options on confirmation modal

Currently supports 'Text' or 'Date' inputs
Comment 6 Pedro Amorim 2023-08-09 15:51:19 UTC
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
Comment 7 Martin Renvoize 2023-10-20 14:00:41 UTC
Created attachment 157519 [details] [review]
Bug 34497: Dialog component should allow for optional input options on confirmation modal

Currently supports 'Text' or 'Date' inputs
Comment 8 Martin Renvoize 2023-10-20 14:00:43 UTC
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
Comment 9 Martin Renvoize 2023-10-20 14:01:13 UTC
Looks good to me.. adding my signoff to keep it moving along.
Comment 10 Martin Renvoize 2023-10-20 14:03:14 UTC
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>
Comment 11 Martin Renvoize 2023-10-20 14:03:16 UTC
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>
Comment 12 Jonathan Druart 2023-10-20 14:19:11 UTC
"required" does not work.

-                    input => input.required && input.value == null
+                    input => input.required && input.value == ""

Works for input, but still not working for dates.
Comment 13 Pedro Amorim 2023-10-20 14:35:58 UTC Comment hidden (obsolete)
Comment 14 Pedro Amorim 2023-10-20 14:40:20 UTC
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.
Comment 15 Jonathan Druart 2023-10-20 14:48:30 UTC
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>
Comment 16 Jonathan Druart 2023-10-20 14:48:33 UTC
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>
Comment 17 Tomás Cohen Arazi 2023-10-25 14:49:14 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 18 Fridolin Somers 2023-10-26 08:37:29 UTC
Enhancement not pushed to 23.05.x