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 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
40 changes: 40 additions & 0 deletions src/components/OmsInstanceNavigator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<ion-card>
<ion-card-header>
<ion-card-subtitle>
{{ $t('OMS instance') }}
</ion-card-subtitle>
<ion-card-title>
{{ authStore.getOms }}
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{ $t('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(token.value, oms)" fill="clear">
{{ $t('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 { computed } from 'vue';
import { useAuthStore } from "../store/auth";

const authStore = useAuthStore();

const token = computed(() => authStore.getToken)
const oms = computed(() => authStore.getOms)
</script>
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ import '@ionic/vue/css/display.css';

export { default as ProductIdentifier } from "./ProductIdentifier.vue";
export { default as LanguageSwitcher } from './LanguageSwitcher.vue';
export { default as OmsInstanceNavigator } from './OmsInstanceNavigator.vue'
export { default as ShopifyImg } from './ShopifyImg.vue';
18 changes: 10 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare var process: any;
import { createPinia } from "pinia";
import { useProductIdentificationStore } from "./store/productIdentification";
import { useAuthStore } from "./store/auth";
import { LanguageSwitcher, ProductIdentifier, ShopifyImg } from "./components";
import { LanguageSwitcher, OmsInstanceNavigator, ProductIdentifier, ShopifyImg } from "./components";
import Login from "./components/Login";
import { goToOms } from "./utils";
import { initialiseFirebaseApp } from "./utils/firebase"
Expand Down Expand Up @@ -43,8 +43,9 @@ export let dxpComponents = {

app.component('LanguageSwitcher', LanguageSwitcher)
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 @@ -70,19 +71,20 @@ export let dxpComponents = {
}

export {
Login,
ShopifyImg,
appContext,
goToOms,
i18n,
initialiseFirebaseApp,
Login,
loginContext,
noitificationContext,
OmsInstanceNavigator,
ProductIdentifier,
productIdentificationContext,
ShopifyImg,
shopifyImgContext,
translate,
useAuthStore,
useProductIdentificationStore,
useUserStore,
initialiseFirebaseApp,
noitificationContext,
ProductIdentifier
useUserStore
}
Loading