diff --git a/src/locales/en.json b/src/locales/en.json index 1804d4ec..a0250ee1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -38,6 +38,7 @@ "Blank": "Blank", "Brokering": "Brokering", "Brokering queue": "Brokering queue", + "Built: ": "Built: {builtDateTime}", "Browser TimeZone": "Browser TimeZone", "Browser time zone": "Browser time zone", "Bulk editor": "Bulk editor", @@ -304,6 +305,7 @@ "Upload Pending Process": "Upload Pending Process", "Use POs to manage catalog": "Use POs to manage catalog", "Username": "Username", + "Version: ": "Version: {appVersion}", "View catalog": "View catalog", "Webhook subscribed successfully": "Webhook subscribed successfully", "Webhook unsubscribed successfully": "Webhook unsubscribed successfully", diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index 3bea0726..84f86c9c 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -7,4 +7,5 @@ export default interface UserState { shopifyConfigs: any; currentShopifyConfig: any; productStoreCategories: any; + pwaState: any; } \ No newline at end of file diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 6064a635..60051585 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -180,6 +180,9 @@ const actions: ActionTree = { updateInstanceUrl(payload) }, + updatePwaState({commit}, payload) { + commit(types.USER_PWA_STATE_UPDATED, payload); + }, async getShopifyConfig({ commit }, productStoreId) { if (!productStoreId) { diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index cb780da9..b0f6419f 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -36,6 +36,9 @@ const getters: GetterTree = { getProductStoreCategories(state) { return state.productStoreCategories; }, + getPwaState (state) { + return state.pwaState; + }, getCurrentEComStore(state) { return state.currentEComStore }, diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 9d8aa42c..90bc9c82 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -18,7 +18,11 @@ const userModule: Module = { productStoreId: "", storeName: "None" }, - productStoreCategories: {} + productStoreCategories: {}, + pwaState: { + updateExists: false, + registration: null, + }, }, getters, actions, diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index 66efa7c3..f36325e3 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -7,4 +7,5 @@ export const USER_SHOPIFY_CONFIGS_UPDATED = SN_USER + '/SHOPIFY_CONFIGS_UPDATED' export const USER_CURRENT_SHOPIFY_CONFIG_UPDATED = SN_USER + '/SHOPIFY_CONFIG_UPDATED' export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' +export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED' export const USER_PRDCT_STR_CATGRS_UPDATED = SN_USER + '/PRDCT_STR_CATGRS_UPDATED' \ No newline at end of file diff --git a/src/store/modules/user/mutations.ts b/src/store/modules/user/mutations.ts index 7c984578..b3003c9e 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -33,6 +33,10 @@ const mutations: MutationTree = { [types.USER_PRDCT_STR_CATGRS_UPDATED] (state, payload) { state.productStoreCategories = payload }, + [types.USER_PWA_STATE_UPDATED] (state, payload) { + state.pwaState.registration = payload.registration; + state.pwaState.updateExists = payload.updateExists; + }, [types.USER_CURRENT_ECOM_STORE_UPDATED] (state, payload) { state.currentEComStore = payload; }, diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 36241e9a..46cac240 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -76,14 +76,7 @@
- -
-

- {{ translate('App') }} -

{{ "Version: " + appVersion }}

-

-

{{ "Built: " + getDateTime(appInfo.builtTime) }}

-
+
@@ -99,7 +92,6 @@ import { codeWorkingOutline, ellipsisVertical, personCircleOutline, openOutline, import { mapGetters, useStore } from 'vuex'; import { useRouter } from 'vue-router'; import Image from '@/components/Image.vue' -import { DateTime } from 'luxon'; import { translate } from '@hotwax/dxp-components'; export default defineComponent({ @@ -126,9 +118,7 @@ export default defineComponent({ }, data() { return { - baseURL: process.env.VUE_APP_BASE_URL, - appInfo: (process.env.VUE_APP_VERSION_INFO ? JSON.parse(process.env.VUE_APP_VERSION_INFO) : {}) as any, - appVersion: "" + baseURL: process.env.VUE_APP_BASE_URL }; }, computed: { @@ -139,9 +129,6 @@ export default defineComponent({ currentShopifyConfig: 'user/getCurrentShopifyConfig', }) }, - mounted() { - this.appVersion = this.appInfo.branch ? (this.appInfo.branch + "-" + this.appInfo.revision) : this.appInfo.tag; - }, methods: { setEComStore(event: any) { // If the value is same, no need to update @@ -168,9 +155,6 @@ export default defineComponent({ } }) }, - getDateTime(time: any) { - return DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED); - }, goToLaunchpad() { window.location.href = `${process.env.VUE_APP_LOGIN_URL}` }