From 7d527579bc8430628ba71edb5a29db05852799f8 Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 14:57:13 +0530 Subject: [PATCH 1/5] Improved: code by replacing div tag with template tag when used for v-if --- src/components/AddStaffMemberModal.vue | 28 +++++++++++++------------- src/views/AddFacilityConfig.vue | 4 ++-- src/views/FacilityDetails.vue | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/components/AddStaffMemberModal.vue b/src/components/AddStaffMemberModal.vue index 09ab95b9..5414ec77 100644 --- a/src/components/AddStaffMemberModal.vue +++ b/src/components/AddStaffMemberModal.vue @@ -19,20 +19,20 @@ - +
+ {{ translate("No party found") }} +
+ {{ translate("Staff") }} -
{{ translate("No party found") }}
-
- - - {{ party.fullName }} -

{{ party.partyId }}

-
- - {{ description }} - -
-
+ + + {{ party.fullName }} +

{{ party.partyId }}

+
+ + {{ description }} + +
@@ -100,7 +100,7 @@ export default defineComponent({ props: ['facilityId', 'selectedParties'], data() { return { - parties: [], + parties: [] as any, queryString: '', selectedPartyValues: JSON.parse(JSON.stringify(this.selectedParties)) } diff --git a/src/views/AddFacilityConfig.vue b/src/views/AddFacilityConfig.vue index 2bc79c0a..c47604f1 100644 --- a/src/views/AddFacilityConfig.vue +++ b/src/views/AddFacilityConfig.vue @@ -18,7 +18,7 @@ {{ translate("Add") }} -
+

{{ translate("No product stores added.") }}

diff --git a/src/views/FacilityDetails.vue b/src/views/FacilityDetails.vue index 71d4a024..ccb086af 100644 --- a/src/views/FacilityDetails.vue +++ b/src/views/FacilityDetails.vue @@ -23,7 +23,7 @@ {{ translate("Address") }} -
+ {{ translate("Add") }} @@ -46,7 +46,7 @@ {{ translate("Latitude & Longitude") }} -
+ {{ translate("Add") }} From 5a8991cadd44a7e2a18fcda658002d68b7c32cc5 Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 14:58:55 +0530 Subject: [PATCH 2/5] Improved: used warehouse type icon for facilities with warehouse type facility type ID --- src/views/FindFacilities.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue index 76f0db59..152a81f8 100644 --- a/src/views/FindFacilities.vue +++ b/src/views/FindFacilities.vue @@ -46,7 +46,7 @@
- +

{{ facility.facilityTypeId ? facilityTypes[facility.facilityTypeId] ? facilityTypes[facility.facilityTypeId].description : facilityTypes.facilityTypeId : '' }}

{{ facility.facilityName }} From 4b60e023a33770c64de6e09e1d4b297d8700e9a3 Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 15:03:29 +0530 Subject: [PATCH 3/5] Improved: updated app view size to 20 --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 2d1de397..a0a75169 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ VUE_APP_I18N_LOCALE=en-US VUE_APP_I18N_FALLBACK_LOCALE=en-US VUE_APP_CACHE_MAX_AGE=3600 -VUE_APP_VIEW_SIZE=10 +VUE_APP_VIEW_SIZE=20 VUE_APP_BASE_URL= VUE_APP_PERMISSION_ID= VUE_APP_LOCALES={"en-US": "English"} From 57339b53553f8254ed45aae8512a898cfc6a6bef Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 15:10:30 +0530 Subject: [PATCH 4/5] Improved: varible naming in updation logic --- src/views/FindFacilities.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue index 152a81f8..5801b9a9 100644 --- a/src/views/FindFacilities.vue +++ b/src/views/FindFacilities.vue @@ -252,12 +252,12 @@ export default defineComponent({ if (!hasError(resp)) { // updating the facilities state instead of refetching - const updatedFacilities = JSON.parse(JSON.stringify(this.facilities)).map((fac: any) => { - if (facility.facilityId === fac.facilityId) { - fac.maximumOrderLimit = maximumOrderLimit === "" ? null : maximumOrderLimit - fac.orderLimitType = fac.maximumOrderLimit === null ? 'unlimited' : (fac.maximumOrderLimit === 0 ? 'no-capacity' : 'custom') + const updatedFacilities = JSON.parse(JSON.stringify(this.facilities)).map((facilityData: any) => { + if (facility.facilityId === facilityData.facilityId) { + facilityData.maximumOrderLimit = maximumOrderLimit === "" ? null : maximumOrderLimit + facilityData.orderLimitType = facilityData.maximumOrderLimit === null ? 'unlimited' : (facilityData.maximumOrderLimit === 0 ? 'no-capacity' : 'custom') } - return fac + return facilityData }) this.store.dispatch('facility/updateFacilities', updatedFacilities) showToast(translate('Fulfillment capacity updated successfully for ', { facilityName: facility.facilityName })) @@ -289,11 +289,11 @@ export default defineComponent({ if (!hasError(resp)) { // updating the facilities state instead of refetching - const updatedFacilities = JSON.parse(JSON.stringify(this.facilities)).map((fac: any) => { - if (facility.facilityId === fac.facilityId) { - fac.sellOnline = !facility.sellOnline + const updatedFacilities = JSON.parse(JSON.stringify(this.facilities)).map((facilityData: any) => { + if (facility.facilityId === facilityData.facilityId) { + facilityData.sellOnline = !facility.sellOnline } - return fac + return facilityData }) this.store.dispatch('facility/updateFacilities', updatedFacilities) showToast(translate('Fulfillment setting updated successfully')) From 05d57bfca90c4cbee811f7b0c7542e01cb8c3cac Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 15:27:34 +0530 Subject: [PATCH 5/5] Fixed: facility not removed from state if no record is fetched --- src/store/modules/facility/actions.ts | 4 +++- src/store/modules/facility/mutation-types.ts | 1 - src/store/modules/facility/mutations.ts | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/store/modules/facility/actions.ts b/src/store/modules/facility/actions.ts index 5eb1dd97..cba17a13 100644 --- a/src/store/modules/facility/actions.ts +++ b/src/store/modules/facility/actions.ts @@ -264,6 +264,7 @@ const actions: ActionTree = { }, async fetchFacilityLocations({ commit }, payload) { + let facilityLocations = [] try { const params = { inputFields: { @@ -277,13 +278,14 @@ const actions: ActionTree = { const resp = await FacilityService.fetchFacilityLocations(params) if(!hasError(resp) && resp.data.count > 0) { - commit(types.FACILITY_LOCATIONS_UPDATED, resp.data.docs) + facilityLocations = resp.data.docs } else { throw resp.data } } catch(err) { logger.error('Failed to find the facility locations', err) } + commit(types.FACILITY_LOCATIONS_UPDATED, facilityLocations) }, async fetchFacilityCalendar({commit}, payload) { diff --git a/src/store/modules/facility/mutation-types.ts b/src/store/modules/facility/mutation-types.ts index 864d31bf..aa9d96cc 100644 --- a/src/store/modules/facility/mutation-types.ts +++ b/src/store/modules/facility/mutation-types.ts @@ -2,7 +2,6 @@ export const SN_FACILITY = 'facility' export const FACILITY_LIST_UPDATED = SN_FACILITY + '/LIST_UPDATED' export const FACILITY_QUERY_UPDATED = SN_FACILITY + '/QUERY_UPDATED' export const FACILITY_CURRENT_UPDATED = SN_FACILITY + '/CURRENT_UPDATED' -export const FACILITY_CURRENT_LOCATION_UPDATED = SN_FACILITY + '/CURRENT_LOCATION_UPDATED' export const FACILITY_LOCATIONS_UPDATED = SN_FACILITY + '/LOCATIONS_UPDATED' export const FACILITY_POSTAL_ADDRESS_UPDATED = SN_FACILITY + '/POSTAL_ADDRESS_UPDATED' export const FACILITY_MAPPINGS_UPDATED = SN_FACILITY + '/MAPPINGS_UPDATED' diff --git a/src/store/modules/facility/mutations.ts b/src/store/modules/facility/mutations.ts index 12a86eef..54549eb6 100644 --- a/src/store/modules/facility/mutations.ts +++ b/src/store/modules/facility/mutations.ts @@ -16,9 +16,6 @@ const mutations: MutationTree = { [types.FACILITY_CURRENT_UPDATED](state, payload) { state.current = payload }, - [types.FACILITY_CURRENT_LOCATION_UPDATED](state, payload) { - state.current.locations = payload - }, [types.FACILITY_POSTAL_ADDRESS_UPDATED](state, payload) { state.current.postalAddress = payload },