Skip to content

Commit

Permalink
Improved: added permission over the force scan setting (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais authored and ravilodhi committed Aug 5, 2024
1 parent 13a355c commit 7f54ae5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/authorization/Actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export default {
"APP_TRANSFER_ORDER_UPDATE":"APP_TRANSFER_ORDER_UPDATE",
"APP_CARRIERS_VIEW" : "APP_CARRIERS_VIEW",
"APP_CARRIERS_CREATE" : "APP_CARRIERS_CREATE",
"APP_ORDER_LOOKUP_VIEW": "APP_ORDER_LOOKUP_VIEW"
"APP_ORDER_LOOKUP_VIEW": "APP_ORDER_LOOKUP_VIEW",
"APP_UPDT_FULFILL_FORCE_SCAN_CONFIG": "APP_UPDT_FULFILL_FORCE_SCAN_CONFIG",
}
3 changes: 2 additions & 1 deletion src/authorization/Rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export default {
"APP_TRANSFER_ORDER_UPDATE": "ORD_TRANSFER_ORDER_CREATE OR ORD_TRANSFER_ORDER_ADMIN",
"APP_CARRIERS_VIEW": "CARRIER_SETUP_VIEW",
"APP_CARRIERS_CREATE": "CARRIER_SETUP_VIEW",
"APP_ORDER_LOOKUP_VIEW": "FF_ORDER_LOOKUP_VIEW"
"APP_ORDER_LOOKUP_VIEW": "FF_ORDER_LOOKUP_VIEW",
"APP_UPDT_FULFILL_FORCE_SCAN_CONFIG": "COMMON_ADMIN"
} as any
6 changes: 3 additions & 3 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ const actions: ActionTree<UtilState, RootState> = {
try {
const resp = await UtilService.getProductStoreSetting(payload) as any
if(!hasError(resp)) {
const respValue = resp.data.docs[0].settingValue
const respValue = resp.data.docs[0].settingValue === "true"
commit(types.UTIL_FORCE_SCAN_STATUS_UPDATED, respValue)
} else {
dispatch('createForceScanSetting');
Expand All @@ -498,7 +498,7 @@ const actions: ActionTree<UtilState, RootState> = {
fromDate,
"productStoreId": ecomStore.productStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN",
"settingValue": false
"settingValue": "false"
}

try {
Expand Down Expand Up @@ -552,7 +552,7 @@ const actions: ActionTree<UtilState, RootState> = {
"fromDate": fromDate,
"productStoreId": eComStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN",
"settingValue": value
"settingValue": `${value}`
}

try {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<ion-card-content>
{{ translate("Control whether the store requires the force scan during order packing or not.") }}
</ion-card-content>
<ion-item lines="none" >
<ion-item lines="none" :disabled="!hasPermission(Actions.APP_UPDT_FULFILL_FORCE_SCAN_CONFIG)">
<ion-toggle label-placement="start" :checked="isForceScanEnabled" @click.prevent="updateForceScanStatus($event)">{{ translate("Require scan") }}</ion-toggle>
</ion-item>
</ion-card>
Expand Down

0 comments on commit 7f54ae5

Please sign in to comment.