From 0322605b69c959ad4cc99fccba445326c17693a1 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 31 Jul 2024 18:43:06 +0530 Subject: [PATCH 1/4] Improved: code to show rejection reasons from db instead of hardcoding (#413) --- .env.example | 1 - src/components/RejectOrderModal.vue | 6 +++--- src/components/ReportAnIssueModal.vue | 6 +++--- src/store/modules/util/actions.ts | 5 +++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 4be8c233b..1d7991870 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,6 @@ VUE_APP_I18N_LOCALE=en-US VUE_APP_I18N_FALLBACK_LOCALE=en-US VUE_APP_CACHE_MAX_AGE=3600 VUE_APP_VIEW_SIZE=30 -VUE_APP_UNFILLABLE_REASONS=[{"id": "NO_VARIANCE_LOG", "label": "No reason"}, {"id": "NOT_IN_STOCK", "label": "Not in stock"}] VUE_APP_PRDT_IDENT_TYPE_ID=SHOPIFY_PROD_SKU VUE_APP_ORD_IDENT_TYPE_ID=SHOPIFY_ORD_NAME VUE_APP_BASE_URL= diff --git a/src/components/RejectOrderModal.vue b/src/components/RejectOrderModal.vue index fcfc1dc21..23ff36e99 100644 --- a/src/components/RejectOrderModal.vue +++ b/src/components/RejectOrderModal.vue @@ -16,8 +16,8 @@ {{ translate("Select reason") }} - - {{ translate(reason.label) }} + + {{ translate(reason.description ? reason.description : reason.enumId) }} @@ -73,7 +73,6 @@ export default defineComponent({ }, data() { return { - unfillableReasons: JSON.parse(process.env.VUE_APP_UNFILLABLE_REASONS), rejectReasonId: '' } }, @@ -81,6 +80,7 @@ export default defineComponent({ ...mapGetters({ order: "order/getCurrent", getProduct: 'product/getProduct', + rejectReasons: 'util/getRejectReasons', }) }, methods: { diff --git a/src/components/ReportAnIssueModal.vue b/src/components/ReportAnIssueModal.vue index ca2e81585..b30fa5dd7 100644 --- a/src/components/ReportAnIssueModal.vue +++ b/src/components/ReportAnIssueModal.vue @@ -16,8 +16,8 @@ {{ translate("Select reason") }} - - {{ translate(reason.label) }} + + {{ translate(reason.description ? reason.description : reason.enumId) }} @@ -75,7 +75,6 @@ export default defineComponent({ props: ['item'], data () { return { - unfillableReasons: JSON.parse(process.env.VUE_APP_UNFILLABLE_REASONS), rejectReasonId: '' } }, @@ -83,6 +82,7 @@ export default defineComponent({ ...mapGetters({ order: "order/getCurrent", getProduct: 'product/getProduct', + rejectReasons: 'util/getRejectReasons', }) }, methods: { diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 46284cdd5..25e3f9a5e 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -15,10 +15,11 @@ const actions: ActionTree = { "parentEnumTypeId": ["REPORT_AN_ISSUE", "RPRT_NO_VAR_LOG"], "parentEnumTypeId_op": "in" }, - "fieldList": ["enumId", "description"], + "fieldList": ["enumId", "enumName", "description"], "distinct": "Y", "entityName": "EnumTypeChildAndEnum", - "viewSize": 20 // keeping view size 20 as considering that we will have max 20 reasons + "viewSize": 20, // keeping view size 20 as considering that we will have max 20 reasons + "orderBy": "sequenceNum" } const resp = await UtilService.fetchRejectReasons(payload) From b0aee233948dae9540bf7938f9b963184c97b58d Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 31 Jul 2024 18:45:50 +0530 Subject: [PATCH 2/4] Reverted: unwanted change (#413) --- src/store/modules/util/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 25e3f9a5e..c5629362c 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -15,7 +15,7 @@ const actions: ActionTree = { "parentEnumTypeId": ["REPORT_AN_ISSUE", "RPRT_NO_VAR_LOG"], "parentEnumTypeId_op": "in" }, - "fieldList": ["enumId", "enumName", "description"], + "fieldList": ["enumId", "description"], "distinct": "Y", "entityName": "EnumTypeChildAndEnum", "viewSize": 20, // keeping view size 20 as considering that we will have max 20 reasons From e1c16dcd11deb9effbf987e9387090e7f4485b3a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 1 Aug 2024 11:12:49 +0530 Subject: [PATCH 3/4] Improved: removed the translation from the rejection reason description (#413) --- src/components/RejectOrderModal.vue | 2 +- src/components/ReportAnIssueModal.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/RejectOrderModal.vue b/src/components/RejectOrderModal.vue index 23ff36e99..a870f465d 100644 --- a/src/components/RejectOrderModal.vue +++ b/src/components/RejectOrderModal.vue @@ -17,7 +17,7 @@ {{ translate("Select reason") }} - {{ translate(reason.description ? reason.description : reason.enumId) }} + {{ reason.description ? reason.description : reason.enumId }} diff --git a/src/components/ReportAnIssueModal.vue b/src/components/ReportAnIssueModal.vue index b30fa5dd7..337a070ec 100644 --- a/src/components/ReportAnIssueModal.vue +++ b/src/components/ReportAnIssueModal.vue @@ -17,7 +17,7 @@ {{ translate("Select reason") }} - {{ translate(reason.description ? reason.description : reason.enumId) }} + {{ reason.description ? reason.description : reason.enumId }} From 49c588b6b9746f45b0975cdb7caf5de1ba8df3d1 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 1 Aug 2024 11:15:01 +0530 Subject: [PATCH 4/4] Reverted: unused entry in locale for translation (#413) --- src/locales/en.json | 3 --- src/locales/es.json | 2 -- src/locales/ja.json | 2 -- 3 files changed, 7 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index d5b94ff14..5e22253fe 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -75,10 +75,7 @@ "New notification received.": "New notification received.", "No items found": "No items found", "No inventory details found": "No inventory details found", - "Not in stock": "Not in stock", - "Not in Stock": "Not in Stock", "No products found": "No products found", - "No reason": "No reason", "No notifications to show": "No notifications to show", "No picker assigned.": "No picker assigned.", "No picker found": "No picker found", diff --git a/src/locales/es.json b/src/locales/es.json index 552436564..36b61da73 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -72,9 +72,7 @@ "New notification received.": "Nueva notificación recibida.", "No items found": "No se encontraron artículos", "No inventory details found": "No se encontraron detalles de inventario", - "Not in stock": "No disponible en el inventario", "No products found": "No se encontraron productos", - "No reason": "Sin razón", "No notifications to show": "No hay notificaciones para mostrar", "No picker assigned.": "No hay recolector asignado.", "No picker found": "No se encontró recolector", diff --git a/src/locales/ja.json b/src/locales/ja.json index d2bc92d17..dffd6aad7 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -72,9 +72,7 @@ "New notification received.": "新しい通知を受信しました。", "No items found": "アイテムが見つかりませんでした", "No inventory details found": "在庫の詳細が見つかりません", - "Not in Stock": "在庫切れ", "No products found": "商品が見つかりません", - "No reason": "理由なし", "No notifications to show": "表示する通知はありません", "No picker assigned.": "ピッカーが割り当てられていません。", "No picker found": "受取人が見つかりません",