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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daeccd0b8c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
1467747cd2
commit
ab862b42e1
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
|
@ -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;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue