Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
6 changes: 4 additions & 2 deletions src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ interface App {
resource: string,
type: string,
appPermission?: string,
appLegacyPermission?: string
appLegacyPermission?: string,
isProdLegacyMode?: boolean
}

const appInfo = [{
Expand Down Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 : ''}` : '')
},
Expand Down
4 changes: 4 additions & 0 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
await this.authStore.setMaargInstance(resp.data.maargInstanceUrl)
}
} catch (error) {
console.error(error)

Check warning on line 246 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 246 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async login() {
Expand All @@ -265,7 +265,7 @@
this.router.push('/')
}
} catch (error) {
console.error(error)

Check warning on line 268 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 268 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
this.isLoggingIn = false;
},
Expand All @@ -280,7 +280,7 @@
}
} catch (error) {
this.router.push('/')
console.error(error)

Check warning on line 283 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 283 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async basicLogin() {
Expand Down Expand Up @@ -337,6 +337,10 @@
}
}

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 : ''}`)
}
Expand Down
Loading