Skip to content

Commit

Permalink
Merge pull request #414 from amansinghbais/#413
Browse files Browse the repository at this point in the history
Improved: code to show rejection reasons from db instead of hardcoding (#413)
  • Loading branch information
ravilodhi authored Aug 2, 2024
2 parents 586ea45 + 49c588b commit ce7cec8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions src/components/RejectOrderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<ion-list>
<ion-list-header>{{ translate("Select reason") }}</ion-list-header>
<ion-radio-group v-model="rejectReasonId">
<ion-item v-for="reason in unfillableReasons" :key="reason.id">
<ion-radio :value="reason.id" label-placement="end" justify="start">{{ translate(reason.label) }}</ion-radio>
<ion-item v-for="reason in rejectReasons" :key="reason.enumId">
<ion-radio :value="reason.enumId" label-placement="end" justify="start">{{ reason.description ? reason.description : reason.enumId }}</ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
Expand Down Expand Up @@ -73,14 +73,14 @@ export default defineComponent({
},
data() {
return {
unfillableReasons: JSON.parse(process.env.VUE_APP_UNFILLABLE_REASONS),
rejectReasonId: ''
}
},
computed: {
...mapGetters({
order: "order/getCurrent",
getProduct: 'product/getProduct',
rejectReasons: 'util/getRejectReasons',
})
},
methods: {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ReportAnIssueModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<ion-list>
<ion-list-header>{{ translate("Select reason") }}</ion-list-header>
<ion-radio-group v-model="rejectReasonId">
<ion-item v-for="reason in unfillableReasons" :key="reason.id">
<ion-radio label-placement="end" justify="start" :value="reason.id">{{ translate(reason.label) }}</ion-radio>
<ion-item v-for="reason in rejectReasons" :key="reason.enumId">
<ion-radio label-placement="end" justify="start" :value="reason.enumId">{{ reason.description ? reason.description : reason.enumId }}</ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
Expand Down Expand Up @@ -75,14 +75,14 @@ export default defineComponent({
props: ['item'],
data () {
return {
unfillableReasons: JSON.parse(process.env.VUE_APP_UNFILLABLE_REASONS),
rejectReasonId: ''
}
},
computed: {
...mapGetters({
order: "order/getCurrent",
getProduct: 'product/getProduct',
rejectReasons: 'util/getRejectReasons',
})
},
methods: {
Expand Down
3 changes: 0 additions & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "受取人が見つかりません",
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const actions: ActionTree<UtilState, RootState> = {
"fieldList": ["enumId", "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)
Expand Down

0 comments on commit ce7cec8

Please sign in to comment.