Description
Jonathan Druart
2023-02-09 13:56:25 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 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. Well, it's not working. A validation step takes place AFTER the form is recovered by the "submitting..." block. 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. 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? Created attachment 146469 [details] [review] Bug 32939: Have a generic fetch function for POST and PUT requests in vue modules In bug 32925 it's discussed the possibility of having a generic fetch function to handle basic CRUD creates and edits for vuejs modules in the future and move all common POST+PUT async requests workflow in there, like the 'Submitting...' loading behaviour. This POC illustrates this and it's intent is to start discussion, plan on iterating further to the rest of ERM if agreed upon. 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 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. Created attachment 146685 [details] [review] Bug 32925: Handle submission notification at fetch level This is done in a single place now! Created attachment 146686 [details] [review] Bug 32925: Add test This is awesome! I think simplicity is the right call here. Created attachment 146689 [details] [review] Bug 32925: Rename isSubmitting with submitting Asking to do somthing, not asking if it's being done 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 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. Created attachment 147047 [details] [review] Bug 32925: Handle submission notification at fetch level This is done in a single place now! Created attachment 147048 [details] [review] Bug 32925: Add test Created attachment 147049 [details] [review] Bug 32925: Rename isSubmitting with submitting Asking to do somthing, not asking if it's being done 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> 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> 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> Created attachment 147079 [details] [review] Bug 32925: Add test Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> 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> 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> 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> 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> 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> 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> Pushed to master for 23.05. Nice work everyone, thanks! Nice work everyone! Pushed to stable for 22.11.x Not needed in 22.05.x |