Skip to content

Commit

Permalink
Implemented: logic for getting productIdentificationPref and show pro…
Browse files Browse the repository at this point in the history
…duct details accordingly (dxp/178)
  • Loading branch information
amansinghbais committed Oct 11, 2023
1 parent be5716c commit 3e21229
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 27 deletions.
195 changes: 188 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@capacitor/core": "^2.4.7",
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/dxp-components": "^1.7.5",
"@hotwax/dxp-components": "^1.8.0",
"@hotwax/oms-api": "^1.10.0",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
Expand Down
8 changes: 7 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { mapGetters, useStore } from 'vuex';
import { initialise, resetConfig } from '@/adapter'
import { useRouter } from 'vue-router';
import { Settings } from 'luxon'
import { useProductIdentificationStore } from '@hotwax/dxp-components';
export default defineComponent({
name: 'App',
Expand All @@ -37,7 +38,8 @@ export default defineComponent({
userToken: 'user/getUserToken',
instanceUrl: 'user/getInstanceUrl',
userProfile: 'user/getUserProfile',
locale: 'user/getLocale'
locale: 'user/getLocale',
currentEComStore: 'user/getCurrentEComStore'
})
},
methods: {
Expand Down Expand Up @@ -124,6 +126,10 @@ export default defineComponent({
Settings.defaultZone = this.userProfile.userTimeZone;
}
this.$i18n.locale = this.locale;
// Get product identification from api using dxp-component
await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId)
.catch((error) => console.error(error));

Check warning on line 132 in src/App.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (16.x)

Unexpected console statement
},
unmounted() {
emitter.off('presentLoader', this.presentLoader);
Expand Down
10 changes: 9 additions & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Settings } from 'luxon'
import { logout, updateInstanceUrl, updateToken, resetConfig, getUserFacilities } from '@/adapter'
import logger from '@/logger'
import { getServerPermissionsFromRules, prepareAppPermissions, resetPermissions, setPermissions } from '@/authorization'
import { useAuthStore } from '@hotwax/dxp-components'
import { useAuthStore, useProductIdentificationStore } from '@hotwax/dxp-components'
import emitter from '@/event-bus'

const actions: ActionTree<UserState, RootState> = {
Expand Down Expand Up @@ -85,6 +85,10 @@ const actions: ActionTree<UserState, RootState> = {
store && (preferredStore = store)
}

// Get product identification from api using dxp-component
await useProductIdentificationStore().getIdentificationPref(preferredStoreId)
.catch((error) => console.error(error));

/* ---- Guard clauses ends here --- */

setPermissions(appPermissions);
Expand Down Expand Up @@ -215,6 +219,10 @@ const actions: ActionTree<UserState, RootState> = {
'userPrefTypeId': 'SELECTED_BRAND',
'userPrefValue': payload.eComStore.productStoreId
});

// Get product identification from api using dxp-component
await useProductIdentificationStore().getIdentificationPref(payload.eComStore.productStoreId)
.catch((error) => console.error(error));
},

setUserPreference({ commit }, payload){
Expand Down
Loading

0 comments on commit 3e21229

Please sign in to comment.