Bug 32925

Summary: Display loading info when a form is submitted
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: agustinmoyano, jonathan.druart, jonathan.field, lucas, martin.renvoize, matt.blenkinsop, paul.derscheid, pedro.amorim, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This gives the end user more visual feedback when a form is submitted in eRM.
Version(s) released in:
23.05.00,22.11.04
Bug Depends on: 32939    
Bug Blocks: 32968, 32983, 35919, 32607    
Attachments: Bug 32925: Display loading info when a form is submitted
Bug 32925: Use a new state for this message
Bug 32939: Have a generic fetch function for POST and PUT requests in vue modules
Bug 32925: Display loading info when a form is submitted
Bug 32925: Use a new state for this message
Bug 32925: Handle submission notification at fetch level
Bug 32925: Add test
Bug 32925: Rename isSubmitting with submitting
Bug 32925: Display loading info when a form is submitted
Bug 32925: Use a new state for this message
Bug 32925: Handle submission notification at fetch level
Bug 32925: Add test
Bug 32925: Rename isSubmitting with submitting
Bug 32925: Display loading info when a form is submitted
Bug 32925: Use a new state for this message
Bug 32925: Handle submission notification at fetch level
Bug 32925: Add test
Bug 32925: Rename isSubmitting with submitting
Bug 32925: Display loading info when a form is submitted
Bug 32925: Use a new state for this message
Bug 32925: Handle submission notification at fetch level
Bug 32925: Add test
Bug 32925: Rename isSubmitting with submitting

Description Jonathan Druart 2023-02-09 13:56:25 UTC
For instance when we attach large documents, the form is slow to submit, but there is user feedback and they will be tempted to submit again
Comment 1 Jonathan Druart 2023-02-09 14:00:08 UTC
Created attachment 146428 [details] [review]
Bug 32925: Display loading info when a form is submitted

With this new ButtonSubmit component all our submit buttons will look
and behave identically.
Here we need a "submitting" information to be displayed, and the form to
be "deactivated".

This patch is a POC and use the new component on the add agreement and
delete agreement forms

Test plan:
It's easier to test if you add a sleep in the relevant place
(Koha/REST/V1/ERM/Agreements.pm for list and add/update)
Confirm that you see a "Submitting..." in the middle of the screen
Comment 2 Jonathan Druart 2023-02-09 14:01:32 UTC
Can you confirm this is a good way to have that? Something better to suggest?

I would like to use the component on all other forms, waiting for feedback before spending more time on this.
Comment 3 Jonathan Druart 2023-02-09 14:05:11 UTC
Well, it's not working. A validation step takes place AFTER the form is recovered by the "submitting..." block.
Comment 4 Jonathan Druart 2023-02-09 15:25:42 UTC
Created attachment 146436 [details] [review]
Bug 32925: Use a new state for this message

The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.
Comment 5 Jonathan Druart 2023-02-09 15:26:50 UTC
I am quite happy with this second patch. It could then be moved to 'fetch' and apply to all POST request without the need to modify every components. What do you think?
Comment 6 Pedro Amorim 2023-02-10 12:20:23 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2023-02-15 11:57:57 UTC
Created attachment 146683 [details] [review]
Bug 32925: Display loading info when a form is submitted

With this new ButtonSubmit component all our submit buttons will look
and behave identically.
Here we need a "submitting" information to be displayed, and the form to
be "deactivated".

This patch is a POC and use the new component on the add agreement and
delete agreement forms

Test plan:
It's easier to test if you add a sleep in the relevant place
(Koha/REST/V1/ERM/Agreements.pm for list and add/update)
Confirm that you see a "Submitting..." in the middle of the screen
Comment 8 Jonathan Druart 2023-02-15 11:58:00 UTC
Created attachment 146684 [details] [review]
Bug 32925: Use a new state for this message

The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.
Comment 9 Jonathan Druart 2023-02-15 11:58:03 UTC
Created attachment 146685 [details] [review]
Bug 32925: Handle submission notification at fetch level

This is done in a single place now!
Comment 10 Jonathan Druart 2023-02-15 11:58:06 UTC
Created attachment 146686 [details] [review]
Bug 32925: Add test
Comment 11 Paul Derscheid 2023-02-15 12:48:46 UTC
This is awesome! I think simplicity is the right call here.
Comment 12 Jonathan Druart 2023-02-15 13:17:50 UTC
Created attachment 146689 [details] [review]
Bug 32925: Rename isSubmitting with submitting

