Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: centralized OMS instance navigation component in dxp-components (#140) #158

Merged
merged 11 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
37 changes: 37 additions & 0 deletions src/components/OmsInstanceNavigator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<!-- Todo: need to add translation to all the text once implemented in dxp-component -->
<ion-card>
<ion-card-header>
<ion-card-subtitle>
{{ "OMS instance" }}
</ion-card-subtitle>
<ion-card-title>
{{ authStore.getOms }}
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{ '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.' }}
</ion-card-content>
<ion-button @click="goToOms(authStore.getToken.value, authStore.getOms)" fill="clear">
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
{{ 'Go to OMS' }}
<ion-icon slot="end" :icon="openOutline" />
</ion-button>
</ion-card>
</template>

<script setup lang="ts">
import {
IonButton,
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle,
IonIcon
} from '@ionic/vue';
import { goToOms } from '../utils';
import { openOutline } from 'ionicons/icons'
import { useAuthStore } from "../store/auth";

const authStore = useAuthStore()
</script>
4 changes: 3 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ import '@ionic/vue/css/text-transformation.css';
import '@ionic/vue/css/flex-utils.css';
import '@ionic/vue/css/display.css';

export { default as ProductIdentifier } from "./ProductIdentifier.vue";
import OmsInstanceNavigator from './OmsInstanceNavigator.vue';
import ProductIdentifier from './ProductIdentifier.vue';

export { OmsInstanceNavigator, ProductIdentifier };
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { goToOms } from "./utils";
import { initialiseFirebaseApp } from "./utils/firebase"

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { 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
Expand All @@ -30,8 +30,9 @@ export let dxpComponents = {
app.use(pinia);

app.component('Login', Login)
app.component('ShopifyImg', ShopifyImg)
app.component('OmsInstanceNavigator', OmsInstanceNavigator)
app.component('ProductIdentifier', ProductIdentifier)
app.component('ShopifyImg', ShopifyImg)

loginContext.login = options.login
loginContext.logout = options.logout
Expand All @@ -58,11 +59,12 @@ export {
initialiseFirebaseApp,
Login,
loginContext,
productIdentificationContext,
noitificationContext,
OmsInstanceNavigator,
ProductIdentifier,
productIdentificationContext,
ShopifyImg,
shopifyImgContext,
useProductIdentificationStore,
useAuthStore,
ProductIdentifier
}
Loading