From 1afb9130c0f88a5b84a3387d710f03d8dac73e3c Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 19 Feb 2024 15:12:16 +0100 Subject: [PATCH] adds a loading animation when waiting for the emails to be sent out when inserting a new profil update request --- public/js/components/Cis/Profil/EditProfil.js | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/public/js/components/Cis/Profil/EditProfil.js b/public/js/components/Cis/Profil/EditProfil.js index 9fac1ffbe..8686c3ff8 100755 --- a/public/js/components/Cis/Profil/EditProfil.js +++ b/public/js/components/Cis/Profil/EditProfil.js @@ -1,12 +1,14 @@ import BsModal from "../../Bootstrap/Modal.js"; import Alert from "../../Bootstrap/Alert.js"; import EditProfilSelect from "./EditProfilSelect.js"; +import Loader from "../../../components/Loader.js" export default { components: { BsModal, Alert, EditProfilSelect, + Loader }, mixins: [BsModal], props: { @@ -34,6 +36,7 @@ export default { editData: this.value, fileID:null, breadcrumb: null, + loading:false, result: false, info: null, @@ -68,6 +71,7 @@ export default { //? inserts new row in public.tbl_cis_profil_update //* calls the update api call if an update field is present in the data that was passed to the modal const handleApiResponse = (res) => { + this.$refs.loaderRef.hide(); if (res.data.error == 0) { this.result = true; this.hide(); @@ -83,6 +87,11 @@ export default { } }; + //? shows the loading modal and hides the EditProfil modal without returning the result promise + this.$refs.loaderRef.show(); + //* v-show on EditProfil modal binded to this.loading + this.loading=true; + this.editData.updateID ? Vue.$fhcapi.ProfilUpdate.updateProfilRequest( this.topic, @@ -135,22 +144,26 @@ export default { //? if the topic was passed through the prop add it to the component this.topic = this.editData.topic; } + }, mounted() { this.modal = this.$refs.modalContainer.modal; + }, popup(options) { return BsModal.popup.bind(this)(null, options); }, template: ` - - + + -