From efcf45ff578ac138636991d6d93fc3420ee1d64a Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 16:43:48 +0530 Subject: [PATCH 1/7] Fixed: facility setting not disabling if only single record is enabled --- src/store/modules/facility/actions.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/store/modules/facility/actions.ts b/src/store/modules/facility/actions.ts index cba17a13..8c2fbf93 100644 --- a/src/store/modules/facility/actions.ts +++ b/src/store/modules/facility/actions.ts @@ -136,13 +136,18 @@ const actions: ActionTree = { facility.orderCount = facilityOrderCount[facility.facilityId] ? facilityOrderCount[facility.facilityId] : 0; const facilityGroupInfo = facilityGroupInformation[facility.facilityId] - - if(facilityGroupInfo.length) { + if (facilityGroupInfo?.length) { facility.groupInformation = facilityGroupInfo facility.sellOnline = (facilityGroupInfo.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'FAC_GRP')) facility.useOMSFulfillment = (facilityGroupInfo.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'OMS_FULFILLMENT')) facility.generateShippingLabel = (facilityGroupInfo.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'AUTO_SHIPPING_LABEL')) facility.allowPickup = (facilityGroupInfo.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'PICKUP')) + } else { + facility.groupInformation = [] + facility.sellOnline = false + facility.useOMSFulfillment = false + facility.generateShippingLabel = false + facility.allowPickup = false } commit(types.FACILITY_CURRENT_UPDATED, facility) From 21e8288e78c523e58f32d121c851a2e40738c77b Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 18:01:29 +0530 Subject: [PATCH 2/7] Improved: toast message for sell online config update on find page --- src/locales/en.json | 3 ++- src/views/FindFacilities.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 5cd4f7b9..2686c176 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -150,6 +150,8 @@ "OMS": "OMS", "OMS instance": "OMS instance", "Online Order Fulfillment": "Online Order Fulfillment", + "Online inventory turned on for": "Online inventory turned on for {facilityName}", + "Online inventory turned off for": "Online inventory turned off for {facilityName}", "Open and close time": "Open and close time", "Opening Time": "Opening Time", "Operating hours": "Operating hours", @@ -182,7 +184,6 @@ "Reset": "Reset", "Role": "Role", "role": "role", - "Role(s) updated successfully.": "Role(s) updated successfully.", "Saturday": "Saturday", "Save": "Save", "Save address": "Save address", diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue index 5801b9a9..4857919c 100644 --- a/src/views/FindFacilities.vue +++ b/src/views/FindFacilities.vue @@ -296,7 +296,7 @@ export default defineComponent({ return facilityData }) this.store.dispatch('facility/updateFacilities', updatedFacilities) - showToast(translate('Fulfillment setting updated successfully')) + showToast(translate(`Online inventory turned ${facility.sellOnline ? 'off' : 'on'} for`, { facilityName: facility.facilityName })) } else { throw resp.data } From 8fda13206f50ce36ab3c831703a37ca58c1f867b Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 18:02:24 +0530 Subject: [PATCH 3/7] Improved: shown spinner on generate button in geo point modal while generating lat long --- src/components/FacilityGeoPointModal.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/FacilityGeoPointModal.vue b/src/components/FacilityGeoPointModal.vue index 5734a632..d8b997e5 100644 --- a/src/components/FacilityGeoPointModal.vue +++ b/src/components/FacilityGeoPointModal.vue @@ -16,7 +16,8 @@ {{ translate("Generate") }} - + + @@ -49,6 +50,7 @@ import { IonInput, IonItem, IonLabel, + IonSpinner, IonTitle, IonToolbar, modalController @@ -76,6 +78,7 @@ export default defineComponent({ IonInput, IonItem, IonLabel, + IonSpinner, IonTitle, IonToolbar, }, @@ -87,7 +90,8 @@ export default defineComponent({ props: ['facilityId'], data() { return { - geoPoint: {} as any + geoPoint: {} as any, + isGeneratingLatLong: false } }, beforeMount() { @@ -98,6 +102,7 @@ export default defineComponent({ modalController.dismiss() }, async generateLatLong() { + this.isGeneratingLatLong = true const payload = { json: { params: { @@ -120,6 +125,7 @@ export default defineComponent({ showToast(translate("Failed to generate latitude & Longitude.")) logger.error(err) } + this.isGeneratingLatLong = false }, async saveGeoPoint() { if(!this.geoPoint.latitude || !this.geoPoint.longitude || !this.geoPoint.postalCode) { @@ -157,4 +163,10 @@ export default defineComponent({ }; }, }); - \ No newline at end of file + + + \ No newline at end of file From 421f8d643e55c598aee404ddde4eccc628da93ec Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 19:05:00 +0530 Subject: [PATCH 4/7] Improved: bound create login user setting to native fulfilment setting while creating facilitty and improved setting ordering --- src/views/AddFacilityConfig.vue | 53 +++++++++++++++++++-------------- src/views/FacilityDetails.vue | 8 ++--- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/views/AddFacilityConfig.vue b/src/views/AddFacilityConfig.vue index c47604f1..b812fbb2 100644 --- a/src/views/AddFacilityConfig.vue +++ b/src/views/AddFacilityConfig.vue @@ -64,29 +64,39 @@ {{ translate("Sell Inventory Online") }} - - - - {{ translate("Uses native fulfillment app") }} - + {{ translate("Allow pickup") }} - + - {{ translate("Create login credentials") }} - - - - - {{ translate('Password') }} * - - - - {{ translate('Password should be at least 5 characters long, it contains at least one number, one alphabet and one special character.') }} - + {{ translate("Uses native fulfillment app") }} + + @@ -190,6 +200,7 @@ export default defineComponent({ } as any, createLoginCreds: false as any, password: '', + username: '', selectedProductStores: [] as any, primaryProductStoreId: '' } @@ -198,13 +209,9 @@ export default defineComponent({ async ionViewWillEnter() { await this.store.dispatch('facility/fetchCurrentFacility', { facilityId: this.facilityId }) await this.store.dispatch('util/fetchProductStores') + this.username = this.current.facilityName }, methods: { - async updateFulfillmentSettings(event: any, facilityGroupId: string) { - // Using `not` as the click event returns the current status of toggle, - // but on click we want to change the toggle status - this.fulfillmentSettings[facilityGroupId] = !event.target.checked - }, async saveFulfillmentSettings() { const responses = [] if (this.fulfillmentSettings.PICKUP) { @@ -239,7 +246,7 @@ export default defineComponent({ async createFacilityUser() { try { const payload = { - "groupName": this.current.facilityName, + "groupName": this.username, "facilityId": this.facilityId, "loginPassword": this.password, "partyTypeId": "PARTY_GROUP", diff --git a/src/views/FacilityDetails.vue b/src/views/FacilityDetails.vue index ccb086af..8b1ab458 100644 --- a/src/views/FacilityDetails.vue +++ b/src/views/FacilityDetails.vue @@ -189,6 +189,10 @@ {{ translate("Sell Inventory Online") }} + + {{ translate("Allow pickup") }} + + {{ translate("Uses native fulfillment app") }} @@ -197,10 +201,6 @@ {{ translate("Generate shipping labels") }} - - {{ translate("Allow pickup") }} - - {{ translate("Days to ship") }} From 657bc17fd4e3f88ac6569a708f5788dfa0fac7d1 Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 19:19:56 +0530 Subject: [PATCH 5/7] Implemented: support to disallow facility creation if facility ID is more than 20 characters --- src/locales/en.json | 1 + src/views/CreateFacility.vue | 30 +++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 18f2b736..f708d0f3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -118,6 +118,7 @@ "Groups": "Groups", "Identification": "Identification", "Internal ID": "Internal ID", + "Internal ID cannot be more than 20 characters.": "Internal ID cannot be more than 20 characters.", "Instance Url": "Instance Url", "Language": "Language", "Latitude": "Latitude", diff --git a/src/views/CreateFacility.vue b/src/views/CreateFacility.vue index 0879ae5e..640a7729 100644 --- a/src/views/CreateFacility.vue +++ b/src/views/CreateFacility.vue @@ -27,11 +27,14 @@ - + {{ translate('Internal ID') }} - + + + {{ translate('Internal ID cannot be more than 20 characters.') }} + @@ -67,6 +70,7 @@ import { IonItem, IonLabel, IonList, + IonNote, IonPage, IonText, IonTitle, @@ -97,6 +101,7 @@ export default defineComponent({ IonItem, IonLabel, IonList, + IonNote, IonPage, IonText, IonTitle, @@ -149,6 +154,11 @@ export default defineComponent({ return } + if (this.formData.facilityId.length > 20) { + showToast(translate('Internal ID cannot be more than 20 characters.')) + return + } + // In case the user does not lose focus from the facility name input // and click on create the button, we need to set the internal id manually if (!this.formData.facilityId) { @@ -193,7 +203,21 @@ export default defineComponent({ } return facilityTypesByParentTypeId }, {}) : this.facilityTypes - } + }, + validateFacilityId(event: any) { + const value = event.target.value; + (this as any).$refs.facilityId.$el.classList.remove('ion-valid'); + (this as any).$refs.facilityId.$el.classList.remove('ion-invalid'); + + if (value === '') return; + + this.formData.facilityId.length <= 20 + ? (this as any).$refs.facilityId.$el.classList.add('ion-valid') + : (this as any).$refs.facilityId.$el.classList.add('ion-invalid'); + }, + markFacilityIdTouched() { + (this as any).$refs.facilityId.$el.classList.add('ion-touched'); + }, }, setup() { const store = useStore(); From ea455116046bdf1966a95d72281d928325ba2f6e Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 19:24:32 +0530 Subject: [PATCH 6/7] Improved: added check for username while creating facility user --- src/locales/en.json | 1 + src/views/AddFacilityConfig.vue | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index f708d0f3..f654de65 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -247,6 +247,7 @@ "Unlink": "Unlink", "Update days to ship": "Update days to ship", "Username": "Username", + "Username is required.": "Username is required.", "Uses native fulfillment app": "Uses native fulfillment app", "Version: ": "Version: { appVersion }", "View order count history": "View order count history", diff --git a/src/views/AddFacilityConfig.vue b/src/views/AddFacilityConfig.vue index b812fbb2..55ddf1df 100644 --- a/src/views/AddFacilityConfig.vue +++ b/src/views/AddFacilityConfig.vue @@ -244,6 +244,10 @@ export default defineComponent({ } }, async createFacilityUser() { + if (!this.username) { + showToast(translate('Username is required.')) + return + } try { const payload = { "groupName": this.username, From 27f73ea278e7ec6bcd4806406fd61050f6e4c780 Mon Sep 17 00:00:00 2001 From: k2maan Date: Thu, 30 Nov 2023 19:27:52 +0530 Subject: [PATCH 7/7] Fixed: formatting in en.json --- src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index f654de65..98d20039 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -255,4 +255,4 @@ "Wednesday": "Wednesday", "Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu.", "Zipcode": "Zipcode" - } \ No newline at end of file +} \ No newline at end of file