From 014d13a1bd36976b414807e47df0c91a0a9c06c0 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 13 Sep 2023 09:46:44 +0530 Subject: [PATCH 1/8] Implemented: centralized OMS instance navigation in dxp-component (#140) --- src/components/OmsInstanceNavigation.vue | 36 ++++++++++++++++++++++++ src/components/index.ts | 1 + src/index.ts | 15 ++++++---- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 src/components/OmsInstanceNavigation.vue diff --git a/src/components/OmsInstanceNavigation.vue b/src/components/OmsInstanceNavigation.vue new file mode 100644 index 0000000..4710d8a --- /dev/null +++ b/src/components/OmsInstanceNavigation.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 0879373..c47ad9b 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -14,3 +14,4 @@ import '@ionic/vue/css/text-transformation.css'; import '@ionic/vue/css/flex-utils.css'; import '@ionic/vue/css/display.css'; +export { default as OmsInstanceNavigation } from './OmsInstanceNavigation.vue' \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index d6177c7..55b850d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { createPinia } from "pinia"; import { useProductIdentificationStore } from "./store/productIdentification"; import { useAuthStore } from "./store/auth"; import Login from "./components/Login"; +import { OmsInstanceNavigation } from "./components"; import ShopifyImg from "./components/ShopifyImg"; import { goToOms } from "./utils"; import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' @@ -25,6 +26,7 @@ export let dxpComponents = { app.use(pinia); app.component('Login', Login) + app.component('OmsInstanceNavigation', OmsInstanceNavigation) app.component('ShopifyImg', ShopifyImg) loginContext.login = options.login @@ -39,13 +41,14 @@ export let dxpComponents = { } export { - useProductIdentificationStore, - useAuthStore, + appContext, + goToOms, Login, loginContext, - shopifyImgContext, + OmsInstanceNavigation, + productIdentificationContext, ShopifyImg, - goToOms, - appContext, - productIdentificationContext + shopifyImgContext, + useProductIdentificationStore, + useAuthStore } From c7a2ec0beddb8df60ac56d3b6332c845915670ba Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 13 Sep 2023 10:48:26 +0530 Subject: [PATCH 2/8] Fixed: indentation (#140) --- src/components/OmsInstanceNavigation.vue | 57 ++++++++++++------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/components/OmsInstanceNavigation.vue b/src/components/OmsInstanceNavigation.vue index 4710d8a..50c8369 100644 --- a/src/components/OmsInstanceNavigation.vue +++ b/src/components/OmsInstanceNavigation.vue @@ -1,36 +1,37 @@ \ No newline at end of file From cc9fcc7d157503ed6d7c4d2e752d3eeea2f45a59 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 13 Sep 2023 10:59:42 +0530 Subject: [PATCH 3/8] Fixed: indentations (#140) --- src/components/OmsInstanceNavigation.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/OmsInstanceNavigation.vue b/src/components/OmsInstanceNavigation.vue index 50c8369..ae4c277 100644 --- a/src/components/OmsInstanceNavigation.vue +++ b/src/components/OmsInstanceNavigation.vue @@ -22,16 +22,16 @@ \ No newline at end of file From cfd95002429b2c530f8b9ac1986d9c128a39288b Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 18 Sep 2023 14:28:35 +0530 Subject: [PATCH 4/8] Improved: used oms, token from dxp-component instead of app state (#140) --- src/components/OmsInstanceNavigation.vue | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/components/OmsInstanceNavigation.vue b/src/components/OmsInstanceNavigation.vue index 2391a8a..4924f8a 100644 --- a/src/components/OmsInstanceNavigation.vue +++ b/src/components/OmsInstanceNavigation.vue @@ -6,13 +6,13 @@ {{ "OMS instance" }} - {{ appUserState.instanceUrl }} + {{ store.getOms }} {{ 'This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.' }} - + {{ 'Go to OMS' }} @@ -21,15 +21,9 @@ \ No newline at end of file From ad8320cfb06fa49ea897a5a761d6ef6fc53fbd2c Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 19 Sep 2023 10:31:02 +0530 Subject: [PATCH 5/8] Improved: component, function name (#140) --- ...nceNavigation.vue => OmsInstanceNavigator.vue} | 15 +++++++++++---- src/components/index.ts | 4 ++-- src/index.ts | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) rename src/components/{OmsInstanceNavigation.vue => OmsInstanceNavigator.vue} (72%) diff --git a/src/components/OmsInstanceNavigation.vue b/src/components/OmsInstanceNavigator.vue similarity index 72% rename from src/components/OmsInstanceNavigation.vue rename to src/components/OmsInstanceNavigator.vue index 4924f8a..a3562a1 100644 --- a/src/components/OmsInstanceNavigation.vue +++ b/src/components/OmsInstanceNavigator.vue @@ -6,13 +6,13 @@ {{ "OMS instance" }} - {{ store.getOms }} + {{ authStore.getOms }} {{ 'This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.' }} - + {{ 'Go to OMS' }} @@ -20,10 +20,17 @@ \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 1c46eae..815e9ae 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -14,7 +14,7 @@ import '@ionic/vue/css/text-transformation.css'; import '@ionic/vue/css/flex-utils.css'; import '@ionic/vue/css/display.css'; -import OmsInstanceNavigation from './OmsInstanceNavigation.vue'; +import OmsInstanceNavigator from './OmsInstanceNavigator.vue'; import ProductIdentifier from './ProductIdentifier.vue'; -export { OmsInstanceNavigation, ProductIdentifier }; \ No newline at end of file +export { OmsInstanceNavigator, ProductIdentifier }; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4769e7b..25da3d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import { goToOms } from "./utils"; import { initialiseFirebaseApp } from "./utils/firebase" import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -import { OmsInstanceNavigation, ProductIdentifier } from "./components"; +import { OmsInstanceNavigator, ProductIdentifier } from "./components"; // TODO: handle cases when the store from app or pinia store are not available // creating a pinia store for the plugin @@ -30,7 +30,7 @@ export let dxpComponents = { app.use(pinia); app.component('Login', Login) - app.component('OmsInstanceNavigation', OmsInstanceNavigation) + app.component('OmsInstanceNavigator', OmsInstanceNavigator) app.component('ProductIdentifier', ProductIdentifier) app.component('ShopifyImg', ShopifyImg) @@ -60,7 +60,7 @@ export { Login, loginContext, noitificationContext, - OmsInstanceNavigation, + OmsInstanceNavigator, ProductIdentifier, productIdentificationContext, ShopifyImg, From f727cb4d23c099e1443d48afb81e5740aedb3caa Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 19 Sep 2023 10:37:21 +0530 Subject: [PATCH 6/8] Improved: code (#140) --- src/components/OmsInstanceNavigator.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OmsInstanceNavigator.vue b/src/components/OmsInstanceNavigator.vue index a3562a1..b5a852d 100644 --- a/src/components/OmsInstanceNavigator.vue +++ b/src/components/OmsInstanceNavigator.vue @@ -27,7 +27,8 @@ import { IonCardHeader, IonCardSubtitle, IonCardTitle, - IonIcon } from '@ionic/vue'; + IonIcon +} from '@ionic/vue'; import { goToOms } from '../utils'; import { openOutline } from 'ionicons/icons' import { useAuthStore } from "../store/auth"; From efb06a11c64bf3adbee463c0d19be5317caaa025 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 21 Sep 2023 15:53:11 +0530 Subject: [PATCH 7/8] Improved: used computed property for getting from store (#140) --- src/components/Login.ts | 12 ++++++------ src/components/OmsInstanceNavigator.vue | 15 +++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/Login.ts b/src/components/Login.ts index 6635636..cfc911c 100644 --- a/src/components/Login.ts +++ b/src/components/Login.ts @@ -64,12 +64,12 @@ export default defineComponent({ await context.login({ token, oms }) // initialising and connecting firebase app for notification support - await initialiseFirebaseApp( - noitificationContext.appFirebaseConfig, - noitificationContext.appFirebaseVapidKey, - noitificationContext.storeClientRegistrationToken, - noitificationContext.addNotification, - ) + // await initialiseFirebaseApp( + // noitificationContext.appFirebaseConfig, + // noitificationContext.appFirebaseVapidKey, + // noitificationContext.storeClientRegistrationToken, + // noitificationContext.addNotification, + // ) this.router.push('/') } catch (error) { diff --git a/src/components/OmsInstanceNavigator.vue b/src/components/OmsInstanceNavigator.vue index b5a852d..80bd152 100644 --- a/src/components/OmsInstanceNavigator.vue +++ b/src/components/OmsInstanceNavigator.vue @@ -1,19 +1,18 @@