From d25e2b341e9b67bf70092af0c5a8bd108d5a8795 Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Mon, 2 Sep 2024 18:16:18 +0530 Subject: [PATCH 1/9] Improved: Added the support fro using productStore selector from dxp-component --- package-lock.json | 454 ++++-------------- package.json | 4 +- src/App.vue | 10 +- src/adapter/index.ts | 7 +- src/components/ShippingLabelActionPopover.vue | 1 - src/components/TransferOrderFilters.vue | 12 +- src/main.ts | 7 +- src/services/UtilService.ts | 10 - src/store/modules/carrier/actions.ts | 7 +- src/store/modules/order/actions.ts | 18 +- src/store/modules/transferorder/actions.ts | 5 +- src/store/modules/user/UserState.ts | 1 - src/store/modules/user/actions.ts | 65 +-- src/store/modules/user/getters.ts | 3 - src/store/modules/user/index.ts | 1 - src/store/modules/user/mutation-types.ts | 1 - src/store/modules/user/mutations.ts | 4 - src/store/modules/util/UtilState.ts | 1 - src/store/modules/util/actions.ts | 38 +- src/store/modules/util/getters.ts | 3 - src/store/modules/util/index.ts | 1 - src/store/modules/util/mutation-types.ts | 1 - src/store/modules/util/mutations.ts | 3 - src/views/CarrierDetail.vue | 11 +- src/views/Completed.vue | 10 +- src/views/InProgress.vue | 10 +- src/views/OpenOrders.vue | 10 +- src/views/OrderDetail.vue | 12 +- src/views/OrderLookupDetail.vue | 10 +- src/views/Settings.vue | 37 +- src/views/TransferOrders.vue | 1 - 31 files changed, 209 insertions(+), 549 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7adee1e0..c7eba316 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,8 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.2", - "@hotwax/oms-api": "^1.14.0", + "@hotwax/dxp-components": "file:../dxp-components", + "@hotwax/oms-api": "file:../oms-api", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", "@ionic/vue-router": "^7.6.0", @@ -59,6 +59,65 @@ "typescript": "~4.7.4" } }, + "../dxp-components": { + "name": "@hotwax/dxp-components", + "version": "1.15.2", + "license": "Apache-2.0", + "dependencies": { + "@hotwax/oms-api": "^1.8.1", + "@ionic/core": "^7.6.0", + "@ionic/vue": "^7.6.0", + "firebase": "^10.3.1", + "luxon": "^3.3.0", + "pinia": "2.0.36", + "pinia-plugin-persistedstate": "^3.1.0", + "register-service-worker": "^1.7.2", + "vue": "^3.3.4", + "vue-i18n": "^9.2.2", + "vue-markdown-render": "^2.2.1" + }, + "devDependencies": { + "@babel/types": "^7.22.11", + "@types/luxon": "^3.3.0", + "@types/node": "^20.5.7", + "@vitejs/plugin-vue": "^4.3.4", + "@vue/eslint-config-prettier": "^8.0.0", + "@vue/eslint-config-typescript": "^11.0.3", + "@vue/tsconfig": "^0.1.3", + "eslint": "^8.48.0", + "eslint-plugin-vue": "^9.17.0", + "rollup-plugin-typescript2": "^0.35.0", + "typescript": "~4.7.4", + "vite": "^4.4.9", + "vue-tsc": "^1.8.8" + } + }, + "../oms-api": { + "name": "@hotwax/oms-api", + "version": "1.15.0", + "license": "Apache-2.0", + "dependencies": { + "@types/node-json-transform": "^1.0.0", + "axios": "^0.21.1", + "axios-cache-adapter": "^2.7.3", + "deepmerge": "^4.3.0", + "http-status-codes": "^2.2.0", + "node-json-transform": "^1.1.2", + "qs": "^6.11.0" + }, + "devDependencies": { + "@babel/cli": "^7.18.10", + "@babel/core": "^7.18.10", + "@babel/preset-env": "^7.18.10", + "@babel/preset-typescript": "^7.18.6", + "@types/qs": "^6.9.7", + "@typescript-eslint/eslint-plugin": "^5.27.0", + "@typescript-eslint/parser": "^5.27.0", + "babel-plugin-module-resolver": "^4.1.0", + "eslint": "^8.16.0", + "typescript": "^4.7.2" + } + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -2798,177 +2857,12 @@ "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.2.tgz", - "integrity": "sha512-0jF1xkRIVrDbJwUaaPwWUhp3cVBpdjgAJO/fOQ4XYjzKb8rYXgw0Xm/qHHUnSeAZW5laMnQrm1KtPZp8szu4dQ==", - "dependencies": { - "@hotwax/oms-api": "^1.8.1", - "@ionic/core": "^7.6.0", - "@ionic/vue": "^7.6.0", - "firebase": "^10.3.1", - "luxon": "^3.3.0", - "pinia": "2.0.36", - "pinia-plugin-persistedstate": "^3.1.0", - "register-service-worker": "^1.7.2", - "vue": "^3.3.4", - "vue-i18n": "^9.2.2", - "vue-markdown-render": "^2.2.1" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/@vue/reactivity": { - "version": "3.4.21", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", - "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", - "dependencies": { - "@vue/shared": "3.4.21" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/@vue/runtime-core": { - "version": "3.4.21", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", - "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", - "dependencies": { - "@vue/reactivity": "3.4.21", - "@vue/shared": "3.4.21" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/@vue/runtime-dom": { - "version": "3.4.21", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", - "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", - "dependencies": { - "@vue/runtime-core": "3.4.21", - "@vue/shared": "3.4.21", - "csstype": "^3.1.3" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/@vue/server-renderer": { - "version": "3.4.21", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", - "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", - "dependencies": { - "@vue/compiler-ssr": "3.4.21", - "@vue/shared": "3.4.21" - }, - "peerDependencies": { - "vue": "3.4.21" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" - }, - "node_modules/@hotwax/dxp-components/node_modules/luxon": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", - "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/pinia": { - "version": "2.0.36", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.36.tgz", - "integrity": "sha512-4UKApwjlmJH+VuHKgA+zQMddcCb3ezYnyewQ9NVrsDqZ/j9dMv5+rh+1r48whKNdpFkZAWVxhBp5ewYaYX9JcQ==", - "dependencies": { - "@vue/devtools-api": "^6.5.0", - "vue-demi": "*" - }, - "funding": { - "url": "https://github.com/sponsors/posva" - }, - "peerDependencies": { - "@vue/composition-api": "^1.4.0", - "typescript": ">=4.4.4", - "vue": "^2.6.14 || ^3.2.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/@hotwax/dxp-components/node_modules/pinia-plugin-persistedstate": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz", - "integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==", - "peerDependencies": { - "pinia": "^2.0.0" - } - }, - "node_modules/@hotwax/dxp-components/node_modules/pinia/node_modules/vue-demi": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz", - "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==", - "hasInstallScript": true, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } - } - }, - "node_modules/@hotwax/dxp-components/node_modules/vue": { - "version": "3.4.21", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", - "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", - "dependencies": { - "@vue/compiler-dom": "3.4.21", - "@vue/compiler-sfc": "3.4.21", - "@vue/runtime-dom": "3.4.21", - "@vue/server-renderer": "3.4.21", - "@vue/shared": "3.4.21" - }, - "peerDependencies": { - "typescript": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@hotwax/dxp-components/node_modules/vue-markdown-render": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/vue-markdown-render/-/vue-markdown-render-2.2.1.tgz", - "integrity": "sha512-XkYnC0PMdbs6Vy6j/gZXSvCuOS0787Se5COwXlepRqiqPiunyCIeTPQAO2XnB4Yl04EOHXwLx5y6IuszMWSgyQ==", - "dependencies": { - "markdown-it": "^13.0.2" - }, - "peerDependencies": { - "vue": "^3.3.4" - } + "resolved": "../dxp-components", + "link": true }, "node_modules/@hotwax/oms-api": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.14.0.tgz", - "integrity": "sha512-dYkrFEi0oJHKiJ/VctKmyIY4WTVV2lmljm1EflgQ/LM7BTJ9jVEeT1zgYJ5vO906kW7SWM4pl7mZI3dDCt1YCQ==", - "dependencies": { - "@types/node-json-transform": "^1.0.0", - "axios": "^0.21.1", - "axios-cache-adapter": "^2.7.3", - "deepmerge": "^4.3.0", - "http-status-codes": "^2.2.0", - "node-json-transform": "^1.1.2", - "qs": "^6.11.0" - } + "resolved": "../oms-api", + "link": true }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", @@ -2990,47 +2884,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@intlify/core-base": { - "version": "9.10.2", - "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.10.2.tgz", - "integrity": "sha512-HGStVnKobsJL0DoYIyRCGXBH63DMQqEZxDUGrkNI05FuTcruYUtOAxyL3zoAZu/uDGO6mcUvm3VXBaHG2GdZCg==", - "dependencies": { - "@intlify/message-compiler": "9.10.2", - "@intlify/shared": "9.10.2" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, - "node_modules/@intlify/message-compiler": { - "version": "9.10.2", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.10.2.tgz", - "integrity": "sha512-ntY/kfBwQRtX5Zh6wL8cSATujPzWW2ZQd1QwKyWwAy5fMqJyyixHMeovN4fmEyCqSu+hFfYOE63nU94evsy4YA==", - "dependencies": { - "@intlify/shared": "9.10.2", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, - "node_modules/@intlify/shared": { - "version": "9.10.2", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.10.2.tgz", - "integrity": "sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, "node_modules/@ionic/core": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-7.8.0.tgz", @@ -3204,7 +3057,8 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -3752,11 +3606,6 @@ "@types/node": "*" } }, - "node_modules/@types/node-json-transform": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/node-json-transform/-/node-json-transform-1.0.2.tgz", - "integrity": "sha512-gOq49i42EmHRKPTTD4cXru3MAFoDADqzUxzAweKtZZBmLJuAK0GsJHNX4HKdvZ/JJHf+F4TYgnvb7Ge0NlQiGw==" - }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", @@ -4886,6 +4735,7 @@ "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", + "dev": true, "dependencies": { "@babel/parser": "^7.23.9", "@vue/shared": "3.4.21", @@ -4898,6 +4748,7 @@ "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", + "dev": true, "dependencies": { "@vue/compiler-core": "3.4.21", "@vue/shared": "3.4.21" @@ -4907,6 +4758,7 @@ "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", + "dev": true, "dependencies": { "@babel/parser": "^7.23.9", "@vue/compiler-core": "3.4.21", @@ -4923,6 +4775,7 @@ "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", + "dev": true, "dependencies": { "@vue/compiler-dom": "3.4.21", "@vue/shared": "3.4.21" @@ -5142,7 +4995,8 @@ "node_modules/@vue/shared": { "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", - "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==" + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", + "dev": true }, "node_modules/@vue/test-utils": { "version": "2.4.5", @@ -5795,26 +5649,6 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", "dev": true }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/axios-cache-adapter": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/axios-cache-adapter/-/axios-cache-adapter-2.7.3.tgz", - "integrity": "sha512-A+ZKJ9lhpjthOEp4Z3QR/a9xC4du1ALaAsejgRGrH9ef6kSDxdFrhRpulqsh9khsEnwXxGfgpUuDp1YXMNMEiQ==", - "dependencies": { - "cache-control-esm": "1.0.0", - "md5": "^2.2.1" - }, - "peerDependencies": { - "axios": "~0.21.1" - } - }, "node_modules/babel-loader": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz", @@ -6217,11 +6051,6 @@ "node": ">= 0.8" } }, - "node_modules/cache-control-esm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cache-control-esm/-/cache-control-esm-1.0.0.tgz", - "integrity": "sha512-Fa3UV4+eIk4EOih8FTV6EEsVKO0W5XWtNs6FC3InTfVz+EjurjPfDXY5wZDo/lxjDxg5RjNcurLyxEJBcEUx9g==" - }, "node_modules/cachedir": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", @@ -6235,6 +6064,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -6353,14 +6183,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "engines": { - "node": "*" - } - }, "node_modules/check-more-types": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", @@ -6982,14 +6804,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "engines": { - "node": "*" - } - }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -7722,6 +7536,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -8155,6 +7970,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, "engines": { "node": ">=0.12" }, @@ -8239,6 +8055,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -8250,6 +8067,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, "engines": { "node": ">= 0.4" } @@ -9489,6 +9307,7 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "dev": true, "funding": [ { "type": "individual", @@ -9832,6 +9651,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -9890,6 +9710,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -10058,6 +9879,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -10114,6 +9936,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0" }, @@ -10125,6 +9948,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -10136,6 +9960,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -10168,6 +9993,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -10459,11 +10285,6 @@ "node": ">=0.10" } }, - "node_modules/http-status-codes": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", - "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==" - }, "node_modules/human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -10829,11 +10650,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -11680,14 +11496,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/linkify-it": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", - "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", - "dependencies": { - "uc.micro": "^1.0.1" - } - }, "node_modules/listr2": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", @@ -11780,7 +11588,8 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/lodash.camelcase": { "version": "4.3.0", @@ -12083,6 +11892,7 @@ "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -12114,58 +11924,12 @@ "semver": "bin/semver.js" } }, - "node_modules/markdown-it": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.2.tgz", - "integrity": "sha512-FtwnEuuK+2yVU7goGn/MJ0WBZMM9ZPgU9spqlFs7/A/pDIUNSOQZhUgOqYCficIuR2QaFnrt8LHqBWsbTAoI5w==", - "dependencies": { - "argparse": "^2.0.1", - "entities": "~3.0.1", - "linkify-it": "^4.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/markdown-it/node_modules/entities": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", - "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", "dev": true }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -12565,14 +12329,6 @@ "node": ">= 6.13.0" } }, - "node_modules/node-json-transform": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/node-json-transform/-/node-json-transform-1.1.2.tgz", - "integrity": "sha512-Y3twjldHF1htCiCu6elGwQDdNp5PD54U66waWa2XNKh+g2lXSnWo3nq9SZnZOV3odFAqkM/roiNZx078RE2new==", - "dependencies": { - "lodash": "^4.17.15" - } - }, "node_modules/node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", @@ -12682,6 +12438,7 @@ "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14145,6 +13902,7 @@ "version": "6.12.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "dev": true, "dependencies": { "side-channel": "^1.0.6" }, @@ -14917,6 +14675,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -15002,6 +14761,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -16225,7 +15985,7 @@ "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "devOptional": true, + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -16234,11 +15994,6 @@ "node": ">=4.2.0" } }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -16624,25 +16379,6 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "dev": true }, - "node_modules/vue-i18n": { - "version": "9.10.2", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.10.2.tgz", - "integrity": "sha512-ECJ8RIFd+3c1d3m1pctQ6ywG5Yj8Efy1oYoAKQ9neRdkLbuKLVeW4gaY5HPkD/9ssf1pOnUrmIFjx2/gkGxmEw==", - "dependencies": { - "@intlify/core-base": "9.10.2", - "@intlify/shared": "9.10.2", - "@vue/devtools-api": "^6.5.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - }, - "peerDependencies": { - "vue": "^3.0.0" - } - }, "node_modules/vue-loader": { "version": "17.4.2", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.4.2.tgz", @@ -18055,4 +17791,4 @@ "dev": true } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index ef7f85e5..c1b0a28b 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.2", - "@hotwax/oms-api": "^1.14.0", + "@hotwax/dxp-components": "file:../dxp-components", + "@hotwax/oms-api": "file:../oms-api", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", "@ionic/vue-router": "^7.6.0", diff --git a/src/App.vue b/src/App.vue index 851db663..bfc10de1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,7 @@ import { mapGetters, useStore } from 'vuex'; import { initialise, resetConfig } from '@/adapter' import { useRouter } from 'vue-router'; import { Settings } from 'luxon' -import { translate, useProductIdentificationStore } from '@hotwax/dxp-components'; +import { translate, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import logger from '@/logger' export default defineComponent({ @@ -40,7 +40,7 @@ export default defineComponent({ instanceUrl: 'user/getInstanceUrl', userProfile: 'user/getUserProfile', locale: 'user/getLocale', - currentEComStore: 'user/getCurrentEComStore' + currentFacility: 'user/getCurrentFacility', }) }, methods: { @@ -127,11 +127,15 @@ export default defineComponent({ Settings.defaultZone = this.userProfile.userTimeZone; } + // need to discuss this case + // await useUserStore().getEComStores(''); + // await useUserStore().getPreferredStore('SELECTED_BRAND'); + const currentEComStore: any = useUserStore().getCurrentEComStore; // If fetching identifier without checking token then on login the app stucks in a loop, as the mounted hook runs before // token is available which results in api failure as unauthenticated, thus making logout call and then login call again and so on. if(this.userToken) { // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId) + await useProductIdentificationStore().getIdentificationPref(currentEComStore.productStoreId) .catch((error) => logger.error(error)); } }, diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 3bd56705..9cca78c3 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,6 +1,6 @@ import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, getUserFacilities, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken, - subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones } from '@hotwax/oms-api' + subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones, getUserPreference, setEComStore, getEComStores } from '@hotwax/oms-api' export { api, @@ -23,5 +23,8 @@ export { updateInstanceUrl, updateToken, setUserTimeZone, - getAvailableTimeZones + getAvailableTimeZones, + getUserPreference, + setEComStore, + getEComStores } \ No newline at end of file diff --git a/src/components/ShippingLabelActionPopover.vue b/src/components/ShippingLabelActionPopover.vue index ddd80311..610475e8 100644 --- a/src/components/ShippingLabelActionPopover.vue +++ b/src/components/ShippingLabelActionPopover.vue @@ -46,7 +46,6 @@ ...mapGetters({ facilityProductStores: 'facility/getFacilityProductStores', getProductStore: 'util/getProductStore', - productStores: 'util/getProductStores', shopifyShopIdForProductStore: 'util/getShopifyShopIdForProductStore', current: 'facility/getCurrent' }) diff --git a/src/components/TransferOrderFilters.vue b/src/components/TransferOrderFilters.vue index dda0935d..cd32ceed 100644 --- a/src/components/TransferOrderFilters.vue +++ b/src/components/TransferOrderFilters.vue @@ -46,14 +46,14 @@ import { IonTitle, IonToolbar } from "@ionic/vue"; -import { defineComponent } from "vue"; +import { computed, defineComponent } from "vue"; import { albumsOutline, banOutline, barChartOutline, calendarNumberOutline, checkmarkDoneOutline, closeOutline, filterOutline, iceCreamOutline, libraryOutline, pulseOutline, settings, shirtOutline, ticketOutline } from "ionicons/icons"; import { mapGetters, useStore } from 'vuex' import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper'; import { UtilService } from '@/services/UtilService'; import { hasError } from '@/adapter'; import logger from '@/logger'; -import { translate } from '@hotwax/dxp-components'; +import { translate, useUserStore } from '@hotwax/dxp-components'; export default defineComponent({ name: "TransferOrderFilters", @@ -81,7 +81,6 @@ export default defineComponent({ transferOrders: 'transferorder/getTransferOrders', getStatusDesc: 'util/getStatusDesc', getShipmentMethodDesc: 'util/getShipmentMethodDesc', - currentEComStore: 'user/getCurrentEComStore', }) }, async mounted() { @@ -127,7 +126,7 @@ export default defineComponent({ '-orderStatusId': { value: 'ORDER_CREATED' }, orderTypeId: { value: 'TRANSFER_ORDER' }, facilityId: { value: escapeSolrSpecialChars(this.currentFacility.facilityId) }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { "shipmentMethodTypeIdFacet":{ @@ -172,7 +171,9 @@ export default defineComponent({ }, setup() { const store = useStore(); - + const userStore = useUserStore() + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) + return { albumsOutline, banOutline, @@ -180,6 +181,7 @@ export default defineComponent({ calendarNumberOutline, checkmarkDoneOutline, closeOutline, + currentEComStore, filterOutline, iceCreamOutline, libraryOutline, diff --git a/src/main.ts b/src/main.ts index 9028bd23..8d4873e7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,7 +32,7 @@ import permissionActions from '@/authorization/Actions'; import { dxpComponents } from '@hotwax/dxp-components'; import { login, logout, loader } from '@/utils/user'; import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, setUserTimeZone, - getAvailableTimeZones } from './adapter'; + getAvailableTimeZones, getUserPreference, setEComStore, getEComStores } from './adapter'; import localeMessages from '@/locales'; import { addNotification, storeClientRegistrationToken } from '@/utils/firebase'; @@ -67,7 +67,10 @@ const app = createApp(App) setUserLocale, setUserTimeZone, storeClientRegistrationToken, - getAvailableTimeZones + getAvailableTimeZones, + getUserPreference, + setEComStore, + getEComStores }); router.isReady().then(() => { diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index 8c4e0d3d..dd31541d 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -398,15 +398,6 @@ const fetchEnumeration = async (query: any): Promise <any> => { }) } -const fetchProductStores = async (payload: any): Promise<any> => { - return api({ - url: "performFind", - method: "POST", - data: payload, - cache: true - }) -} - const fetchFacilities = async (payload: any): Promise<any> => { return api({ url: "performFind", @@ -485,7 +476,6 @@ export const UtilService = { fetchFacilityTypeInformation, fetchPartyInformation, fetchPicklistInformation, - fetchProductStores, fetchRejectReasonEnumTypes, fetchRejectReasons, fetchShipmentGatewayConfigs, diff --git a/src/store/modules/carrier/actions.ts b/src/store/modules/carrier/actions.ts index 35405e7a..a1e5dde2 100644 --- a/src/store/modules/carrier/actions.ts +++ b/src/store/modules/carrier/actions.ts @@ -6,7 +6,7 @@ import { hasError } from '@/adapter' import * as types from './mutation-types' import logger from '@/logger' import store from '@/store'; -import { translate } from '@hotwax/dxp-components'; +import { translate, useUserStore } from '@hotwax/dxp-components'; import { showToast, isValidCarrierCode, isValidDeliveryDays } from '@/utils'; @@ -184,7 +184,7 @@ const actions: ActionTree<CarrierState, RootState> = { const currentCarrier = state.current; const carrierShipmentMethods = currentCarrier.shipmentMethods const carrierProductStoreShipmentMethods = currentCarrier.productStoreShipmentMethods - const productStores = store.getters['util/getProductStores']; + const productStores = useUserStore().getProductStores; const carrierShipmentMethodsByProductStore = {} as any; const productStoreShipmentMethodFields = ["description", "productStoreId", "isTrackingRequired", "shipmentGatewayConfigId", "productStoreShipMethId"] @@ -427,6 +427,7 @@ const actions: ActionTree<CarrierState, RootState> = { commit(types.CARRIER_FACILITY_CARRIERS_UPDATED, facilityCarriers) }, async fetchProductStoreShipmentMeths({ state, commit }) { + const currentEComStore: any = useUserStore().getCurrentEComStore; let productStoreShipmentMethods = [] as any; let viewIndex = 0, resp; @@ -436,7 +437,7 @@ const actions: ActionTree<CarrierState, RootState> = { "entityName": "ProductStoreShipmentMethView", "inputFields": { "roleTypeId": "CARRIER", - "productStoreId": this.state.user.currentEComStore.productStoreId, + "productStoreId": currentEComStore.productStoreId, }, "fieldList": ["productStoreShipMethId", "productStoreId", "partyId", "roleTypeId", "shipmentMethodTypeId", "shipmentGatewayConfigId", "isTrackingRequired", "sequenceNumber", "description", "fromDate"], "noConditionFind": "Y", diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 47395110..0143753b 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -9,6 +9,12 @@ import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper' import { UtilService } from '@/services/UtilService' import logger from '@/logger' import { getOrderCategory, removeKitComponents } from '@/utils/order' +import { useUserStore } from '@hotwax/dxp-components' + +const getProductStoreId = () => { + const currentEComStore: any = useUserStore().getCurrentEComStore; + return currentEComStore.productStoreId +}; const actions: ActionTree<OrderState, RootState> = { async fetchInProgressOrdersAdditionalInformation({ commit, state }, payload = { viewIndex: 0 }) { @@ -257,7 +263,7 @@ const actions: ActionTree<OrderState, RootState> = { '-fulfillmentStatus': { value: ['Rejected', 'Cancelled'] }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } @@ -351,7 +357,7 @@ const actions: ActionTree<OrderState, RootState> = { orderStatusId: { value: 'ORDER_APPROVED' }, orderTypeId: { value: 'SALES_ORDER' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } @@ -422,7 +428,7 @@ const actions: ActionTree<OrderState, RootState> = { picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } @@ -696,7 +702,7 @@ const actions: ActionTree<OrderState, RootState> = { orderStatusId: { value: 'ORDER_APPROVED' }, orderTypeId: { value: 'SALES_ORDER' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } const orderQueryPayload = prepareOrderQuery(params) @@ -765,7 +771,7 @@ const actions: ActionTree<OrderState, RootState> = { '-fulfillmentStatus': { value: ['Cancelled', 'Rejected']}, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } @@ -832,7 +838,7 @@ const actions: ActionTree<OrderState, RootState> = { '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, shipGroupSeqId: { value: payload.shipGroupSeqId }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: getProductStoreId() } } } diff --git a/src/store/modules/transferorder/actions.ts b/src/store/modules/transferorder/actions.ts index 2961078a..f486f0b9 100644 --- a/src/store/modules/transferorder/actions.ts +++ b/src/store/modules/transferorder/actions.ts @@ -7,13 +7,14 @@ import { hasError } from '@/adapter' import * as types from './mutation-types' import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper' import logger from '@/logger' -import { shopifyImgContext, translate } from '@hotwax/dxp-components' +import { shopifyImgContext, translate, useUserStore } from '@hotwax/dxp-components' import { showToast } from "@/utils"; import { UtilService } from '@/services/UtilService' const actions: ActionTree<TransferOrderState, RootState> = { async findTransferOrders ({ commit, state }, payload = {}) { + const currentEComStore: any = useUserStore().getCurrentEComStore; emitter.emit('presentLoader'); let resp; const transferOrderQuery = JSON.parse(JSON.stringify(state.transferOrder.query)) @@ -29,7 +30,7 @@ const actions: ActionTree<TransferOrderState, RootState> = { filters: { orderTypeId: { value: 'TRANSFER_ORDER' }, facilityId: { value: escapeSolrSpecialChars(this.state.user.currentFacility.facilityId) }, - productStoreId: { value: this.state.user.currentEComStore.productStoreId } + productStoreId: { value: currentEComStore.productStoreId } } } diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index 7321f1cd..cb713fc4 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -5,7 +5,6 @@ export default interface UserState { pwaState: any; currentFacility: object; instanceUrl: string; - currentEComStore: object; preference: { printShippingLabel: boolean, printPackingSlip: boolean diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 164f9662..30fe56c9 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -16,6 +16,11 @@ import { useAuthStore, useUserStore, useProductIdentificationStore } from '@hotw import emitter from '@/event-bus' import { generateDeviceId, generateTopicName } from '@/utils/firebase' +const getProductStoreId = () => { + const currentEComStore: any = useUserStore().getCurrentEComStore; + return currentEComStore.productStoreId +}; + const actions: ActionTree<UserState, RootState> = { /** @@ -72,15 +77,9 @@ const actions: ActionTree<UserState, RootState> = { // TODO Use a separate API for getting facilities, this should handle user like admin accessing the app const currentFacility = userProfile.facilities[0]; - userProfile.stores = await UserService.getEComStores(token, currentFacility.facilityId); - - let preferredStore = userProfile.stores[0] - - const preferredStoreId = await UserService.getPreferredStore(token); - if (preferredStoreId) { - const store = userProfile.stores.find((store: any) => store.productStoreId === preferredStoreId); - store && (preferredStore = store) - } + userProfile.stores = await useUserStore().getEComStores(currentFacility.facilityId); + await useUserStore().getPreferredStore('SELECTED_BRAND'); + const preferredStore: any = useUserStore().getCurrentEComStore /* ---- Guard clauses ends here --- */ setPermissions(appPermissions); @@ -92,21 +91,20 @@ const actions: ActionTree<UserState, RootState> = { dispatch('getFieldMappings') // TODO user single mutation - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, preferredStore); commit(types.USER_CURRENT_FACILITY_UPDATED, currentFacility); commit(types.USER_INFO_UPDATED, userProfile); commit(types.USER_PERMISSIONS_UPDATED, appPermissions); commit(types.USER_TOKEN_CHANGED, { newToken: token }) // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(preferredStoreId ? preferredStoreId : preferredStore.productStoreId) + await useProductIdentificationStore().getIdentificationPref(preferredStore.productStoreId) .catch((error) => logger.error(error)); await dispatch("fetchAllNotificationPrefs"); this.dispatch('util/findProductStoreShipmentMethCount') this.dispatch('util/getForceScanSetting', preferredStore.productStoreId); - await dispatch('user/getPartialOrderRejectionConfig') - await dispatch('user/getCollateralRejectionConfig') + await dispatch('getPartialOrderRejectionConfig') + await dispatch('getCollateralRejectionConfig') } catch (err: any) { // If any of the API call in try block has status code other than 2xx it will be handled in common catch block. @@ -185,18 +183,11 @@ const actions: ActionTree<UserState, RootState> = { emitter.emit('presentLoader', {message: 'Updating facility', backdropDismiss: false}) const userProfile = JSON.parse(JSON.stringify(state.current as any)); - userProfile.stores = await UserService.getEComStores(undefined, payload.facility.facilityId); - - let preferredStore = userProfile.stores[0]; - const preferredStoreId = await UserService.getPreferredStore(undefined); + userProfile.stores = await useUserStore().getEComStores(payload.facility.facilityId); - if (preferredStoreId) { - const store = userProfile.stores.find((store: any) => store.productStoreId === preferredStoreId); - store && (preferredStore = store) - } + await useUserStore().getPreferredStore('SELECTED_BRAND'); commit(types.USER_INFO_UPDATED, userProfile); commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, preferredStore); this.dispatch('order/clearOrders') emitter.emit('dismissLoader') @@ -217,28 +208,6 @@ const actions: ActionTree<UserState, RootState> = { updateInstanceUrl(payload) }, - /** - * update current eComStore information - */ - async setEComStore({ commit }, payload) { - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, payload.eComStore); - await UserService.setUserPreference({ - 'userPrefTypeId': 'SELECTED_BRAND', - 'userPrefValue': payload.eComStore.productStoreId - }); - - // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(payload.eComStore.productStoreId) - .catch((error) => logger.error(error)); - - this.dispatch('util/findProductStoreShipmentMethCount') - this.dispatch('util/getForceScanSetting', payload.ecomStore.productStoreId) - }, - - setUserPreference({ commit }, payload){ - commit(types.USER_PREFERENCE_UPDATED, payload) - }, - async getFieldMappings({ commit }) { let fieldMappings = {} as any; try { @@ -433,7 +402,7 @@ const actions: ActionTree<UserState, RootState> = { //Create Product Store Setting payload = { ...payload, - "productStoreId": this.state.user.currentEComStore.productStoreId, + "productStoreId": getProductStoreId(), "settingTypeEnumId": "FULFILL_PART_ODR_REJ", "fromDate": DateTime.now().toMillis() } @@ -477,7 +446,7 @@ const actions: ActionTree<UserState, RootState> = { //Create Product Store Setting payload = { ...payload, - "productStoreId": this.state.user.currentEComStore.productStoreId, + "productStoreId": getProductStoreId(), "settingTypeEnumId": "FF_COLLATERAL_REJ", "fromDate": DateTime.now().toMillis() } @@ -504,7 +473,7 @@ const actions: ActionTree<UserState, RootState> = { let config = {}; const params = { "inputFields": { - "productStoreId": this.state.user.currentEComStore.productStoreId, + "productStoreId": getProductStoreId(), "settingTypeEnumId": "FULFILL_PART_ODR_REJ" }, "filterByDate": 'Y', @@ -529,7 +498,7 @@ const actions: ActionTree<UserState, RootState> = { let config = {}; const params = { "inputFields": { - "productStoreId": this.state.user.currentEComStore.productStoreId, + "productStoreId": getProductStoreId(), "settingTypeEnumId": "FF_COLLATERAL_REJ" }, "filterByDate": 'Y', diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index 918c6fba..7f5d8e9f 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -30,9 +30,6 @@ const getters: GetterTree <UserState, RootState> = { if (!baseURL) baseURL = state.instanceUrl; return baseURL.startsWith('http') ? baseURL.includes('/api') ? baseURL : `${baseURL}/api/` : `https://${baseURL}.hotwax.io/api/`; }, - getCurrentEComStore(state) { - return state.currentEComStore - }, getUserPreference(state) { return state.preference }, diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index fece9daf..1f040a7f 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -13,7 +13,6 @@ const userModule: Module<UserState, RootState> = { current: {}, currentFacility: {}, instanceUrl: '', - currentEComStore: {}, preference: { printShippingLabel: false, printPackingSlip: false diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index facad990..dd8be754 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -4,7 +4,6 @@ export const USER_END_SESSION = SN_USER + '/END_SESSION' export const USER_INFO_UPDATED = SN_USER + '/INFO_UPDATED' export const USER_CURRENT_FACILITY_UPDATED = SN_USER + '/CURRENT_FACILITY_UPDATED' export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED' -export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' export const USER_PREFERENCE_UPDATED = SN_USER + '/PREFERENCE_UPDATED' export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' export const USER_CURRENT_FIELD_MAPPING_UPDATED = SN_USER + '/_CURRENT_FIELD_MAPPING_UPDATED' diff --git a/src/store/modules/user/mutations.ts b/src/store/modules/user/mutations.ts index c944e753..5152458a 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -10,7 +10,6 @@ const mutations: MutationTree <UserState> = { state.token = '' state.current = {}, state.currentFacility = {} - state.currentEComStore = {} state.permissions = [], state.allNotificationPrefs = [] }, @@ -23,9 +22,6 @@ const mutations: MutationTree <UserState> = { [types.USER_INSTANCE_URL_UPDATED] (state, payload) { state.instanceUrl = payload; }, - [types.USER_CURRENT_ECOM_STORE_UPDATED](state, payload) { - state.currentEComStore = payload; - }, [types.USER_PREFERENCE_UPDATED] (state, payload) { state.preference = {...state.preference, ...payload}; }, diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index d43fbbd5..31197dd5 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -9,7 +9,6 @@ export default interface UtilState { productStoreShipmentMethCount: number; rejectReasonEnumTypes: []; enumerations: object; - productStores: any; facilities: any; shipmentGatewayConfigs: any; isForceScanEnabled: boolean; diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index a0bfcccf..32ba661b 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -5,9 +5,13 @@ import * as types from './mutation-types' import { UtilService } from '@/services/UtilService' import { hasError } from '@/adapter' import logger from '@/logger' -import store from '@/store'; import { showToast } from '@/utils' -import { translate } from '@hotwax/dxp-components' +import { translate, useUserStore } from '@hotwax/dxp-components' + +const getProductStoreId = () => { + const currentEComStore: any = useUserStore().getCurrentEComStore; + return currentEComStore.productStoreId +}; const actions: ActionTree<UtilState, RootState> = { async fetchRejectReasons({ commit }) { @@ -293,7 +297,7 @@ const actions: ActionTree<UtilState, RootState> = { return statusDesc; }, - async findProductStoreShipmentMethCount({ commit }) { + async findProductStoreShipmentMethCount({ commit }, eComStoreId) { let productStoreShipmentMethCount = 0 const params = { "entityName": "ProductStoreShipmentMeth", @@ -301,7 +305,7 @@ const actions: ActionTree<UtilState, RootState> = { "partyId": "_NA_", "partyId_op": "notEqual", "roleTypeId": "CARRIER", - "productStoreId": this.state.user.currentEComStore.productStoreId + "productStoreId": eComStoreId }, "fieldList": ['roleTypeId', "partyId"], "viewSize": 1 @@ -420,27 +424,6 @@ const actions: ActionTree<UtilState, RootState> = { commit(types.UTIL_FACILITIES_UPDATED, facilities) }, - async fetchProductStores({ commit }) { - let stores = []; - try { - const payload = { - "entityName": "ProductStore", - "noConditionFind": "Y", - "viewSize": 250 // keeping view size 100 as considering that we will have max 100 product stores - } - - const resp = await UtilService.fetchProductStores(payload) - if (!hasError(resp) && resp.data.count > 0) { - stores = resp.data.docs - } else { - throw resp.data - } - } catch (err) { - logger.error('Failed to fetch product stores', err) - } - commit(types.UTIL_PRODUCT_STORES_UPDATED, stores) - }, - async fetchShipmentGatewayConfigs({ commit }) { let configs = {}; try { @@ -492,7 +475,6 @@ const actions: ActionTree<UtilState, RootState> = { }, async createForceScanSetting({ commit }) { - const ecomStore = store.getters['user/getCurrentEComStore']; const fromDate = Date.now() try { @@ -512,7 +494,7 @@ const actions: ActionTree<UtilState, RootState> = { const params = { fromDate, - "productStoreId": ecomStore.productStoreId, + "productStoreId": getProductStoreId(), "settingTypeEnumId": "FULFILL_FORCE_SCAN", "settingValue": "false" } @@ -530,7 +512,7 @@ const actions: ActionTree<UtilState, RootState> = { async setForceScanSetting({ commit, dispatch, state }, value) { let prefValue = state.isForceScanEnabled - const eComStoreId = store.getters['user/getCurrentEComStore'].productStoreId; + const eComStoreId: any = getProductStoreId(); // when selecting none as ecom store, not updating the pref as it's not possible to save pref with empty productStoreId if(!eComStoreId) { diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index 2856087d..157a84fc 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -33,9 +33,6 @@ const getters: GetterTree <UtilState, RootState> = { getEnumerations(state) { return state.enumerations }, - getProductStores(state) { - return state.productStores; - }, getFacilities(state) { return state.facilities }, diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index f25c792e..3c3b6e6f 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -18,7 +18,6 @@ const utilModule: Module<UtilState, RootState> = { productStoreShipmentMethCount: 0, rejectReasonEnumTypes: [], enumerations: {}, - productStores: [], facilities: [], shipmentGatewayConfigs: [], isForceScanEnabled: false diff --git a/src/store/modules/util/mutation-types.ts b/src/store/modules/util/mutation-types.ts index 35da748a..b3924fa5 100644 --- a/src/store/modules/util/mutation-types.ts +++ b/src/store/modules/util/mutation-types.ts @@ -10,7 +10,6 @@ export const UTIL_PRODUCT_STORE_SHIPMENT_METH_COUNT_UPDATED = SN_UTIL + '/PRODUC export const UTIL_REJECT_REASON_ENUM_TYPES_UPDATED = SN_UTIL + '/REJECT_REASON_ENUM_TYPES_UPDATED' export const UTIL_ENUMERATIONS_UPDATED = SN_UTIL + '/ENUMERATIONS_UPDATED' export const UTIL_FACILITIES_UPDATED = SN_UTIL + '/FACILITIES_UPDATED' -export const UTIL_PRODUCT_STORES_UPDATED = SN_UTIL + '/PRODUCT_STORES_UPDATED' export const UTIL_SHIPMENT_GATEWAY_CONFIGS_UPDATED = SN_UTIL + '/SHIPMENT_GATEWAY_CONFIGS_UPDATED' export const UTIL_FORCE_SCAN_STATUS_UPDATED = SN_UTIL + '/FORCE_SCAN_STATUS_UPDATED' diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index 6d3791c3..e2df5776 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -36,9 +36,6 @@ const mutations: MutationTree <UtilState> = { [types.UTIL_FACILITIES_UPDATED](state, payload) { state.facilities = payload }, - [types.UTIL_PRODUCT_STORES_UPDATED](state, payload) { - state.productStores = payload - }, [types.UTIL_SHIPMENT_GATEWAY_CONFIGS_UPDATED](state, payload) { state.shipmentGatewayConfigs = payload }, diff --git a/src/views/CarrierDetail.vue b/src/views/CarrierDetail.vue index 73da2e2e..c366956e 100644 --- a/src/views/CarrierDetail.vue +++ b/src/views/CarrierDetail.vue @@ -133,10 +133,10 @@ alertController, modalController, } from '@ionic/vue'; - import { defineComponent } from 'vue'; + import { defineComponent, computed } from 'vue'; import { add, checkmarkDone, barcodeOutline, pricetagOutline, addCircleOutline, addOutline, ellipsisVerticalOutline, peopleOutline, shieldCheckmarkOutline } from 'ionicons/icons'; import { mapGetters, useStore } from "vuex"; - import { translate } from '@hotwax/dxp-components'; + import { translate, useUserStore } from '@hotwax/dxp-components'; import { useRouter } from 'vue-router'; import { Actions, hasPermission } from '@/authorization' @@ -187,8 +187,7 @@ async mounted() { emitter.emit('presentLoader'); await this.store.dispatch('carrier/fetchCarrierDetail', { partyId: this.$route.params.partyId }); - await Promise.all([this.store.dispatch('carrier/fetchShipmentMethodTypes'), this.store.dispatch('util/fetchProductStores'), - this.store.dispatch('util/fetchShipmentGatewayConfigs'), + await Promise.all([this.store.dispatch('carrier/fetchShipmentMethodTypes'), this.store.dispatch('util/fetchShipmentGatewayConfigs'), this.store.dispatch('carrier/fetchCarrierShipmentMethods', {partyId: this.$route.params.partyId}), this.store.dispatch('carrier/fetchProductStoreShipmentMethods', {partyId: this.$route.params.partyId}), this.store.dispatch('util/fetchFacilities')]) @@ -202,7 +201,6 @@ ...mapGetters({ shipmentMethodQuery: 'carrier/getShipmentMethodQuery', currentCarrier: 'carrier/getCurrent', - productStores : 'util/getProductStores', shipmentMethods: "carrier/getShipmentMethods", carrierShipmentMethodsByProductStore: "carrier/getCarrierShipmentMethodsByProductStore", shipmentGatewayConfigs : "util/getShipmentGatewayConfigs" @@ -441,6 +439,8 @@ setup() { const store = useStore(); const router = useRouter(); + const userStore = useUserStore() + let productStores: any = computed(() => userStore.getProductStores) return { Actions, @@ -453,6 +453,7 @@ hasPermission, pricetagOutline, peopleOutline, + productStores, shieldCheckmarkOutline, showToast, store, diff --git a/src/views/Completed.vue b/src/views/Completed.vue index 48801555..6aff49f8 100644 --- a/src/views/Completed.vue +++ b/src/views/Completed.vue @@ -204,7 +204,7 @@ import { useRouter } from 'vue-router'; import { mapGetters, useStore } from 'vuex' import { copyToClipboard, formatUtcDate, getFeature, showToast } from '@/utils' import { hasError } from '@/adapter' -import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore } from '@hotwax/dxp-components'; +import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import { UtilService } from '@/services/UtilService'; import { prepareOrderQuery } from '@/utils/solrHelper'; import emitter from '@/event-bus'; @@ -260,7 +260,6 @@ export default defineComponent({ completedOrders: 'order/getCompletedOrders', getProduct: 'product/getProduct', currentFacility: 'user/getCurrentFacility', - currentEComStore: 'user/getCurrentEComStore', getPartyName: 'util/getPartyName', getShipmentMethodDesc: 'util/getShipmentMethodDesc', getProductStock: 'stock/getProductStock', @@ -477,7 +476,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { "shipmentMethodFacet": { @@ -518,7 +517,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId }, + productStoreId: { value: this.currentEComStore.value?.productStoreId }, }, facet: { manifestContentIdFacet: { @@ -742,8 +741,10 @@ export default defineComponent({ setup() { const store = useStore(); const router = useRouter(); + const userStore = useUserStore() const productIdentificationStore = useProductIdentificationStore(); let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) return { Actions, @@ -752,6 +753,7 @@ export default defineComponent({ copyToClipboard, checkmarkDoneOutline, cubeOutline, + currentEComStore, downloadOutline, ellipsisVerticalOutline, formatUtcDate, diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 6db11bc3..98b30f8a 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -290,7 +290,7 @@ import { mapGetters, useStore } from 'vuex'; import { copyToClipboard, formatUtcDate, getFeature, jsonToCsv, showToast } from '@/utils'; import { isKit } from '@/utils/order' import { hasError } from '@/adapter'; -import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore } from '@hotwax/dxp-components'; +import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import ViewSizeSelector from '@/components/ViewSizeSelector.vue'; import { OrderService } from '@/services/OrderService'; import emitter from '@/event-bus'; @@ -351,7 +351,6 @@ export default defineComponent({ inProgressOrders: 'order/getInProgressOrders', getProduct: 'product/getProduct', rejectReasons: 'util/getRejectReasons', - currentEComStore: 'user/getCurrentEComStore', userPreference: 'user/getUserPreference', boxTypeDesc: 'util/getShipmentBoxDesc', getProductStock: 'stock/getProductStock', @@ -873,7 +872,7 @@ export default defineComponent({ '-fulfillmentStatus': { value: 'Rejected' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { picklistFacet: { @@ -1149,7 +1148,7 @@ export default defineComponent({ try { resp = await UserService.recycleInProgressOrders({ "facilityId": this.currentFacility.facilityId, - "productStoreId": this.currentEComStore.productStoreId, + "productStoreId": this.currentEComStore.value?.productStoreId, "reasonId": "INACTIVE_STORE" }) @@ -1249,8 +1248,10 @@ export default defineComponent({ setup() { const authStore = useAuthStore() const store = useStore(); + const userStore = useUserStore() const productIdentificationStore = useProductIdentificationStore(); let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) return { Actions, @@ -1262,6 +1263,7 @@ export default defineComponent({ checkmarkDoneOutline, closeCircleOutline, cubeOutline, + currentEComStore, ellipsisVerticalOutline, fileTrayOutline, formatUtcDate, diff --git a/src/views/OpenOrders.vue b/src/views/OpenOrders.vue index fd62701a..f81cf6ba 100644 --- a/src/views/OpenOrders.vue +++ b/src/views/OpenOrders.vue @@ -173,7 +173,7 @@ import { computed, defineComponent } from 'vue'; import { caretDownOutline, chevronUpOutline, cubeOutline, listOutline, notificationsOutline, optionsOutline, pricetagOutline, printOutline,} from 'ionicons/icons'; import AssignPickerModal from '@/views/AssignPickerModal.vue'; import { mapGetters, useStore } from 'vuex'; -import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore } from '@hotwax/dxp-components'; +import { getProductIdentificationValue, DxpShopifyImg, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import { formatUtcDate, getFeature, showToast } from '@/utils' import { hasError } from '@/adapter'; import { UtilService } from '@/services/UtilService'; @@ -221,7 +221,6 @@ export default defineComponent({ currentFacility: 'user/getCurrentFacility', openOrders: 'order/getOpenOrders', getProduct: 'product/getProduct', - currentEComStore: 'user/getCurrentEComStore', getShipmentMethodDesc: 'util/getShipmentMethodDesc', getProductStock: 'stock/getProductStock', notifications: 'user/getNotifications', @@ -319,7 +318,7 @@ export default defineComponent({ orderStatusId: { value: 'ORDER_APPROVED' }, orderTypeId: { value: 'SALES_ORDER' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { "shipmentMethodTypeIdFacet":{ @@ -387,7 +386,7 @@ export default defineComponent({ try { resp = await UserService.recycleOutstandingOrders({ "facilityId": this.currentFacility.facilityId, - "productStoreId": this.currentEComStore.productStoreId, + "productStoreId": this.currentEComStore.value?.productStoreId, "reasonId": "INACTIVE_STORE" }) @@ -432,14 +431,17 @@ export default defineComponent({ }, setup() { const store = useStore(); + const userStore = useUserStore() const productIdentificationStore = useProductIdentificationStore(); let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) return{ Actions, caretDownOutline, chevronUpOutline, cubeOutline, + currentEComStore, formatUtcDate, getFeature, getProductIdentificationValue, diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index a334a607..921e4b10 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -394,7 +394,7 @@ import { trashBinOutline, ribbonOutline } from 'ionicons/icons'; -import { getProductIdentificationValue, translate, DxpShopifyImg, useProductIdentificationStore } from '@hotwax/dxp-components'; +import { getProductIdentificationValue, translate, DxpShopifyImg, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components'; import { copyToClipboard, formatUtcDate, getFeature, showToast } from '@/utils' import { Actions, hasPermission } from '@/authorization' import OrderActionsPopover from '@/components/OrderActionsPopover.vue' @@ -450,7 +450,6 @@ export default defineComponent({ boxTypeDesc: 'util/getShipmentBoxDesc', completedOrders: 'order/getCompletedOrders', currentFacility: 'user/getCurrentFacility', - currentEComStore: 'user/getCurrentEComStore', getProduct: 'product/getProduct', getProductStock: 'stock/getProductStock', inProgressOrders: 'order/getInProgressOrders', @@ -758,7 +757,7 @@ export default defineComponent({ '-fulfillmentStatus': { value: 'Rejected' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { picklistFacet: { @@ -1320,7 +1319,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId } + productStoreId: { value: this.currentEComStore.value?.productStoreId } }, facet: { "shipmentMethodFacet": { @@ -1361,7 +1360,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility.facilityId }, - productStoreId: { value: this.currentEComStore.productStoreId }, + productStoreId: { value: this.currentEComStore.value?.productStoreId }, }, facet: { manifestContentIdFacet: { @@ -1466,8 +1465,10 @@ export default defineComponent({ setup() { const store = useStore(); const router = useRouter(); + const userStore = useUserStore() const productIdentificationStore = useProductIdentificationStore(); let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) return { addOutline, @@ -1480,6 +1481,7 @@ export default defineComponent({ closeCircleOutline, copyToClipboard, cubeOutline, + currentEComStore, documentTextOutline, ellipsisVerticalOutline, fileTrayOutline, diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index ecebf8ad..f1005735 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -112,7 +112,7 @@ <ion-list> <ion-item> <ion-label class="ion-text-wrap">{{ translate("Brand") }}</ion-label> - <ion-label class="ion-text-wrap" slot="end">{{ currentEcomStore.storeName || "-" }}</ion-label> + <ion-label class="ion-text-wrap" slot="end">{{ currentEComStore.storeName || "-" }}</ion-label> </ion-item> <ion-item lines="none"> <ion-label class="ion-text-wrap">{{ translate("Channel") }}</ion-label> @@ -268,8 +268,8 @@ import { IonTitle, IonToolbar } from "@ionic/vue"; -import { defineComponent } from "vue"; -import { translate } from '@hotwax/dxp-components'; +import { computed, defineComponent } from "vue"; +import { translate, useUserStore } from '@hotwax/dxp-components'; import { cubeOutline, golfOutline, callOutline, cashOutline, informationCircleOutline, ribbonOutline, mailOutline, ticketOutline, timeOutline, pulseOutline, storefrontOutline, sunnyOutline, checkmarkDoneOutline, downloadOutline } from "ionicons/icons"; import { mapGetters, useStore } from "vuex"; import { DateTime } from "luxon"; @@ -309,7 +309,6 @@ export default defineComponent({ computed: { ...mapGetters({ order: "orderLookup/getCurrentOrder", - currentEcomStore: "user/getCurrentEComStore", getProduct: "product/getProduct", getProductStock: "stock/getProductStock", getStatusDesc: "util/getStatusDesc", @@ -345,12 +344,15 @@ export default defineComponent({ }, setup() { const store = useStore(); + const userStore = useUserStore() + let currentEComStore: any = computed(() => userStore.getCurrentEComStore) return { callOutline, cashOutline, checkmarkDoneOutline, cubeOutline, + currentEComStore, downloadOutline, formatCurrency, getColorByDesc, diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 74819dfb..02e15f42 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -38,26 +38,7 @@ <section> <DxpOmsInstanceNavigator /> - - <ion-card> - <ion-card-header> - <ion-card-subtitle> - {{ translate("Product Store") }} - </ion-card-subtitle> - <ion-card-title> - {{ translate("Store") }} - </ion-card-title> - </ion-card-header> - <ion-card-content> - {{ translate('A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.') }} - </ion-card-content> - <ion-item lines="none"> - <ion-select :label="translate('Select store')" interface="popover" :value="currentEComStore.productStoreId" @ionChange="setEComStore($event)"> - <ion-select-option v-for="store in (userProfile ? userProfile.stores : [])" :key="store.productStoreId" :value="store.productStoreId" >{{ store.storeName }}</ion-select-option> - </ion-select> - </ion-item> - </ion-card> - + <DxpProductStoreSelector @updateEcomStore="handleEComStoreUpdate($event)"/> <ion-card> <ion-card-header> <ion-card-title> @@ -292,7 +273,6 @@ export default defineComponent({ userProfile: 'user/getUserProfile', currentFacility: 'user/getCurrentFacility', instanceUrl: 'user/getInstanceUrl', - currentEComStore: 'user/getCurrentEComStore', userPreference: 'user/getUserPreference', locale: 'user/getLocale', notificationPrefs: 'user/getNotificationPrefs', @@ -315,6 +295,10 @@ export default defineComponent({ await this.store.dispatch('user/fetchNotificationPreferences') }, methods: { + handleEComStoreUpdate (event: any) { + this.store.dispatch('util/findProductStoreShipmentMethCount', event.detail.value) + this.store.dispatch('util/getForceScanSetting', event.detail.value) + }, async getCurrentFacilityDetails() { let resp: any; try { @@ -571,17 +555,6 @@ export default defineComponent({ this.store.dispatch("util/setForceScanSetting", !this.isForceScanEnabled) }, - async setEComStore(event: any) { - // not updating the ecomstore when an empty value is given (on logout) - if (!event.detail.value) { - return; - } - if(this.userProfile) { - await this.store.dispatch('user/setEComStore', { - 'eComStore': this.userProfile.stores.find((str: any) => str.productStoreId == event.detail.value) - }) - } - }, setPrintShippingLabelPreference (ev: any) { this.store.dispatch('user/setUserPreference', { printShippingLabel: ev.detail.checked }) }, diff --git a/src/views/TransferOrders.vue b/src/views/TransferOrders.vue index 6ad5df1f..bf059337 100644 --- a/src/views/TransferOrders.vue +++ b/src/views/TransferOrders.vue @@ -100,7 +100,6 @@ export default defineComponent({ ...mapGetters({ currentFacility: 'user/getCurrentFacility', transferOrders: 'transferorder/getTransferOrders', - currentEComStore: 'user/getCurrentEComStore', getShipmentMethodDesc: 'util/getShipmentMethodDesc', }) }, From 37344c3287c0637d3b34a2fdbb64308effd2f4fa Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Fri, 18 Oct 2024 16:31:28 +0530 Subject: [PATCH 2/9] Improved: changed oms-api function & dxp function name, also update argument of emitted function(dxp-193) --- src/adapter/index.ts | 4 ++-- src/main.ts | 4 ++-- src/store/modules/user/actions.ts | 4 ++-- src/views/Settings.vue | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 9cca78c3..094811bc 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,6 +1,6 @@ import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, getUserFacilities, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken, - subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones, getUserPreference, setEComStore, getEComStores } from '@hotwax/oms-api' + subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones, getUserPreference, setUserPreference, getEComStores } from '@hotwax/oms-api' export { api, @@ -25,6 +25,6 @@ export { setUserTimeZone, getAvailableTimeZones, getUserPreference, - setEComStore, + setUserPreference, getEComStores } \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 8d4873e7..a9e1b424 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,7 +32,7 @@ import permissionActions from '@/authorization/Actions'; import { dxpComponents } from '@hotwax/dxp-components'; import { login, logout, loader } from '@/utils/user'; import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, setUserTimeZone, - getAvailableTimeZones, getUserPreference, setEComStore, getEComStores } from './adapter'; + getAvailableTimeZones, getUserPreference, setUserPreference, getEComStores } from './adapter'; import localeMessages from '@/locales'; import { addNotification, storeClientRegistrationToken } from '@/utils/firebase'; @@ -69,7 +69,7 @@ const app = createApp(App) storeClientRegistrationToken, getAvailableTimeZones, getUserPreference, - setEComStore, + setUserPreference, getEComStores }); diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 30fe56c9..6af69b8a 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -78,7 +78,7 @@ const actions: ActionTree<UserState, RootState> = { // TODO Use a separate API for getting facilities, this should handle user like admin accessing the app const currentFacility = userProfile.facilities[0]; userProfile.stores = await useUserStore().getEComStores(currentFacility.facilityId); - await useUserStore().getPreferredStore('SELECTED_BRAND'); + await useUserStore().getEComStorePreference('SELECTED_BRAND'); const preferredStore: any = useUserStore().getCurrentEComStore /* ---- Guard clauses ends here --- */ @@ -185,7 +185,7 @@ const actions: ActionTree<UserState, RootState> = { const userProfile = JSON.parse(JSON.stringify(state.current as any)); userProfile.stores = await useUserStore().getEComStores(payload.facility.facilityId); - await useUserStore().getPreferredStore('SELECTED_BRAND'); + await useUserStore().getEComStorePreference('SELECTED_BRAND'); commit(types.USER_INFO_UPDATED, userProfile); commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); this.dispatch('order/clearOrders') diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 02e15f42..04d9df9d 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -295,9 +295,9 @@ export default defineComponent({ await this.store.dispatch('user/fetchNotificationPreferences') }, methods: { - handleEComStoreUpdate (event: any) { - this.store.dispatch('util/findProductStoreShipmentMethCount', event.detail.value) - this.store.dispatch('util/getForceScanSetting', event.detail.value) + handleEComStoreUpdate(selectedProductStore: any) { + this.store.dispatch('util/findProductStoreShipmentMethCount', selectedProductStore?.productStoreId) + this.store.dispatch('util/getForceScanSetting', selectedProductStore?.productStoreId) }, async getCurrentFacilityDetails() { let resp: any; @@ -449,7 +449,7 @@ export default defineComponent({ if (this.userProfile){ await this.store.dispatch('user/setFacility', { - 'facility': this.userProfile.facilities.find((fac: any) => fac.facilityId == event.detail.value) + 'facility': this.userProfile.facilities.find((facility: any) => facility.facilityId == event.detail.value) }); await this.store.dispatch('user/fetchNotificationPreferences') this.store.dispatch('order/clearOrders') From 4e6966b4360c3d02fe73634155e1e21a61fd2621 Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Tue, 17 Dec 2024 16:52:03 +0530 Subject: [PATCH 3/9] Improved: Changed the emitted event name when the selected product store is changed (#dxp/193) --- src/App.vue | 1 - src/views/Settings.vue | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6ce0e98b..6e5e31d4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,6 @@ export default defineComponent({ instanceUrl: 'user/getInstanceUrl', userProfile: 'user/getUserProfile', locale: 'user/getLocale', - currentFacility: 'user/getCurrentFacility', }) }, methods: { diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 0158e66b..896a2af0 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -39,7 +39,7 @@ <section> <DxpOmsInstanceNavigator /> <DxpFacilitySwitcher @updateFacility="updateFacility($event)"/> - <DxpProductStoreSelector @updateEcomStore="updateEcomStore($event)"/> + <DxpProductStoreSelector @updateEComStore="updateEComStore($event)"/> <ion-card> <ion-card-header> @@ -289,7 +289,7 @@ export default defineComponent({ await this.store.dispatch('user/fetchNotificationPreferences') }, methods: { - updateEcomStore(selectedProductStore: any) { + updateEComStore(selectedProductStore: any) { this.store.dispatch('user/setEComStore', selectedProductStore?.productStoreId) }, useNewRejectionApi() { From c8fa0cd98a3bef7b26b90cc85c40f3146f1a122c Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Tue, 17 Dec 2024 19:11:20 +0530 Subject: [PATCH 4/9] Improved: reverted some unwanted changes optional chaining & getter(#dxp/193) --- src/components/ShippingLabelActionPopover.vue | 1 - src/components/TransferOrderFilters.vue | 6 +++--- src/views/Completed.vue | 4 ++-- src/views/InProgress.vue | 4 ++-- src/views/OpenOrders.vue | 4 ++-- src/views/OrderDetail.vue | 6 +++--- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/ShippingLabelActionPopover.vue b/src/components/ShippingLabelActionPopover.vue index 804d46dc..0394ea55 100644 --- a/src/components/ShippingLabelActionPopover.vue +++ b/src/components/ShippingLabelActionPopover.vue @@ -45,7 +45,6 @@ computed: { ...mapGetters({ facilityProductStores: 'facility/getFacilityProductStores', - getProductStore: 'util/getProductStore', shopifyShopIdForProductStore: 'util/getShopifyShopIdForProductStore', current: 'facility/getCurrent' }) diff --git a/src/components/TransferOrderFilters.vue b/src/components/TransferOrderFilters.vue index 0f1d8c15..ccc301e4 100644 --- a/src/components/TransferOrderFilters.vue +++ b/src/components/TransferOrderFilters.vue @@ -46,7 +46,7 @@ import { IonTitle, IonToolbar } from "@ionic/vue"; -import { computed, defineComponent } from "vue"; +import { defineComponent, computed } from "vue"; import { albumsOutline, banOutline, barChartOutline, calendarNumberOutline, checkmarkDoneOutline, closeOutline, filterOutline, iceCreamOutline, libraryOutline, pulseOutline, settings, shirtOutline, ticketOutline } from "ionicons/icons"; import { mapGetters, useStore } from 'vuex' import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper'; @@ -124,8 +124,8 @@ export default defineComponent({ filters: { '-orderStatusId': { value: 'ORDER_CREATED' }, orderTypeId: { value: 'TRANSFER_ORDER' }, - facilityId: { value: escapeSolrSpecialChars(this.currentFacility.facilityId) }, - productStoreId: { value: this.currentEComStore?.productStoreId } + facilityId: { value: escapeSolrSpecialChars(this.currentFacility?.facilityId) }, + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { "shipmentMethodTypeIdFacet":{ diff --git a/src/views/Completed.vue b/src/views/Completed.vue index 6aa6c250..ce4d28e3 100644 --- a/src/views/Completed.vue +++ b/src/views/Completed.vue @@ -479,7 +479,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId } + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { "shipmentMethodFacet": { @@ -520,7 +520,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId }, + productStoreId: { value: this.currentEComStore.productStoreId }, }, facet: { manifestContentIdFacet: { diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 0cfba8df..c5d27d02 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -916,7 +916,7 @@ export default defineComponent({ '-fulfillmentStatus': { value: 'Rejected' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId } + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { picklistFacet: { @@ -1192,7 +1192,7 @@ export default defineComponent({ try { resp = await UserService.recycleInProgressOrders({ "facilityId": this.currentFacility?.facilityId, - "productStoreId": this.currentEComStore?.productStoreId, + "productStoreId": this.currentEComStore.productStoreId, "reasonId": "INACTIVE_STORE" }) diff --git a/src/views/OpenOrders.vue b/src/views/OpenOrders.vue index 426896c0..de58a04a 100644 --- a/src/views/OpenOrders.vue +++ b/src/views/OpenOrders.vue @@ -317,7 +317,7 @@ export default defineComponent({ orderStatusId: { value: 'ORDER_APPROVED' }, orderTypeId: { value: 'SALES_ORDER' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId } + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { "shipmentMethodTypeIdFacet":{ @@ -385,7 +385,7 @@ export default defineComponent({ try { resp = await UserService.recycleOutstandingOrders({ "facilityId": this.currentFacility?.facilityId, - "productStoreId": this.currentEComStore?.productStoreId, + "productStoreId": this.currentEComStore.productStoreId, "reasonId": "INACTIVE_STORE" }) diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index 957f627a..f23a00b9 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -833,7 +833,7 @@ export default defineComponent({ '-fulfillmentStatus': { value: 'Rejected' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId } + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { picklistFacet: { @@ -1427,7 +1427,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId } + productStoreId: { value: this.currentEComStore.productStoreId } }, facet: { "shipmentMethodFacet": { @@ -1468,7 +1468,7 @@ export default defineComponent({ picklistItemStatusId: { value: '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, facilityId: { value: this.currentFacility?.facilityId }, - productStoreId: { value: this.currentEComStore?.productStoreId }, + productStoreId: { value: this.currentEComStore.productStoreId }, }, facet: { manifestContentIdFacet: { From c8d267e6f65d3ea5cb935441dbf297d1d26fd91d Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Tue, 17 Dec 2024 19:26:52 +0530 Subject: [PATCH 5/9] Reverted: package-lock.json file (#dxp/193) --- package-lock.json | 274 +++++++++++++++++++++++++--------------------- 1 file changed, 150 insertions(+), 124 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6602a102..da2f956a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fulfillment", - "version": "2.11.1", + "version": "2.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fulfillment", - "version": "2.11.1", + "version": "2.12.0", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", @@ -465,17 +465,19 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -532,12 +534,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", - "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", - "dependencies": { - "@babel/types": "^7.26.3" - }, + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1876,12 +1875,14 @@ } }, "node_modules/@babel/types": { - "version": "7.26.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", - "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" @@ -2817,43 +2818,42 @@ } }, "node_modules/@hotwax/dxp-components/node_modules/@vue/reactivity": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.13.tgz", - "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", "dependencies": { - "@vue/shared": "3.5.13" + "@vue/shared": "3.4.21" } }, "node_modules/@hotwax/dxp-components/node_modules/@vue/runtime-core": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.13.tgz", - "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", "dependencies": { - "@vue/reactivity": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@hotwax/dxp-components/node_modules/@vue/runtime-dom": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", - "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", "dependencies": { - "@vue/reactivity": "3.5.13", - "@vue/runtime-core": "3.5.13", - "@vue/shared": "3.5.13", + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", "csstype": "^3.1.3" } }, "node_modules/@hotwax/dxp-components/node_modules/@vue/server-renderer": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.13.tgz", - "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", "dependencies": { - "@vue/compiler-ssr": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { - "vue": "3.5.13" + "vue": "3.4.21" } }, "node_modules/@hotwax/dxp-components/node_modules/csstype": { @@ -2862,9 +2862,9 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/@hotwax/dxp-components/node_modules/luxon": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", - "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", "engines": { "node": ">=12" } @@ -2895,17 +2895,17 @@ } }, "node_modules/@hotwax/dxp-components/node_modules/pinia-plugin-persistedstate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.3.tgz", - "integrity": "sha512-Cm819WBj/s5K5DGw55EwbXDtx+EZzM0YR5AZbq9XE3u0xvXwvX2JnWoFpWIcdzISBHqy9H1UiSIUmXyXqWsQRQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz", + "integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==", "peerDependencies": { "pinia": "^2.0.0" } }, "node_modules/@hotwax/dxp-components/node_modules/pinia/node_modules/vue-demi": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz", - "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz", + "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==", "hasInstallScript": true, "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", @@ -2928,15 +2928,15 @@ } }, "node_modules/@hotwax/dxp-components/node_modules/vue": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz", - "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", "dependencies": { - "@vue/compiler-dom": "3.5.13", - "@vue/compiler-sfc": "3.5.13", - "@vue/runtime-dom": "3.5.13", - "@vue/server-renderer": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { "typescript": "*" @@ -2993,12 +2993,12 @@ "dev": true }, "node_modules/@intlify/core-base": { - "version": "9.14.2", - "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.14.2.tgz", - "integrity": "sha512-DZyQ4Hk22sC81MP4qiCDuU+LdaYW91A6lCjq8AWPvY3+mGMzhGDfOCzvyR6YBQxtlPjFqMoFk9ylnNYRAQwXtQ==", + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.10.2.tgz", + "integrity": "sha512-HGStVnKobsJL0DoYIyRCGXBH63DMQqEZxDUGrkNI05FuTcruYUtOAxyL3zoAZu/uDGO6mcUvm3VXBaHG2GdZCg==", "dependencies": { - "@intlify/message-compiler": "9.14.2", - "@intlify/shared": "9.14.2" + "@intlify/message-compiler": "9.10.2", + "@intlify/shared": "9.10.2" }, "engines": { "node": ">= 16" @@ -3008,11 +3008,11 @@ } }, "node_modules/@intlify/message-compiler": { - "version": "9.14.2", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.14.2.tgz", - "integrity": "sha512-YsKKuV4Qv4wrLNsvgWbTf0E40uRv+Qiw1BeLQ0LAxifQuhiMe+hfTIzOMdWj/ZpnTDj4RSZtkXjJM7JDiiB5LQ==", + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.10.2.tgz", + "integrity": "sha512-ntY/kfBwQRtX5Zh6wL8cSATujPzWW2ZQd1QwKyWwAy5fMqJyyixHMeovN4fmEyCqSu+hFfYOE63nU94evsy4YA==", "dependencies": { - "@intlify/shared": "9.14.2", + "@intlify/shared": "9.10.2", "source-map-js": "^1.0.2" }, "engines": { @@ -3023,9 +3023,9 @@ } }, "node_modules/@intlify/shared": { - "version": "9.14.2", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.14.2.tgz", - "integrity": "sha512-uRAHAxYPeF+G5DBIboKpPgC/Waecd4Jz8ihtkpJQD5ycb5PwXp0k/+hBGl5dAjwF7w+l74kz/PKA8r8OK//RUw==", + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.10.2.tgz", + "integrity": "sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==", "engines": { "node": ">= 16" }, @@ -3204,9 +3204,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -5511,49 +5511,49 @@ "dev": true }, "node_modules/@vue/compiler-core": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.13.tgz", - "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/shared": "3.5.13", + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", "entities": "^4.5.0", "estree-walker": "^2.0.2", - "source-map-js": "^1.2.0" + "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", - "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", "dependencies": { - "@vue/compiler-core": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", - "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", - "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/compiler-core": "3.5.13", - "@vue/compiler-dom": "3.5.13", - "@vue/compiler-ssr": "3.5.13", - "@vue/shared": "3.5.13", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", + "dependencies": { + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", "estree-walker": "^2.0.2", - "magic-string": "^0.30.11", - "postcss": "^8.4.48", - "source-map-js": "^1.2.0" + "magic-string": "^0.30.7", + "postcss": "^8.4.35", + "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", - "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", "dependencies": { - "@vue/compiler-dom": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/component-compiler-utils": { @@ -5768,9 +5768,9 @@ "integrity": "sha512-vPV6Cq+NIWbH5pZu+V+2QHE9y1qfuTq49uNWw4f7FDEeZaDU2H2cx5jcUZOAKW7qTrUS4k6qZPbMy1x4N96nbA==" }, "node_modules/@vue/shared": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.13.tgz", - "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==" + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==" }, "node_modules/@vue/test-utils": { "version": "2.4.5", @@ -10548,6 +10548,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -13047,11 +13061,14 @@ } }, "node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" } }, "node_modules/make-dir": { @@ -14147,9 +14164,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -14240,9 +14257,9 @@ } }, "node_modules/postcss": { - "version": "8.4.49", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "funding": [ { "type": "opencollective", @@ -14259,8 +14276,8 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -16152,9 +16169,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "engines": { "node": ">=0.10.0" } @@ -16927,6 +16944,15 @@ "node": ">=14.14" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -17679,12 +17705,12 @@ "dev": true }, "node_modules/vue-i18n": { - "version": "9.14.2", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.14.2.tgz", - "integrity": "sha512-JK9Pm80OqssGJU2Y6F7DcM8RFHqVG4WkuCqOZTVsXkEzZME7ABejAUqUdA931zEBedc4thBgSUWxeQh4uocJAQ==", + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.10.2.tgz", + "integrity": "sha512-ECJ8RIFd+3c1d3m1pctQ6ywG5Yj8Efy1oYoAKQ9neRdkLbuKLVeW4gaY5HPkD/9ssf1pOnUrmIFjx2/gkGxmEw==", "dependencies": { - "@intlify/core-base": "9.14.2", - "@intlify/shared": "9.14.2", + "@intlify/core-base": "9.10.2", + "@intlify/shared": "9.10.2", "@vue/devtools-api": "^6.5.0" }, "engines": { @@ -19115,4 +19141,4 @@ "dev": true } } -} +} \ No newline at end of file From 0e1b254656e89d7114a48e4f28caf15556dbd06a Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Tue, 17 Dec 2024 19:35:19 +0530 Subject: [PATCH 6/9] Improved: changed the app version to current version(#dxp/193) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index da2f956a..1ec2572f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fulfillment", - "version": "2.12.0", + "version": "2.11.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fulfillment", - "version": "2.12.0", + "version": "2.11.1", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", diff --git a/package.json b/package.json index 6ab07326..76f42cf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fulfillment", - "version": "2.11.1", + "version": "2.12.0", "private": true, "description": "An Ionic project", "scripts": { From 15b5d7d9e165311f265e310cc4f83f214fa3f048 Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Wed, 18 Dec 2024 11:01:54 +0530 Subject: [PATCH 7/9] Improved: Added a condition to validate productStoreId while retrieving product identification from DXP after a refresh (#dxp/193) --- src/App.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6e5e31d4..e03fc0b4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -137,13 +137,10 @@ export default defineComponent({ Settings.defaultZone = this.userProfile.userTimeZone; } - // need to discuss this case - // await useUserStore().getEComStoresByFacility(''); - // await useUserStore().getPreferredStore('SELECTED_BRAND'); const currentEComStore: any = useUserStore().getCurrentEComStore; // If fetching identifier without checking token then on login the app stucks in a loop, as the mounted hook runs before // token is available which results in api failure as unauthenticated, thus making logout call and then login call again and so on. - if(this.userToken) { + if(this.userToken && currentEComStore?.productStoreId) { // Get product identification from api using dxp-component await useProductIdentificationStore().getIdentificationPref(currentEComStore.productStoreId) .catch((error) => logger.error(error)); From 6e72ef500161662891ff9f816f1137485509eed7 Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Wed, 18 Dec 2024 18:30:07 +0530 Subject: [PATCH 8/9] Reverted: productStores state of Util store used on the Carrier Page (#dxp/193) --- package.json | 2 +- src/components/ShippingLabelActionPopover.vue | 2 ++ src/services/UtilService.ts | 10 ++++++++ src/store/modules/carrier/actions.ts | 4 +-- src/store/modules/user/actions.ts | 2 +- src/store/modules/util/UtilState.ts | 1 + src/store/modules/util/actions.ts | 25 +++++++++++++++++-- src/store/modules/util/getters.ts | 3 +++ src/store/modules/util/index.ts | 1 + src/store/modules/util/mutation-types.ts | 1 + src/store/modules/util/mutations.ts | 3 +++ src/views/CarrierDetail.vue | 11 ++++---- 12 files changed, 53 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 76f42cf9..6ab07326 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fulfillment", - "version": "2.12.0", + "version": "2.11.1", "private": true, "description": "An Ionic project", "scripts": { diff --git a/src/components/ShippingLabelActionPopover.vue b/src/components/ShippingLabelActionPopover.vue index 0394ea55..c384f462 100644 --- a/src/components/ShippingLabelActionPopover.vue +++ b/src/components/ShippingLabelActionPopover.vue @@ -45,6 +45,8 @@ computed: { ...mapGetters({ facilityProductStores: 'facility/getFacilityProductStores', + getProductStore: 'util/getProductStore', + productStores: 'util/getProductStores', shopifyShopIdForProductStore: 'util/getShopifyShopIdForProductStore', current: 'facility/getCurrent' }) diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index e17d7724..7757f694 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -449,6 +449,15 @@ const fetchEnumeration = async (query: any): Promise <any> => { }) } +const fetchProductStores = async (payload: any): Promise<any> => { + return api({ + url: "performFind", + method: "POST", + data: payload, + cache: true + }) +} + const fetchFacilities = async (payload: any): Promise<any> => { return api({ url: "performFind", @@ -643,6 +652,7 @@ export const UtilService = { fetchGiftCardItemPriceInfo, fetchPartyInformation, fetchPicklistInformation, + fetchProductStores, fetchRejectReasonEnumTypes, fetchRejectReasons, fetchShipmentGatewayConfigs, diff --git a/src/store/modules/carrier/actions.ts b/src/store/modules/carrier/actions.ts index 01447652..6ee83e6b 100644 --- a/src/store/modules/carrier/actions.ts +++ b/src/store/modules/carrier/actions.ts @@ -6,7 +6,7 @@ import { hasError } from '@/adapter' import * as types from './mutation-types' import logger from '@/logger' import store from '@/store'; -import { translate, useUserStore } from '@hotwax/dxp-components'; +import { translate } from '@hotwax/dxp-components'; import { showToast, isValidCarrierCode, isValidDeliveryDays, getCurrentFacilityId, getProductStoreId } from '@/utils'; @@ -184,7 +184,7 @@ const actions: ActionTree<CarrierState, RootState> = { const currentCarrier = state.current; const carrierShipmentMethods = currentCarrier.shipmentMethods const carrierProductStoreShipmentMethods = currentCarrier.productStoreShipmentMethods - const productStores = useUserStore().getProductStores; + const productStores = store.getters['util/getProductStores']; const carrierShipmentMethodsByProductStore = {} as any; const productStoreShipmentMethodFields = ["description", "productStoreId", "isTrackingRequired", "shipmentGatewayConfigId", "productStoreShipMethId"] diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 04ed96d5..f0fe0341 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -225,7 +225,7 @@ const actions: ActionTree<UserState, RootState> = { await dispatch('getDisableShipNowConfig') await dispatch('getDisableUnpackConfig') - this.dispatch('util/findProductStoreShipmentMethCount', productStoreId); + this.dispatch('util/findProductStoreShipmentMethCount'); this.dispatch('util/getForceScanSetting', productStoreId) this.dispatch('util/fetchBarcodeIdentificationPref', productStoreId); }, diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index 8ee1a095..3834bb4b 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -9,6 +9,7 @@ export default interface UtilState { productStoreShipmentMethCount: number; rejectReasonEnumTypes: []; enumerations: object; + productStores: any; facilities: any; shipmentGatewayConfigs: any; isForceScanEnabled: boolean; diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index dd055eba..898ba1e1 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -340,7 +340,7 @@ const actions: ActionTree<UtilState, RootState> = { return statusDesc; }, - async findProductStoreShipmentMethCount({ commit }, eComStoreId) { + async findProductStoreShipmentMethCount({ commit }) { let productStoreShipmentMethCount = 0 const params = { "entityName": "ProductStoreShipmentMeth", @@ -348,7 +348,7 @@ const actions: ActionTree<UtilState, RootState> = { "partyId": "_NA_", "partyId_op": "notEqual", "roleTypeId": "CARRIER", - "productStoreId": eComStoreId + "productStoreId": getProductStoreId() }, "fieldList": ['roleTypeId', "partyId"], "viewSize": 1 @@ -467,6 +467,27 @@ const actions: ActionTree<UtilState, RootState> = { commit(types.UTIL_FACILITIES_UPDATED, facilities) }, + async fetchProductStores({ commit }) { + let stores = []; + try { + const payload = { + "entityName": "ProductStore", + "noConditionFind": "Y", + "viewSize": 250 // keeping view size 100 as considering that we will have max 100 product stores + } + + const resp = await UtilService.fetchProductStores(payload) + if (!hasError(resp) && resp.data.count > 0) { + stores = resp.data.docs + } else { + throw resp.data + } + } catch (err) { + logger.error('Failed to fetch product stores', err) + } + commit(types.UTIL_PRODUCT_STORES_UPDATED, stores) + }, + async fetchShipmentGatewayConfigs({ commit }) { let configs = {}; try { diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index dfd3d694..6c381173 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -33,6 +33,9 @@ const getters: GetterTree <UtilState, RootState> = { getEnumerations(state) { return state.enumerations }, + getProductStores(state) { + return state.productStores; + }, getFacilities(state) { return state.facilities }, diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index ceee4ba0..e3edf429 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -19,6 +19,7 @@ const utilModule: Module<UtilState, RootState> = { rejectReasonEnumTypes: [], enumerations: {}, facilities: [], + productStores: [], shipmentGatewayConfigs: [], isForceScanEnabled: false, fulfillmentRejectReasons: {}, diff --git a/src/store/modules/util/mutation-types.ts b/src/store/modules/util/mutation-types.ts index 5111975a..cecb5872 100644 --- a/src/store/modules/util/mutation-types.ts +++ b/src/store/modules/util/mutation-types.ts @@ -10,6 +10,7 @@ export const UTIL_PRODUCT_STORE_SHIPMENT_METH_COUNT_UPDATED = SN_UTIL + '/PRODUC export const UTIL_REJECT_REASON_ENUM_TYPES_UPDATED = SN_UTIL + '/REJECT_REASON_ENUM_TYPES_UPDATED' export const UTIL_ENUMERATIONS_UPDATED = SN_UTIL + '/ENUMERATIONS_UPDATED' export const UTIL_FACILITIES_UPDATED = SN_UTIL + '/FACILITIES_UPDATED' +export const UTIL_PRODUCT_STORES_UPDATED = SN_UTIL + '/PRODUCT_STORES_UPDATED' export const UTIL_SHIPMENT_GATEWAY_CONFIGS_UPDATED = SN_UTIL + '/SHIPMENT_GATEWAY_CONFIGS_UPDATED' export const UTIL_FORCE_SCAN_STATUS_UPDATED = SN_UTIL + '/FORCE_SCAN_STATUS_UPDATED' export const UTIL_FULFILLMENT_REJECT_REASONS_UPDATED = SN_UTIL + '/FULFILLMENT_REJECT_REASONS_UPDATED' diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index 7916595a..5e8d8070 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -36,6 +36,9 @@ const mutations: MutationTree <UtilState> = { [types.UTIL_FACILITIES_UPDATED](state, payload) { state.facilities = payload }, + [types.UTIL_PRODUCT_STORES_UPDATED](state, payload) { + state.productStores = payload + }, [types.UTIL_SHIPMENT_GATEWAY_CONFIGS_UPDATED](state, payload) { state.shipmentGatewayConfigs = payload }, diff --git a/src/views/CarrierDetail.vue b/src/views/CarrierDetail.vue index c366956e..73da2e2e 100644 --- a/src/views/CarrierDetail.vue +++ b/src/views/CarrierDetail.vue @@ -133,10 +133,10 @@ alertController, modalController, } from '@ionic/vue'; - import { defineComponent, computed } from 'vue'; + import { defineComponent } from 'vue'; import { add, checkmarkDone, barcodeOutline, pricetagOutline, addCircleOutline, addOutline, ellipsisVerticalOutline, peopleOutline, shieldCheckmarkOutline } from 'ionicons/icons'; import { mapGetters, useStore } from "vuex"; - import { translate, useUserStore } from '@hotwax/dxp-components'; + import { translate } from '@hotwax/dxp-components'; import { useRouter } from 'vue-router'; import { Actions, hasPermission } from '@/authorization' @@ -187,7 +187,8 @@ async mounted() { emitter.emit('presentLoader'); await this.store.dispatch('carrier/fetchCarrierDetail', { partyId: this.$route.params.partyId }); - await Promise.all([this.store.dispatch('carrier/fetchShipmentMethodTypes'), this.store.dispatch('util/fetchShipmentGatewayConfigs'), + await Promise.all([this.store.dispatch('carrier/fetchShipmentMethodTypes'), this.store.dispatch('util/fetchProductStores'), + this.store.dispatch('util/fetchShipmentGatewayConfigs'), this.store.dispatch('carrier/fetchCarrierShipmentMethods', {partyId: this.$route.params.partyId}), this.store.dispatch('carrier/fetchProductStoreShipmentMethods', {partyId: this.$route.params.partyId}), this.store.dispatch('util/fetchFacilities')]) @@ -201,6 +202,7 @@ ...mapGetters({ shipmentMethodQuery: 'carrier/getShipmentMethodQuery', currentCarrier: 'carrier/getCurrent', + productStores : 'util/getProductStores', shipmentMethods: "carrier/getShipmentMethods", carrierShipmentMethodsByProductStore: "carrier/getCarrierShipmentMethodsByProductStore", shipmentGatewayConfigs : "util/getShipmentGatewayConfigs" @@ -439,8 +441,6 @@ setup() { const store = useStore(); const router = useRouter(); - const userStore = useUserStore() - let productStores: any = computed(() => userStore.getProductStores) return { Actions, @@ -453,7 +453,6 @@ hasPermission, pricetagOutline, peopleOutline, - productStores, shieldCheckmarkOutline, showToast, store, From 336113e78f2b78e2868497b665b834d7a7255ff7 Mon Sep 17 00:00:00 2001 From: R-Sourabh <rsourabh002@gmail.com> Date: Wed, 18 Dec 2024 18:42:38 +0530 Subject: [PATCH 9/9] Improved: added one indentation and sequence change (#dxp/193) --- src/store/modules/util/actions.ts | 2 +- src/store/modules/util/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 898ba1e1..3e1f984c 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -486,7 +486,7 @@ const actions: ActionTree<UtilState, RootState> = { logger.error('Failed to fetch product stores', err) } commit(types.UTIL_PRODUCT_STORES_UPDATED, stores) - }, + }, async fetchShipmentGatewayConfigs({ commit }) { let configs = {}; diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index e3edf429..30aa7ca1 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -18,8 +18,8 @@ const utilModule: Module<UtilState, RootState> = { productStoreShipmentMethCount: 0, rejectReasonEnumTypes: [], enumerations: {}, - facilities: [], productStores: [], + facilities: [], shipmentGatewayConfigs: [], isForceScanEnabled: false, fulfillmentRejectReasons: {},