From 9a8beafc284bcfa2a45f94bb1b5922d817698d4b Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 15 Jan 2024 14:52:20 +0530 Subject: [PATCH 01/21] Improved: code for preventing redirect to login on successful log in using browser back button (#51) --- src/views/Login.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index 631448b..0a5cdc9 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -239,7 +239,7 @@ export default defineComponent({ try { await this.authStore.login(username.trim(), password) if (this.authStore.getRedirectUrl) { - window.location.href = `${this.authStore.getRedirectUrl}?oms=${this.authStore.oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}` + window.location.replace(`${this.authStore.getRedirectUrl}?oms=${this.authStore.oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}`) } else { // All the failure cases are handled in action, if then block is executing, login is successful this.username = '' @@ -255,7 +255,7 @@ export default defineComponent({ const { token, expirationTime } = this.$route.query as any await this.authStore.samlLogin(token, expirationTime) if (this.authStore.getRedirectUrl) { - window.location.href = `${this.authStore.getRedirectUrl}?oms=${this.authStore.oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}` + window.location.replace(`${this.authStore.getRedirectUrl}?oms=${this.authStore.oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}`) } else { this.router.push('/') } From d282c271eaf24c5a07ee4d88d5a9c563bfbe4df0 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 20 Feb 2024 18:23:19 +0530 Subject: [PATCH 02/21] Improved: added spinner in launchpad login next button to be shown while checkLoginOption request accomplishes (#88) --- src/views/Login.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index 631448b..cb1519e 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -11,9 +11,12 @@
+ + + - + {{ $t("Next") }} @@ -108,7 +111,8 @@ export default defineComponent({ hideBackground: true, isConfirmingForActiveSession: false, loader: null as any, - loginOption: {} as any + loginOption: {} as any, + isSpinnerActive: false }; }, ionViewWillEnter() { @@ -203,6 +207,8 @@ export default defineComponent({ return } + this.isSpinnerActive = true + const instanceURL = this.instanceUrl.trim().toLowerCase(); if (!this.baseURL) this.authStore.setOMS(this.alias[instanceURL] ? this.alias[instanceURL] : instanceURL); @@ -217,6 +223,7 @@ export default defineComponent({ } else { this.toggleOmsInput() } + this.isSpinnerActive = false }, async fetchLoginOptions() { this.loginOption = {} From 5417216d308a9816cad240d32216dd5aad1232eb Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 20 Feb 2024 18:26:33 +0530 Subject: [PATCH 03/21] Improved: added import for the IonSpinner in Login page (#88) --- src/views/Login.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/Login.vue b/src/views/Login.vue index cb1519e..e2c3c68 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -72,6 +72,7 @@ import { IonItem, IonLabel, IonPage, + IonSpinner, loadingController } from "@ionic/vue"; import { defineComponent } from "vue"; @@ -97,6 +98,7 @@ export default defineComponent({ IonItem, IonLabel, IonPage, + IonSpinner, Logo }, data () { From b542badbdd3db4f1f52fdfe1b09dccab8bfd54e6 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 21 Feb 2024 12:28:04 +0530 Subject: [PATCH 04/21] Fixed: screen halt on logging by showing a loader until succesfully logged in (#81) --- src/locales/en.json | 1 + src/views/Login.vue | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index 67b8a28..648b9bc 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -3,6 +3,7 @@ "Launch Pad": "Launch Pad", "Login": "Login", "Logout": "Logout", + "Logging in": "Loggin in", "Next": "Next", "OMS": "OMS", "Password": "Password", diff --git a/src/views/Login.vue b/src/views/Login.vue index 631448b..37334ea 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -236,6 +236,7 @@ export default defineComponent({ return } + this.presentLoader('Logging in') try { await this.authStore.login(username.trim(), password) if (this.authStore.getRedirectUrl) { @@ -249,6 +250,7 @@ export default defineComponent({ } catch (error) { console.error(error) } + this.dismissLoader() }, async samlLogin() { try { From 7006b34d5402084635e96a46748657f6e19a8582 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 21 Feb 2024 12:40:35 +0530 Subject: [PATCH 05/21] Fixed: entry in locale file for loader messgae while logging (#81) --- src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index 648b9bc..96b2e7b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -3,7 +3,7 @@ "Launch Pad": "Launch Pad", "Login": "Login", "Logout": "Logout", - "Logging in": "Loggin in", + "Logging in": "Logging in", "Next": "Next", "OMS": "OMS", "Password": "Password", From bd54b834b6a1f3f250c5242f1b317328fe7a190c Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 20 Mar 2024 12:20:52 +0530 Subject: [PATCH 06/21] Improved: variable name for checking whether api is loading or not (#88) --- src/views/Login.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index e2c3c68..5b61640 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -11,7 +11,7 @@
- + + + - + @@ -134,8 +136,8 @@ export default defineComponent({ } }, generateAppLink(app: any, appEnvironment = '') { - const oms = isMaargLogin(app.handle) ? this.authStore.getMaargOms : this.authStore.getOMS; - window.location.href = this.scheme + app.handle + appEnvironment + this.domain + (this.authStore.isAuthenticated ? `/login?oms=${oms.startsWith('http') ? isMaargLogin(app.handle) ? oms : oms.includes('/api') ? oms : `${oms}/api/` : oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${isMaargLogin(app.handle) ? '&omsRedirectionUrl=' + this.authStore.getOMS : ''}` : '') + const oms = isMaargLogin(app.handle, appEnvironment) ? this.authStore.getMaargOms : this.authStore.getOMS; + window.location.href = this.scheme + app.handle + appEnvironment + this.domain + (this.authStore.isAuthenticated ? `/login?oms=${oms.startsWith('http') ? isMaargLogin(app.handle, appEnvironment) ? oms : oms.includes('/api') ? oms : `${oms}/api/` : oms}&token=${this.authStore.token.value}&expirationTime=${this.authStore.token.expiration}${isMaargLogin(app.handle, appEnvironment) ? '&omsRedirectionUrl=' + this.authStore.getOMS : ''}` : '') } }, setup() { From 494cdadc31f066b76cdbb614d1d93dd5a5218a2e Mon Sep 17 00:00:00 2001 From: Ravi Lodhi Date: Wed, 7 Aug 2024 16:26:41 +0530 Subject: [PATCH 08/21] Improved: Added inventory count dev and uat app entries for maarg login. --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f212c93..0721cdd 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,4 @@ 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= -VUE_APP_MAARG_LOGIN=["atp", "company", "order-routing"] \ No newline at end of file +VUE_APP_MAARG_LOGIN=["atp", "company", "order-routing", "inventorycount-dev", "inventorycount-uat"] \ No newline at end of file From ae07a8c53d12a5b83c4f2676e602334b75e19ce3 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 12 Aug 2024 15:31:14 +0530 Subject: [PATCH 09/21] Improved: user card so as to allow user jump directly to the details page (#91) --- .env.example | 4 +- src/components/Image.vue | 74 +++++++++++++++++++++++++++ src/components/UserActionsPopover.vue | 65 +++++++++++++++++++++++ src/views/Home.vue | 31 +++++++++-- 4 files changed, 168 insertions(+), 6 deletions(-) create mode 100644 src/components/Image.vue create mode 100644 src/components/UserActionsPopover.vue diff --git a/.env.example b/.env.example index 0721cdd..afb02d1 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,6 @@ 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= -VUE_APP_MAARG_LOGIN=["atp", "company", "order-routing", "inventorycount-dev", "inventorycount-uat"] \ No newline at end of file +VUE_APP_MAARG_LOGIN=["atp", "company", "order-routing", "inventorycount-dev", "inventorycount-uat"] +VUE_APP_USERS_LOGIN_URL="http://users.hotwax.io/login" +VUE_APP_RESOURCE_URL= \ No newline at end of file diff --git a/src/components/Image.vue b/src/components/Image.vue new file mode 100644 index 0000000..92b9157 --- /dev/null +++ b/src/components/Image.vue @@ -0,0 +1,74 @@ + + + diff --git a/src/components/UserActionsPopover.vue b/src/components/UserActionsPopover.vue new file mode 100644 index 0000000..e69d59d --- /dev/null +++ b/src/components/UserActionsPopover.vue @@ -0,0 +1,65 @@ + + + \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index b0b73b9..72c8d30 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -10,10 +10,14 @@ - - {{ authStore.current?.partyName ? authStore.current?.partyName : authStore.current.userLoginId }} - - {{ $t('Logout') }} + + + + +

{{ authStore.current?.partyName ? authStore.current?.partyName : authStore.current.userLoginId }}

+
+ +
@@ -66,6 +70,7 @@