diff --git a/.env.example b/.env.example index 5202ca4..504aeba 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ VUE_APP_I18N_LOCALE=en VUE_APP_I18N_FALLBACK_LOCALE=en VUE_APP_LOCALES={"en": "English", "ja": "日本語", "es": "Español"} VUE_APP_CURRENCY_FORMATS={"en": {"currency": {"style": "currency","currency": "USD"}}, "ja": {"currency": {"style": "currency", "currency": "JPY"}}, "es": {"currency": {"style": "currency","currency": "ESP"}}} -VUE_APP_DEFAULT_ALIAS= \ No newline at end of file +VUE_APP_DEFAULT_ALIAS= +VUE_APP_MAARG_LOGIN=["order-routing"] \ No newline at end of file diff --git a/src/assets/images/OrderRouting.svg b/src/assets/images/OrderRouting.svg new file mode 100644 index 0000000..a2b2b82 --- /dev/null +++ b/src/assets/images/OrderRouting.svg @@ -0,0 +1,23 @@ + diff --git a/src/locales/en.json b/src/locales/en.json index 64ff952..b8ef5a3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -5,6 +5,7 @@ "Logout": "Logout", "Logging out...": "Logging out...", "Next": "Next", + "Not configured": "Not configured", "OMS": "OMS", "Password": "Password", "Please fill in the OMS": "Please fill in the OMS", @@ -12,5 +13,6 @@ "Processing": "Processing", "Something went wrong while login. Please contact administrator.": "Something went wrong while login. Please contact administrator.", "Sorry, your username or password is incorrect. Please try again.": "Sorry, your username or password is incorrect. Please try again.", + "This application is not enabled for your account": "This application is not enabled for your account", "Username": "Username" } \ No newline at end of file diff --git a/src/store/auth.ts b/src/store/auth.ts index f0e092a..04f07e5 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -14,7 +14,8 @@ export const useAuthStore = defineStore('authStore', { value: '', expiration: undefined }, - redirectUrl: '' + redirectUrl: '', + maargOms: '' }), getters: { isAuthenticated: (state) => { @@ -32,6 +33,7 @@ export const useAuthStore = defineStore('authStore', { return baseURL.startsWith('http') ? baseURL.includes('/api') ? baseURL : `${baseURL}/api/` : `https://${baseURL}.hotwax.io/api/` }, getRedirectUrl: (state) => state.redirectUrl, + getMaargOms: (state) => state.maargOms }, actions: { setOMS(oms: string) { @@ -103,6 +105,7 @@ export const useAuthStore = defineStore('authStore', { expiration: undefined } this.redirectUrl = '' + this.maargOms = '' updateToken(''); emitter.emit('dismissLoader') }, @@ -115,6 +118,9 @@ export const useAuthStore = defineStore('authStore', { }, async setCurrent(current: any) { this.current = current + }, + async setMaargInstance(url: string) { + this.maargOms = url } }, persist: true diff --git a/src/util/index.ts b/src/util/index.ts index 767643e..945221d 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -10,4 +10,9 @@ const showToast = async (message: string) => { return toast.present(); } -export { showToast } \ No newline at end of file +const isMaargLogin = (handle: string) => { + const maargLoginApps = JSON.parse(process.env.VUE_APP_MAARG_LOGIN ? process.env.VUE_APP_MAARG_LOGIN : []) + return maargLoginApps.some((appName: string) => handle.includes(appName)) +} + +export { isMaargLogin, showToast } \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index 25c5ac9..8ae0a9e 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -36,17 +36,20 @@