Asking to do somthing, not asking if it's being done
Comment 13 Jonathan Druart 2023-02-21 13:58:15 UTC
Created attachment 147045 [details] [review]
Bug 32925: Display loading info when a form is submitted

With this new ButtonSubmit component all our submit buttons will look
and behave identically.
Here we need a "submitting" information to be displayed, and the form to
be "deactivated".

This patch is a POC and use the new component on the add agreement and
delete agreement forms

Test plan:
It's easier to test if you add a sleep in the relevant place
(Koha/REST/V1/ERM/Agreements.pm for list and add/update)
Confirm that you see a "Submitting..." in the middle of the screen
Comment 14 Jonathan Druart 2023-02-21 13:58:19 UTC
Created attachment 147046 [details] [review]
Bug 32925: Use a new state for this message

The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.
Comment 15 Jonathan Druart 2023-02-21 13:58:22 UTC
Created attachment 147047 [details] [review]
Bug 32925: Handle submission notification at fetch level

This is done in a single place now!
Comment 16 Jonathan Druart 2023-02-21 13:58:25 UTC
Created attachment 147048 [details] [review]
Bug 32925: Add test
Comment 17 Jonathan Druart 2023-02-21 13:58:28 UTC
Created attachment 147049 [details] [review]
Bug 32925: Rename isSubmitting with submitting

Asking to do somthing, not asking if it's being done
Comment 18 Matt Blenkinsop 2023-02-21 17:08:43 UTC
Created attachment 147076 [details] [review]
Bug 32925: Display loading info when a form is submitted

With this new ButtonSubmit component all our submit buttons will look
and behave identically.
Here we need a "submitting" information to be displayed, and the form to
be "deactivated".

This patch is a POC and use the new component on the add agreement and
delete agreement forms

Test plan:
It's easier to test if you add a sleep in the relevant place
(Koha/REST/V1/ERM/Agreements.pm for list and add/update)
Confirm that you see a "Submitting..." in the middle of the screen

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 19 Matt Blenkinsop 2023-02-21 17:08:46 UTC
Created attachment 147077 [details] [review]
Bug 32925: Use a new state for this message

The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 20 Matt Blenkinsop 2023-02-21 17:08:49 UTC
Created attachment 147078 [details] [review]
Bug 32925: Handle submission notification at fetch level

This is done in a single place now!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 21 Matt Blenkinsop 2023-02-21 17:08:52 UTC
Created attachment 147079 [details] [review]
Bug 32925: Add test

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 22 Matt Blenkinsop 2023-02-21 17:08:54 UTC
Created attachment 147080 [details] [review]
Bug 32925: Rename isSubmitting with submitting

Asking to do somthing, not asking if it's being done

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 23 Nick Clemens (kidclamp) 2023-02-24 12:51:43 UTC
Created attachment 147324 [details] [review]
Bug 32925: Display loading info when a form is submitted

With this new ButtonSubmit component all our submit buttons will look
and behave identically.
Here we need a "submitting" information to be displayed, and the form to
be "deactivated".

This patch is a POC and use the new component on the add agreement and
delete agreement forms

Test plan:
It's easier to test if you add a sleep in the relevant place
(Koha/REST/V1/ERM/Agreements.pm for list and add/update)
Confirm that you see a "Submitting..." in the middle of the screen

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 24 Nick Clemens (kidclamp) 2023-02-24 12:51:46 UTC
Created attachment 147325 [details] [review]
Bug 32925: Use a new state for this message

The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 25 Nick Clemens (kidclamp) 2023-02-24 12:51:49 UTC
Created attachment 147326 [details] [review]
Bug 32925: Handle submission notification at fetch level

This is done in a single place now!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 26 Nick Clemens (kidclamp) 2023-02-24 12:51:51 UTC
Created attachment 147327 [details] [review]
Bug 32925: Add test

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 27 Nick Clemens (kidclamp) 2023-02-24 12:51:54 UTC
Created attachment 147328 [details] [review]
Bug 32925: Rename isSubmitting with submitting

Asking to do somthing, not asking if it's being done

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 28 Tomás Cohen Arazi 2023-02-27 14:22:46 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 29 Matt Blenkinsop 2023-02-28 19:09:58 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 30 Lucas Gass 2023-03-08 14:10:12 UTC
Not needed in 22.05.x