@@ -59,6 +59,7 @@ export default {
data() {
return {
isModalVisible: false,
+ isModalTextCarouselVisible: false,
};
},
props: {
@@ -66,15 +67,30 @@ export default {
type: Boolean,
default: false,
},
+ showLoader: {
+ type: Boolean,
+ default: false,
+ },
+ showTextCarousel: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
layoutClass() {
return this.notFullScreen ? "card-layout" : "full-screen container-fluid";
},
+ showModalContent() {
+ return this.isModalVisible || this.showLoader;
+ },
+ showTextCarouselContent() {
+ return this.isModalTextCarouselVisible || this.showTextCarousel;
+ },
},
methods: {
- showModal() {
+ showModal(showTextCarousel = true) {
//Display modal
+ this.isModalTextCarouselVisible = showTextCarousel;
this.isModalVisible = true;
//Force page reload on back button
window.addEventListener(
diff --git a/src/helpers/loading-modal-helper.js b/src/helpers/loading-modal-helper.js
new file mode 100644
index 000000000..d5ab5d91d
--- /dev/null
+++ b/src/helpers/loading-modal-helper.js
@@ -0,0 +1,18 @@
+import { reactive } from "vue";
+
+// state encapsulated and managed by the composable
+const globalNonpersistedState = reactive({
+ showLoadingModal: true,
+ showTextCarousel: false,
+});
+
+export const showFmgLoadingModal = (newValue, showTextCarousel = false) => {
+ if (newValue !== undefined) {
+ globalNonpersistedState.showLoadingModal = newValue;
+ }
+ if (showTextCarousel !== undefined) {
+ globalNonpersistedState.showTextCarousel = showTextCarousel;
+ }
+
+ return { globalNonpersistedState };
+};
diff --git a/src/router/index.js b/src/router/index.js
index 0903ccac6..0a1bef3a3 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -8,6 +8,7 @@ import { globalEvents, globalEventTypes } from "@/constants/events";
import { queryStrings } from "@/constants/query-strings";
import { getQuerystringParameter } from "@/helpers/querystring-helper";
import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
+import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
// Heritage integration
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
@@ -154,6 +155,11 @@ router.beforeEach(async (to, from, next) => {
// use current page url query string name when to.name is "root" (due to unresolved navigation in beforeEach)
router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name;
+ const fromQueryPage = from.query?.fmgPage;
+ if (fromQueryPage === undefined) {
+ showFmgLoadingModal(true);
+ }
+
next();
});
@@ -171,6 +177,8 @@ router.afterEach(async (to, from) => {
}
}
+ showFmgLoadingModal(false);
+
// Push page view to GA
analyticsMixin.methods.pushPageViewToGA();