Skip to content

Commit

Permalink
Implemented: app version component from dxp-components(#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritika-Patel08 committed Mar 11, 2024
1 parent 5d6c124 commit cd140a4
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to {timeZoneId}?",
"Authenticating": "Authenticating",
"Back to Launchpad": "Back to Launchpad",
"Built: ": "Built: {builtDateTime}",
"Camera permission denied.": "Camera permission denied.",
"Cancel": "Cancel",
"Change": "Change",
Expand Down Expand Up @@ -80,6 +81,7 @@
"Variance": "Variance",
"Variance reason": "Variance reason",
"Variance updated successfully": "Variance updated successfully",
"Version: ": "Version: {appVersion}",
"View": "View",
"You do not have permission to access the app.": "You do not have permission to access the app.",
"You do not have permission to access this page": "You do not have permission to access this page"
Expand Down
5 changes: 5 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import en from "./en.json"

export default {
"en-US": en
};
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import permissionActions from '@/authorization/Actions';
import { dxpComponents } from '@hotwax/dxp-components'
import { login, logout, loader } from './user-utils';
import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref } from '@/adapter';
import localeMessages from './locales';

const app = createApp(App)
.use(IonicVue, {
Expand All @@ -55,6 +56,7 @@ const app = createApp(App)
getConfig,
getProductIdentificationPref,
initialise,
localeMessages,
setProductIdentificationPref
});

Expand Down
1 change: 1 addition & 0 deletions src/store/modules/user/UserState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default interface UserState {
current: any;
currentFacility: object | null;
permissions: any;
pwaState: any;
instanceUrl: string;
config: any;
currentEComStore: any;
Expand Down
3 changes: 3 additions & 0 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,8 @@ const actions: ActionTree<UserState, RootState> = {
updateViewQOHConfig({ commit }, config) {
commit(types.USER_VIEW_QOH_CNFG_UPDATED, config)
},

updatePwaState({ commit }, payload) {
commit(types.USER_PWA_STATE_UPDATED, payload);
}
export default actions;
3 changes: 3 additions & 0 deletions src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const getters: GetterTree <UserState, RootState> = {
},
getViewQOHConfig (state) {
return state.config;
},
getPwaState(state) {
return state.pwaState;
}
}
export default getters;
6 changes: 5 additions & 1 deletion src/store/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const userModule: Module<UserState, RootState> = {
currentQOHViewConfig: {},
viewQOH: false
},
currentEComStore: {}
currentEComStore: {},
pwaState: {
updateExists: false,
registration: null,
}
},
getters,
actions,
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/user/mutation-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export const USER_CURRENT_FACILITY_UPDATED = SN_USER + '/CURRENT_FACILITY_UPDATE
export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED'
export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED'
export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED'
export const USER_VIEW_QOH_CNFG_UPDATED = SN_USER + '/VIEW_QOH_CNFG_UPDATED'
export const USER_VIEW_QOH_CNFG_UPDATED = SN_USER + '/VIEW_QOH_CNFG_UPDATED'
export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED'
6 changes: 5 additions & 1 deletion src/store/modules/user/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const mutations: MutationTree <UserState> = {
[types.USER_VIEW_QOH_CNFG_UPDATED] (state, payload) {
state.config.viewQOH = payload.viewQOH;
state.config.currentQOHViewConfig = payload.currentQOHViewConfig;
}
},
[types.USER_PWA_STATE_UPDATED](state, payload) {
state.pwaState.registration = payload.registration;
state.pwaState.updateExists = payload.updateExists;
},
}
export default mutations;
10 changes: 3 additions & 7 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@
</ion-card>
</section>
<hr />
<div class="section-header">
<h1>
{{ $t('App') }}
<p class="overline" >{{ "Version: " + appVersion }}</p>
</h1>
<p class="overline">{{ "Built: " + getDateTime(appInfo.builtTime) }}</p>
</div>
<DxpAppVersionInfo />
<section>
<DxpProductIdentifier />
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
Expand Down

0 comments on commit cd140a4

Please sign in to comment.