diff --git a/package-lock.json b/package-lock.json index 20263bfc..c3b46686 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "fulfillment", - "version": "2.10.0", + "version": "2.11.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fulfillment", - "version": "2.10.0", + "version": "2.11.1", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.5", + "@hotwax/dxp-components": "^1.16.0", "@hotwax/oms-api": "^1.16.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", @@ -2798,9 +2798,9 @@ "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.5.tgz", - "integrity": "sha512-aOzipZwVk/fL6K7/BShsvE3eYqH8LagEQQpaNCPFtSs18KHgolGQxcKT3dQ1KRLTCmoKJugc7ut9uyxZVL5krg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.16.0.tgz", + "integrity": "sha512-9HUrR58Sk9H3wryYGWfGfctcM9hRqq9pnLbaShnNf0mZeK/vTAIqqTPHcObfeKXkSaPtrqS6E/1Y/+Ysmv6v5A==", "dependencies": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^7.6.0", diff --git a/package.json b/package.json index 9cf02a44..75b9aba1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fulfillment", - "version": "2.10.0", + "version": "2.11.1", "private": true, "description": "An Ionic project", "scripts": { @@ -16,7 +16,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.5", + "@hotwax/dxp-components": "^1.16.0", "@hotwax/oms-api": "^1.16.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 6cd94c76..657e0939 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,6 +1,6 @@ -import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, fetchGoodIdentificationTypes, getUserFacilities, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken, - subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones } from '@hotwax/oms-api' +import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, fetchGoodIdentificationTypes, getUserFacilities, getUserPreference, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken, + subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, setUserPreference, getAvailableTimeZones } from '@hotwax/oms-api' export { api, @@ -11,6 +11,7 @@ export { getProductIdentificationPref, fetchGoodIdentificationTypes, getUserFacilities, + getUserPreference, hasError, initialise, logout, @@ -24,5 +25,6 @@ export { updateInstanceUrl, updateToken, setUserTimeZone, + setUserPreference, getAvailableTimeZones } \ No newline at end of file diff --git a/src/components/DownloadRejectedOrdersModal.vue b/src/components/DownloadRejectedOrdersModal.vue index 3ea8f213..10cb2e9c 100644 --- a/src/components/DownloadRejectedOrdersModal.vue +++ b/src/components/DownloadRejectedOrdersModal.vue @@ -72,7 +72,7 @@ } from '@ionic/vue'; import { computed, defineComponent } from 'vue'; import { closeOutline, cloudDownloadOutline} from 'ionicons/icons'; - import { getProductIdentificationValue, translate, useProductIdentificationStore } from '@hotwax/dxp-components'; + import { getProductIdentificationValue, translate, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import { mapGetters, useStore } from 'vuex'; import { escapeSolrSpecialChars, prepareSolrQuery } from '@/utils/solrHelper' import { RejectionService } from '@/services/RejectionService' @@ -136,8 +136,7 @@ computed: { ...mapGetters({ getProduct: 'product/getProduct', - rejectedOrders: 'rejection/getRejectedOrders', - currentFacility: 'user/getCurrentFacility', + rejectedOrders: 'rejection/getRejectedOrders' }) }, methods: { @@ -297,8 +296,10 @@ }, setup() { const store = useStore() + const userStore = useUserStore() const productIdentificationStore = useProductIdentificationStore(); let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) + let currentFacility: any = computed(() => userStore.getCurrentFacility) return { @@ -308,6 +309,7 @@ productIdentificationPref, store, translate, + currentFacility } } }); diff --git a/src/components/Menu.vue b/src/components/Menu.vue index e6475670..5138ea9d 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -50,7 +50,7 @@ import { arrowBackOutline, backspaceOutline, mailUnreadOutline, mailOpenOutline, import { useStore } from "@/store"; import { useRouter } from "vue-router"; import { hasPermission } from "@/authorization"; -import { translate } from '@hotwax/dxp-components'; +import { translate, useUserStore } from '@hotwax/dxp-components'; export default defineComponent({ name: "Menu", @@ -70,7 +70,6 @@ export default defineComponent({ computed: { ...mapGetters({ isUserAuthenticated: 'user/isUserAuthenticated', - currentFacility: 'user/getCurrentFacility', }) }, methods: { @@ -81,6 +80,8 @@ export default defineComponent({ setup() { const store = useStore(); const router = useRouter(); + const userStore = useUserStore() + let currentFacility: any = computed(() => userStore.getCurrentFacility) const appPages = [ { @@ -189,6 +190,7 @@ export default defineComponent({ appPages, backspaceOutline, checkmarkDoneOutline, + currentFacility, hasPermission, arrowBackOutline, mailUnreadOutline, diff --git a/src/components/NotificationPreferenceModal.vue b/src/components/NotificationPreferenceModal.vue index d7806673..28f85dd0 100644 --- a/src/components/NotificationPreferenceModal.vue +++ b/src/components/NotificationPreferenceModal.vue @@ -44,10 +44,10 @@ import { modalController, alertController, } from "@ionic/vue"; -import { defineComponent } from "vue"; +import { defineComponent, computed } from "vue"; import { closeOutline, save } from "ionicons/icons"; import { mapGetters, useStore } from "vuex"; -import { translate } from '@hotwax/dxp-components' +import { translate, useUserStore } from '@hotwax/dxp-components' import { showToast } from "@/utils"; import emitter from "@/event-bus" import { generateTopicName } from "@/utils/firebase"; @@ -82,7 +82,6 @@ export default defineComponent({ }, computed: { ...mapGetters({ - currentFacility: 'user/getCurrentFacility', instanceUrl: 'user/getInstanceUrl', notificationPrefs: 'user/getNotificationPrefs' }), @@ -138,7 +137,7 @@ export default defineComponent({ } }, async handleTopicSubscription() { - const facilityId = (this.currentFacility as any).facilityId + const facilityId = this.currentFacility?.facilityId const subscribeRequests = [] as any this.notificationPrefToUpdate.subscribe.map(async (enumId: string) => { const topicName = generateTopicName(facilityId, enumId) @@ -182,9 +181,12 @@ export default defineComponent({ }, setup() { const store = useStore(); + const userStore = useUserStore() + let currentFacility: any = computed(() => userStore.getCurrentFacility) return { closeOutline, + currentFacility, translate, save, store diff --git a/src/components/ReportIssuePopover.vue b/src/components/ReportIssuePopover.vue index 28966d1b..443b848c 100644 --- a/src/components/ReportIssuePopover.vue +++ b/src/components/ReportIssuePopover.vue @@ -1,8 +1,8 @@