Bugzilla – Attachment 147326 Details for
Bug 32925
Display loading info when a form is submitted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32925: Handle submission notification at fetch level
Bug-32925-Handle-submission-notification-at-fetch-.patch (text/plain), 2.22 KB, created by
Nick Clemens (kidclamp)
on 2023-02-24 12:51:49 UTC
(
hide
)
Description:
Bug 32925: Handle submission notification at fetch level
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-02-24 12:51:49 UTC
Size:
2.22 KB
patch
obsolete
>From 0f2d72e523e7ec170d6c442771df02130f94c091 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Feb 2023 12:02:31 +0100 >Subject: [PATCH] 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> >--- > .../prog/js/vue/fetch/http-client.js | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >index b4e0890aca..140b56ea99 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >@@ -1,4 +1,4 @@ >-import { setError } from "../messages"; >+import { setError, isSubmitting, submitted } from "../messages"; > > class HttpClient { > constructor(options = {}) { >@@ -12,9 +12,11 @@ class HttpClient { > endpoint, > headers = {}, > options = {}, >- return_response = false >+ return_response = false, >+ mark_submitting = false, > ) { > let res, error; >+ if ( mark_submitting) isSubmitting() > await fetch(this._baseURL + endpoint, { > ...options, > headers: { ...this._headers, ...headers }, >@@ -32,7 +34,9 @@ class HttpClient { > .catch((err) => { > error = err; > setError(err); >- }); >+ }).then(() => { >+ if (mark_submitting) submitted()}) >+ ; > > if (error) throw Error(error); > >@@ -56,7 +60,7 @@ class HttpClient { > ...params.options, > body, > method: "POST", >- }); >+ }, false, true); > } > > put(params = {}) { >@@ -69,7 +73,7 @@ class HttpClient { > ...params.options, > body, > method: "PUT", >- }); >+ }, false, true); > } > > delete(params = {}) { >@@ -81,7 +85,7 @@ class HttpClient { > ...params.options, > method: "DELETE", > }, >- true >+ true, true > ); > } > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32925
:
146428
|
146436
|
146469
|
146683
|
146684
|
146685
|
146686
|
146689
|
147045
|
147046
|
147047
|
147048
|
147049
|
147076
|
147077
|
147078
|
147079
|
147080
|
147324
|
147325
| 147326 |
147327
|
147328