From 1781678d7d03ed399db59164c4d60873db3b85fd Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 6 May 2026 14:36:58 +0530 Subject: [PATCH] Added: support to redirect production version of job manager to legacy app --- .env.example | 1 + src/util/index.ts | 6 ++++-- src/views/Home.vue | 5 +++++ src/views/Login.vue | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index ed2c177..702edb5 100644 --- a/.env.example +++ b/.env.example @@ -7,3 +7,4 @@ VUE_APP_DEFAULT_ALIAS= VUE_APP_MAARG_LOGIN=["atp", "company", "order-routing", "inventorycount", "bopis", "transfers"] VUE_APP_USERS_LOGIN_URL="http://users.hotwax.io/login" VUE_APP_OMS_WITH_MAARG=["job-manager", "preorder", "users", "fulfillment", "receiving"] +VUE_APP_ALIAS= diff --git a/src/util/index.ts b/src/util/index.ts index cca33ce..eea357c 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -6,7 +6,8 @@ interface App { resource: string, type: string, appPermission?: string, - appLegacyPermission?: string + appLegacyPermission?: string, + isProdLegacyMode?: boolean } const appInfo = [{ @@ -35,7 +36,8 @@ const appInfo = [{ handle: 'job-manager', name: 'Job Manager', resource: require('../assets/images/Job.svg'), - type: 'Workflow' + type: 'Workflow', + isProdLegacyMode: true }, { handle: 'receiving', name: 'Receiving', diff --git a/src/views/Home.vue b/src/views/Home.vue index 5aa4d2d..889d2bf 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -158,6 +158,11 @@ export default defineComponent({ if(Actions[app.appLegacyPermission] && hasPermission(Actions[app.appLegacyPermission]) || (Actions[app.appPermission] && !hasPermission(Actions[app.appPermission]))) { handle = app.handle + "-legacy" } + + if(app.isProdLegacyMode && !handle.includes("-legacy") && !appEnvironment) { + handle = app.handle + "-legacy" + } + const oms = isMaargLogin(handle, appEnvironment) ? this.authStore.getMaargOms : this.authStore.getOMS; window.location.href = this.scheme + handle + appEnvironment + this.domain + (this.authStore.isAuthenticated ? `/login?oms=${oms.startsWith('http') ? isMaargLogin(handle, appEnvironment) ? oms : oms.includes('/api') ? oms : `${oms}/api/` : oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${isMaargLogin(handle, appEnvironment) ? '&omsRedirectionUrl=' + this.authStore.getOMS : isOmsWithMaarg(handle, appEnvironment) ? '&omsRedirectionUrl=' + this.authStore.getMaargOms : ''}` : '') }, diff --git a/src/views/Login.vue b/src/views/Login.vue index 4af445c..ac09617 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -337,6 +337,10 @@ export default defineComponent({ } } + if(app.isProdLegacyMode && !url.includes("-legacy") && !url.includes("-uat") && !url.includes("-dev")) { + url = url.replace(".hotwax.io", "-legacy.hotwax.io") + } + omsUrl = omsUrl ? omsUrl : this.authStore.oms.startsWith('http') ? this.authStore.oms.includes('/api') ? this.authStore.oms : `${this.authStore.oms}/api/` : this.authStore.oms window.location.replace(`${url}?oms=${omsUrl}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${omsRedirectionUrl ? '&omsRedirectionUrl=' + omsRedirectionUrl : ''}`) }