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

Fixed: notification issues in bopis (#274) #375

Merged
merged 4 commits into from
Feb 5, 2024
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
8 changes: 4 additions & 4 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 @@ -18,7 +18,7 @@
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.1.0",
"@hotwax/dxp-components": "^1.11.0",
"@hotwax/oms-api": "^1.11.0",
"@hotwax/oms-api": "^1.11.1",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
"@ionic/vue-router": "6.7.5",
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ const actions: ActionTree<UserState, RootState> = {
try {
resp = await getNotificationEnumIds(process.env.VUE_APP_NOTIF_ENUM_TYPE_ID)
enumerationResp = resp.docs
resp = await getNotificationUserPrefTypeIds(process.env.VUE_APP_NOTIF_APP_ID)
resp = await getNotificationUserPrefTypeIds(process.env.VUE_APP_NOTIF_APP_ID, state.current.userLoginId)
userPrefIds = resp.docs.map((userPref: any) => userPref.userPrefTypeId)
} catch (error) {
logger.error(error)
Expand Down
10 changes: 7 additions & 3 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,18 @@ export default defineComponent({
await this.store.dispatch('user/fetchNotificationPreferences')
},
methods: {
setFacility (event: any) {
async setFacility (event: any) {
// If the value is same, no need to update
// Handled case for programmatical changes
// https://github.com/ionic-team/ionic-framework/discussions/25532
// https://github.com/ionic-team/ionic-framework/issues/20106
// https://github.com/ionic-team/ionic-framework/pull/25858
if (this.userProfile && this.currentFacility?.facilityId !== event.detail.value)
this.store.dispatch('user/setFacility', {
if (this.userProfile && this.currentFacility?.facilityId !== event.detail.value) {
await this.store.dispatch('user/setFacility', {
'facilityId': event.detail.value
});
await this.store.dispatch('user/fetchNotificationPreferences')
}
},
async changeTimeZone() {
const timeZoneModal = await modalController.create({
Expand Down Expand Up @@ -459,6 +461,7 @@ export default defineComponent({
},
async updateNotificationPref(enumId: string, event: any) {
try {
emitter.emit('presentLoader', { backdropDismiss: false })
const facilityId = (this.currentFacility as any).facilityId
const topicName = generateTopicName(facilityId, enumId)
// event.target.checked returns the initial value (the value that was there before clicking
Expand Down Expand Up @@ -496,6 +499,7 @@ export default defineComponent({
text: translate("Confirm"),
handler: async () => {
// passing event reference for updation in case the API fails
alertController.dismiss()
await this.updateNotificationPref(enumId, event)
}
}
Expand Down
Loading