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: App Version Info for centralized use (#142) #148

Merged
merged 11 commits into from
Oct 3, 2023
Merged
19 changes: 19 additions & 0 deletions src/components/AppVersionInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<div class="section-header">
<div>
<h1>{{ $t('App') }}</h1>
<p class="overline">{{ "Version: " + appVersion }}</p>
</div>
<p class="overline">{{ "Built: " + getDateTime(appInfo.builtTime) }}</p>
</div>
</template>

<script setup lang="ts">
import { DateTime } from 'luxon';

declare var process: any;

const appInfo = (process.env.VUE_APP_VERSION_INFO ? JSON.parse(process.env.VUE_APP_VERSION_INFO) : {}) as any;
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
const appVersion = appInfo.branch ? (appInfo.branch + "-" + appInfo.revision) : appInfo.tag;
const getDateTime = (time: any) => DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED);
</script>
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +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 AppVersionInfo } from './AppVersionInfo.vue';
export { default as ProductIdentifier } from "./ProductIdentifier.vue";
export { default as LanguageSwitcher } from './LanguageSwitcher.vue';
export { default as OmsInstanceNavigator } from './OmsInstanceNavigator.vue'
Expand Down
3 changes: 2 additions & 1 deletion 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, OmsInstanceNavigator, ProductIdentifier, ShopifyImg } from "./components";
import { AppVersionInfo, LanguageSwitcher, OmsInstanceNavigator, ProductIdentifier, ShopifyImg } from "./components";
import Login from "./components/Login";
import { goToOms } from "./utils";
import { initialiseFirebaseApp } from "./utils/firebase"
Expand Down Expand Up @@ -41,6 +41,7 @@ export let dxpComponents = {
app.use(pinia);
app.use(i18n);

app.component('AppVersionInfo', AppVersionInfo)
app.component('LanguageSwitcher', LanguageSwitcher)
app.component('Login', Login)
app.component('OmsInstanceNavigator', OmsInstanceNavigator)
Expand Down
Loading