From 8b7d4c8641dc414bca10012fec20064e280c3007 Mon Sep 17 00:00:00 2001 From: Davide Vernassa Date: Tue, 15 Oct 2024 12:52:22 +0200 Subject: [PATCH] Changed application Loading provider --- src/main.ts | 5 +++-- .../documentExecution/main/DocumentExecution.vue | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 390baae0c..7a79e6d4f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import PrimeVue from 'primevue/config' import router from './App.routes.js' import store from './App.store.js' import { createPinia } from 'pinia' -import { Quasar, Notify } from 'quasar' +import { Quasar, Notify, Loading } from 'quasar' import VueAxios from 'vue-axios' import interceptor from './axios.js' @@ -61,7 +61,8 @@ app.use(VueAxios, interceptor) .use(ResizeObserver) .use(Quasar, { plugins: { - Notify + Notify, + Loading } }) diff --git a/src/modules/documentExecution/main/DocumentExecution.vue b/src/modules/documentExecution/main/DocumentExecution.vue index 39a20c591..c70d5723c 100644 --- a/src/modules/documentExecution/main/DocumentExecution.vue +++ b/src/modules/documentExecution/main/DocumentExecution.vue @@ -414,7 +414,7 @@ export default defineComponent({ window.removeEventListener('message', this.iframeEventsListener) }, async created() { - this.setLoading(true) + this.$q.loading.show() this.setEventListeners() window.addEventListener('message', this.iframeEventsListener) @@ -423,7 +423,10 @@ export default defineComponent({ await this.loadUserConfig() this.setMode() } else { - if (this.propMode !== 'document-execution' && !this.$route.path.includes('olap-designer') && this.$route.name !== 'document-execution' && this.$route.name !== 'document-execution-embed' && this.$route.name !== 'document-execution-workspace') return + if (this.propMode !== 'document-execution' && !this.$route.path.includes('olap-designer') && this.$route.name !== 'document-execution' && this.$route.name !== 'document-execution-embed' && this.$route.name !== 'document-execution-workspace') { + this.$q.loading.hide() + return + } if (this.$route.name === 'new-dashboard') this.newDashboardMode = true await this.loadUserConfig() @@ -436,8 +439,6 @@ export default defineComponent({ document: this.document }) } - - this.setLoading(false) if (!this.document.label) return if (this.document.label === 'new-dashboard') { this.newDashboardMode = true @@ -754,6 +755,7 @@ export default defineComponent({ else if (this.$route.path.includes('olap')) this.mode = 'olap' else if (this.$route.path.includes('dashboard')) this.mode = 'dashboard' else this.mode = 'iframe' + this.$q.loading.hide() }, async loadPage(initialLoading = false, documentLabel: string | null = null, crossNavigationPopupMode = false) { this.loading = crossNavigationPopupMode ? false : true