Bugzilla – Attachment 147325 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: Use a new state for this message
Bug-32925-Use-a-new-state-for-this-message.patch (text/plain), 5.83 KB, created by
Nick Clemens (kidclamp)
on 2023-02-24 12:51:46 UTC
(
hide
)
Description:
Bug 32925: Use a new state for this message
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-02-24 12:51:46 UTC
Size:
5.83 KB
patch
obsolete
>From 52d1ad440ca102c96d172db624134423b080c35f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Feb 2023 16:17:09 +0100 >Subject: [PATCH] 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> >--- > .../prog/js/vue/components/ButtonSubmit.vue | 32 ++----------------- > .../prog/js/vue/components/Dialog.vue | 27 ++++++++++++++-- > .../ERM/AgreementsFormConfirmDelete.vue | 2 +- > .../intranet-tmpl/prog/js/vue/messages.js | 10 ++++++ > .../intranet-tmpl/prog/js/vue/stores/main.js | 7 ++++ > 5 files changed, 45 insertions(+), 33 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonSubmit.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonSubmit.vue >index 87e055e47a..453344956c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonSubmit.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonSubmit.vue >@@ -1,8 +1,5 @@ > <template> >- <input type="submit" variant="primary" :value="text" @click="submitting = true" /> >- <div v-if="submitting" class="modal"> >- <div class="spinner dialog alert">Submitting...</div> >- </div> >+ <input type="submit" variant="primary" :value="text" /> > </template> > > <script> >@@ -14,31 +11,6 @@ export default { > default: __("Submit"), > required: false, > }, >- submitting: { >- type: Boolean, >- default: false, >- required: false, >- }, > }, >-}; >-</script> >- >-<style scoped> >-.modal { >- position: fixed; >- z-index: 9998; >- display: table; >- transition: opacity 0.3s ease; >- left: 0px; >- top: 0px; >- width: 100%; >- height: 100%; >- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33); >-} >-.spinner { >- position: absolute; >- top: 50%; >- left: 40%; >- width: 10% > } >-</style> >\ No newline at end of file >+</script> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >index ae336ce1dd..2d35277f2b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >@@ -12,6 +12,10 @@ > > > </div> > <!-- Must be styled differently --> >+ >+ <div class="modal_centered" v-if="is_submitting"> >+ <div class="spinner dialog alert">{{ $__("Submitting...") }}</div> >+ </div> > </template> > > <script> >@@ -20,9 +24,10 @@ import { storeToRefs } from "pinia" > export default { > setup() { > const mainStore = inject("mainStore") >- const { message, error, warning } = storeToRefs(mainStore) >+ const { message, error, warning, is_submitting } = >+ storeToRefs(mainStore) > const { removeMessages } = mainStore >- return { message, error, warning, removeMessages } >+ return { message, error, warning, is_submitting, removeMessages } > }, > } > </script> >@@ -42,4 +47,22 @@ export default { > float: right; > cursor: pointer; > } >+ >+.modal_centered { >+ position: fixed; >+ z-index: 9998; >+ display: table; >+ transition: opacity 0.3s ease; >+ left: 0px; >+ top: 0px; >+ width: 100%; >+ height: 100%; >+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33); >+} >+.spinner { >+ position: absolute; >+ top: 50%; >+ left: 40%; >+ width: 10%; >+} > </style> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue >index a7415fcc0b..991c4a8770 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue >@@ -18,7 +18,7 @@ > </ol> > </fieldset> > <fieldset class="action"> >- <ButtonSubmit :text="$__('Yes, delete')"/> >+ <ButtonSubmit :text="$__('Yes, delete')" /> > <router-link > to="/cgi-bin/koha/erm/agreements" > role="button" >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js b/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js >index 14f8ac2ffa..7285f31a9f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js >@@ -22,3 +22,13 @@ export const removeMessages = function () { > const { removeMessages } = mainStore; > removeMessages(); > }; >+export const isSubmitting = function () { >+ const mainStore = useMainStore(); >+ const { isSubmitting } = mainStore; >+ isSubmitting(); >+}; >+export const submitted = function () { >+ const mainStore = useMainStore(); >+ const { submitted } = mainStore; >+ submitted(); >+}; >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >index 94311f727f..54bfe099ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >@@ -8,6 +8,7 @@ export const useMainStore = defineStore("main", { > previousMessage: null, > previousError: null, > displayed_already: false, >+ is_submitting: false, > }), > actions: { > setMessage(message) { >@@ -34,5 +35,11 @@ export const useMainStore = defineStore("main", { > } > this.displayed_already = true; > }, >+ isSubmitting(){ >+ this.is_submitting = true; >+ }, >+ submitted(){ >+ this.is_submitting = false; >+ }, > }, > }); >-- >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