From 42085479821ba159c94a32fdae48394e97632874 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 11:00:45 +0530 Subject: [PATCH 001/103] Implemented: UI for adding facility to group popover and view facilities functionality(#152) --- src/components/AddFacilityActionsPopover.vue | 65 ++++++++++++++++++++ src/locales/en.json | 3 + src/views/FindGroups.vue | 26 +++++--- 3 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 src/components/AddFacilityActionsPopover.vue diff --git a/src/components/AddFacilityActionsPopover.vue b/src/components/AddFacilityActionsPopover.vue new file mode 100644 index 00000000..52ebdc33 --- /dev/null +++ b/src/components/AddFacilityActionsPopover.vue @@ -0,0 +1,65 @@ + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 17e06c03..d1a55457 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -66,6 +66,7 @@ "Description": "Description", "Dismiss": "Dismiss", "Distribution Center": "Distribution Center", + "Edit description": "Edit description", "Failed to associate calendar to the facility.": "Failed to associate calendar to the facility.", "Filters": "Filters", "Edit": "Edit", @@ -255,6 +256,7 @@ "Product Store": "Product Store", "Product Stores": "Product Stores", "Product stores updated successfully.": "Product stores updated successfully.", + "Quick edit": "Quick edit", "Reason:": "Reason:", "Regenerate": "Regenerate", "Remove": "Remove", @@ -350,6 +352,7 @@ "Uses native fulfillment app": "Uses native fulfillment app", "Version: ": "Version: { appVersion }", "View details": "View details", + "View facilities": "View facilities", "View order count history": "View order count history", "View other schedules": "View other schedules", "Warehouses": "Warehouses", diff --git a/src/views/FindGroups.vue b/src/views/FindGroups.vue index b0f7a48b..df75fc03 100644 --- a/src/views/FindGroups.vue +++ b/src/views/FindGroups.vue @@ -41,9 +41,11 @@ - + {{ translate('Facilities') }} - {{ group.facilityCount }} + + {{ group.facilityCount }} + {{ group.description }} @@ -81,6 +83,7 @@ import { IonBackButton, IonBadge, IonCard, + IonChip, IonContent, IonHeader, IonIcon, @@ -90,7 +93,6 @@ import { IonLabel, IonList, IonListHeader, - IonNote, IonPage, IonSearchbar, IonSelect, @@ -112,6 +114,7 @@ import { FacilityService } from '@/services/FacilityService'; import { hasError } from '@/adapter'; import logger from '@/logger'; import emitter from '@/event-bus'; +import AddFacilityActionsPopover from '@/components/AddFacilityActionsPopover.vue'; export default defineComponent({ name: 'FindGroups', @@ -120,6 +123,7 @@ export default defineComponent({ IonBackButton, IonBadge, IonCard, + IonChip, IonContent, IonHeader, IonIcon, @@ -129,7 +133,6 @@ export default defineComponent({ IonLabel, IonList, IonListHeader, - IonNote, IonPage, IonSearchbar, IonSelect, @@ -143,7 +146,6 @@ export default defineComponent({ facilityGroupTypes: "util/getFacilityGroupTypes", isScrollable: "facility/isFacilityGroupsScrollable", query: "facility/getGroupQuery", - facilityQuery: "facility/getFacilityQuery", }) }, async mounted() { @@ -155,10 +157,6 @@ export default defineComponent({ await this.store.dispatch('facility/updateGroupQuery', this.query) this.fetchGroups(); }, - async viewFacilities(facilityGroupId: string) { - await this.store.dispatch('facility/updateFacilityQuery', {...this.facilityQuery, facilityGroupId }) - this.$router.push({ path: `/find-facilities`}) - }, async fetchGroups(vSize?: any, vIndex?: any) { const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; const viewIndex = vIndex ? vIndex : 0; @@ -223,6 +221,16 @@ export default defineComponent({ } } }, + async openAddFacilityActionsPopover(event: Event, group: any) { + const addFacilityActionsPopover = await popoverController.create({ + component: AddFacilityActionsPopover, + event, + showBackdrop: false, + componentProps: { group } + }); + + addFacilityActionsPopover.present(); + }, getAssociatedFacilityGroupIds(facilityGroupTypeId: any) { const associatedfacilityGroupIds = [] as any From 192de7e0d633a76903378d6d322431a690009696 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 12:43:26 +0530 Subject: [PATCH 002/103] Implemented: modal for facility selection for associating to group (#152) --- src/components/AddFacilityActionsPopover.vue | 17 +- src/components/AddFacilityToGroupModal.vue | 212 +++++++++++++++++++ src/locales/en.json | 2 + src/services/FacilityService.ts | 9 +- 4 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 src/components/AddFacilityToGroupModal.vue diff --git a/src/components/AddFacilityActionsPopover.vue b/src/components/AddFacilityActionsPopover.vue index 52ebdc33..659504d0 100644 --- a/src/components/AddFacilityActionsPopover.vue +++ b/src/components/AddFacilityActionsPopover.vue @@ -8,7 +8,7 @@ {{ translate("View facilities") }} - + {{ translate("Quick edit") }} @@ -22,15 +22,17 @@ import { IonItem, IonList, IonListHeader, + modalController, popoverController } from "@ionic/vue"; import { defineComponent } from "vue"; import { translate } from '@hotwax/dxp-components' import { mapGetters, useStore } from "vuex"; import { openOutline } from 'ionicons/icons' +import AddFacilityToGroupsModal from '@/components/AddFacilityToGroupModal.vue' export default defineComponent({ - name: "FacilityGroupActionsPopover", + name: "AddFacilityActionsPopover", components: { IonContent, IonIcon, @@ -51,6 +53,17 @@ export default defineComponent({ this.$router.push({ path: `/find-facilities` }) popoverController.dismiss() }, + async openAddFacilityToGroupsModal(group: any) { + const modal = await modalController.create({ + component: AddFacilityToGroupsModal, + componentProps: { group } + }) + + modal.onDidDismiss().then(() =>{ + popoverController.dismiss() + }) + modal.present() + }, }, setup() { const store = useStore(); diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue new file mode 100644 index 00000000..70295ea1 --- /dev/null +++ b/src/components/AddFacilityToGroupModal.vue @@ -0,0 +1,212 @@ + + + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index d1a55457..a1985450 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -206,6 +206,7 @@ "No capacity": "No capacity", "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.": "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.", "No facilities found": "No facilities found", + "No facility found": "No facility found", "No fulfillment capacity": "No fulfillment capacity", "No groups found": "No groups found", "No party found": "No party found", @@ -287,6 +288,7 @@ "Select country": "Select country", "Select state": "Select state", "Search facilities": "Search facilities", + "Select facilities": "Select facilities", "Search groups": "Search groups", "Search time zones": "Search time zones", "Select time zone": "Select time zone", diff --git a/src/services/FacilityService.ts b/src/services/FacilityService.ts index 3749348f..bf5f2029 100644 --- a/src/services/FacilityService.ts +++ b/src/services/FacilityService.ts @@ -693,7 +693,13 @@ const createFacilityLogin = async (payload: any): Promise => { } } - +const fetchAssociatedFacilitiesToGroup = async (payload: any): Promise => { + return api({ + url: "performFind", + method: "post", + data: payload + }) +} export const FacilityService = { addFacilityToGroup, @@ -714,6 +720,7 @@ export const FacilityService = { createFacilityLogin, deleteShopifyShopLocation, fetchArchivedFacilities, + fetchAssociatedFacilitiesToGroup, fetchFacilityGroup, fetchFacilityGroups, fetchFacilityLocations, From dbf936f3b2fc0fc7e8cdc0fb2a663a1b1d0c2200 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 15:12:50 +0530 Subject: [PATCH 003/103] Implemented: api logic to associate and remove facilites to a group (#152) --- src/components/AddFacilityToGroupModal.vue | 72 ++++++++++++++++------ src/locales/en.json | 2 + 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index 70295ea1..3698c293 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -66,6 +66,8 @@ import { hasError } from "@/adapter"; import logger from "@/logger" import { translate } from '@hotwax/dxp-components' import { FacilityService } from "@/services/FacilityService"; +import { DateTime } from "luxon"; +import { showToast } from "@/utils"; export default defineComponent({ name: "EditPickersModal", @@ -91,8 +93,10 @@ export default defineComponent({ return { queryString: '', facilities: [] as any, - associatedFacilityIds: [], - associatedFacilityIdValues: [] as any + associatedFacilityIds: [] as any, + associatedFacilityIdValues: [] as any, + selectedFacilities: [] as any, + selectedFacilityValues: [] as any } }, props: ['group'], @@ -129,7 +133,7 @@ export default defineComponent({ "fromDateName": "facilityGroupFromDate", "thruDateName": "facilityGroupThruDate", "filterByDate": "Y", - "fieldList": ["facilityId", "facilityName", "facilityTypeId", "maximumOrderLimit", "defaultDaysToShip", "externalId", "primaryFacilityGroupId", "parentFacilityTypeId"], + "fieldList": ["facilityId", "facilityName", "fromDate"], "viewSize": 20 } @@ -146,8 +150,6 @@ export default defineComponent({ } }, async fetchAssociatedFacilities() { - let associatedFacilityIds = [] as any - try { const resp = await FacilityService.fetchAssociatedFacilitiesToGroup({ inputFields: { @@ -157,13 +159,12 @@ export default defineComponent({ entityName: 'FacilityGroupAndMember', noConditionFind: "Y", filterByDate: 'Y', - fieldList: ['facilityId'] + fieldList: ['facilityId', 'fromDate'] }) if(!hasError(resp)) { - resp.data.docs.map((facility: any) => associatedFacilityIds.push(facility.facilityId)) - this.associatedFacilityIds = associatedFacilityIds - this.associatedFacilityIdValues = JSON.parse(JSON.stringify(associatedFacilityIds)) + this.selectedFacilities = resp.data.docs + this.selectedFacilityValues = JSON.parse(JSON.stringify(resp.data.docs)) } else { throw resp.data } @@ -173,24 +174,55 @@ export default defineComponent({ }, updateSelectedFacilities(id: string) { const facility = this.isFacilitySelected(id) + if (facility) { // if facility is already selected then removing that facility from the list on click - this.associatedFacilityIdValues.pop(id) + this.selectedFacilityValues = this.selectedFacilityValues.filter((facility: any) => facility.facilityId !== id) } else { - this.associatedFacilityIdValues.push(id) + this.selectedFacilityValues.push(this.facilities.find((facility: any) => facility.facilityId == id)) } }, isFacilitySelected(facilityId: any) { - return this.associatedFacilityIdValues.includes(facilityId) + return this.selectedFacilityValues.some((facility: any) => facility.facilityId === facilityId) + }, + async confirmSave() { + const facilitiesToAdd = this.selectedFacilityValues.filter((selectedFacility: any) => !this.selectedFacilities.some((facility: any) => facility.facilityId === selectedFacility.facilityId)) + const facilitiesToRemove = this.selectedFacilities.filter((facility: any) => !this.selectedFacilityValues.some((selectedFacility: any) => facility.facilityId === selectedFacility.facilityId)) + + const removeResponses = await Promise.allSettled(facilitiesToRemove + .map(async (facility: any) => await FacilityService.updateFacilityToGroup({ + facilityId: facility.facilityId, + "facilityGroupId": this.group.facilityGroupId, + "fromDate": facility.fromDate, + "thruDate": DateTime.now().toMillis() + })) + ) + + const addResponses = await Promise.allSettled(facilitiesToAdd + .map(async (facility: any) => await FacilityService.addFacilityToGroup({ + facilityId: facility.facilityId, + "facilityGroupId": this.group.facilityGroupId + })) + ) + + const hasFailedResponse = [...removeResponses, ...addResponses].some((response: any) => response.status === 'rejected') + if (hasFailedResponse) { + showToast(translate("Failed to associate some facilites to group.")) + } else { + showToast(translate("Facilities associated to group successfully.")) + } + this.fetchGroups() + modalController.dismiss() + }, + async fetchGroups(vSize?: any, vIndex?: any) { + const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; + const viewIndex = vIndex ? vIndex : 0; + const payload = { + viewSize, + viewIndex + }; + await this.store.dispatch('facility/fetchFacilityGroups', payload) }, - confirmSave() { - console.log('save'); - const facilitiesToRemove = this.associatedFacilityIds.filter((facilityId: string) => !this.associatedFacilityIdValues.includes(facilityId)) - const facilitiesToAdd = this.associatedFacilityIdValues.filter((facilityId: string) => !this.associatedFacilityIds.includes(facilityId)) - console.log('remove', facilitiesToRemove) - console.log('add', facilitiesToAdd) - - } }, setup() { const store = useStore(); diff --git a/src/locales/en.json b/src/locales/en.json index a1985450..31441355 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -79,6 +79,7 @@ "External mapping updated successfully": "External mapping updated successfully", "External mappings": "External mappings", "Facilities": "Facilities", + "Facilities associated to group successfully.": "Facilities associated to group successfully.", "Facility": "Facility", "Facility address created successfully.": "Facility address created successfully.", "Facility address updated successfully.": "Facility address updated successfully.", @@ -106,6 +107,7 @@ "Failed to add some product stores to the facility.": "Failed to add some product stores to the facility.", "Failed to archive parking.": "Failed to archive parking.", "Failed to associate group with system group types.": "Failed to associate group with system group types.", + "Failed to associate some facilites to group.": "Failed to associate some facilites to group.", "Failed to create calendar to the facility.": "Failed to create calendar to the facility.", "Failed to create external mapping": "Failed to create external mapping", "Failed to create facility.": "Failed to create facility.", From 9ea955fb8ebc5eff61bd8f0859478c6b74bb5ee6 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 15:23:21 +0530 Subject: [PATCH 004/103] Fixed: count now showing of associated facilities to group (#152) --- src/components/AddFacilityToGroupModal.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index 3698c293..78d0fac3 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -13,11 +13,11 @@ - {{ translate("Count:") }} {{ associatedFacilityIdValues.length }} + {{ translate("Count:") }} {{ selectedFacilityValues.length }} - {{ translate("Staff") }} + {{ translate("Facilities") }}
{{ translate("No facility found") }}
@@ -93,8 +93,6 @@ export default defineComponent({ return { queryString: '', facilities: [] as any, - associatedFacilityIds: [] as any, - associatedFacilityIdValues: [] as any, selectedFacilities: [] as any, selectedFacilityValues: [] as any } From 842ab2baf6df6b5870ada9ac037b0d6976b92152 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 15:33:05 +0530 Subject: [PATCH 005/103] Improved: facility count label and translation entry for that(#152) --- src/components/AddFacilityToGroupModal.vue | 5 +---- src/locales/en.json | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index 78d0fac3..25c8edcd 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -13,11 +13,10 @@ - {{ translate("Count:") }} {{ selectedFacilityValues.length }} + {{ translate("Facilities:", { count: selectedFacilityValues.length }) }} - {{ translate("Facilities") }}
{{ translate("No facility found") }}
@@ -55,7 +54,6 @@ import { IonLabel, IonItem, IonList, - IonListHeader, IonSearchbar, modalController } from "@ionic/vue"; @@ -86,7 +84,6 @@ export default defineComponent({ IonLabel, IonItem, IonList, - IonListHeader, IonSearchbar, }, data() { diff --git a/src/locales/en.json b/src/locales/en.json index 31441355..31a1aa95 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -79,6 +79,7 @@ "External mapping updated successfully": "External mapping updated successfully", "External mappings": "External mappings", "Facilities": "Facilities", + "Facilities:": "Facilities: {count}", "Facilities associated to group successfully.": "Facilities associated to group successfully.", "Facility": "Facility", "Facility address created successfully.": "Facility address created successfully.", From 16bb03cc4080e86a3d2541ebef1b7f58fba9aa84 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 16:07:19 +0530 Subject: [PATCH 006/103] Improved: code to pass only facilityGroupId as componentProp (#152) --- src/components/AddFacilityActionsPopover.vue | 2 +- src/components/AddFacilityToGroupModal.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/AddFacilityActionsPopover.vue b/src/components/AddFacilityActionsPopover.vue index 659504d0..bba3ab76 100644 --- a/src/components/AddFacilityActionsPopover.vue +++ b/src/components/AddFacilityActionsPopover.vue @@ -56,7 +56,7 @@ export default defineComponent({ async openAddFacilityToGroupsModal(group: any) { const modal = await modalController.create({ component: AddFacilityToGroupsModal, - componentProps: { group } + componentProps: { facilityGroupId: group.facilityGroupId } }) modal.onDidDismiss().then(() =>{ diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index 25c8edcd..aceffb6b 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -94,7 +94,7 @@ export default defineComponent({ selectedFacilityValues: [] as any } }, - props: ['group'], + props: ['facilityGroupId'], mounted() { Promise.all([this.fetchFacilities(), this.fetchAssociatedFacilities()]) }, @@ -148,7 +148,7 @@ export default defineComponent({ try { const resp = await FacilityService.fetchAssociatedFacilitiesToGroup({ inputFields: { - facilityGroupId: this.group.facilityGroupId + facilityGroupId: this.facilityGroupId }, viewSize: 250, // maximum view size entityName: 'FacilityGroupAndMember', @@ -187,7 +187,7 @@ export default defineComponent({ const removeResponses = await Promise.allSettled(facilitiesToRemove .map(async (facility: any) => await FacilityService.updateFacilityToGroup({ facilityId: facility.facilityId, - "facilityGroupId": this.group.facilityGroupId, + "facilityGroupId": this.facilityGroupId, "fromDate": facility.fromDate, "thruDate": DateTime.now().toMillis() })) @@ -196,7 +196,7 @@ export default defineComponent({ const addResponses = await Promise.allSettled(facilitiesToAdd .map(async (facility: any) => await FacilityService.addFacilityToGroup({ facilityId: facility.facilityId, - "facilityGroupId": this.group.facilityGroupId + "facilityGroupId": this.facilityGroupId })) ) From 4e30e01807ffbb653f719bab1292ac8875d85a10 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 29 Dec 2023 16:09:45 +0530 Subject: [PATCH 007/103] Improved: facilityGroupId passing as component prop (#152) --- src/components/AddFacilityActionsPopover.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/AddFacilityActionsPopover.vue b/src/components/AddFacilityActionsPopover.vue index bba3ab76..f9a6746e 100644 --- a/src/components/AddFacilityActionsPopover.vue +++ b/src/components/AddFacilityActionsPopover.vue @@ -8,7 +8,7 @@ {{ translate("View facilities") }}
- + {{ translate("Quick edit") }} @@ -53,10 +53,10 @@ export default defineComponent({ this.$router.push({ path: `/find-facilities` }) popoverController.dismiss() }, - async openAddFacilityToGroupsModal(group: any) { + async openAddFacilityToGroupsModal(facilityGroupId: any) { const modal = await modalController.create({ component: AddFacilityToGroupsModal, - componentProps: { facilityGroupId: group.facilityGroupId } + componentProps: { facilityGroupId } }) modal.onDidDismiss().then(() =>{ From 87923ec0f34168bd15cd31910ec2de1cad620d38 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 3 Jan 2024 15:41:59 +0530 Subject: [PATCH 008/103] Improved: code syntax, components name and variables name (#152) --- src/components/AddFacilityToGroupModal.vue | 45 ++++++++++--------- ...onsPopover.vue => GroupActionsPopover.vue} | 2 +- src/views/FindGroups.vue | 14 +++--- 3 files changed, 31 insertions(+), 30 deletions(-) rename src/components/{AddFacilityActionsPopover.vue => GroupActionsPopover.vue} (98%) diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index aceffb6b..11dc68ff 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -40,21 +40,21 @@ \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index a40004a3..dc56aad5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -100,6 +100,7 @@ "Facility External ID": "Facility External ID", "Facility external ID updated.": "Facility external ID updated.", "Facility group deleted.": "Facility group deleted.", + "Facility group type updated successfully.": "Facility group type updated successfully.", "Facility ID": "Facility ID", "Facility latitude and longitude removed successfully.": "Facility latitude and longitude removed successfully.", "Facility latitude and longitude updated successfully.": "Facility latitude and longitude updated successfully.", @@ -146,6 +147,7 @@ "Failed to remove shopify mapping": "Failed to remove shopify mapping", "Failed to rename facility group.": "Failed to rename facility group.", "Failed to rename parking.": "Failed to rename parking.", + "Failed to update facility group type.": "Failed to update facility group type.", "Failed to update some groups for facility": "Failed to update some groups for facility", "Facility type updated": "Facility type updated", "Failed to unarchive parking.": "Failed to unarchive parking.", @@ -178,6 +180,7 @@ "Go to OMS": "Go to OMS", "Group": "Group", "Group associated to system group types.": "Group associated to system group types.", + "Group type": "Group type", "Group unlinked from facility": "Group unlinked from facility", "groups": "{count} groups", "Groups": "Groups", @@ -226,6 +229,7 @@ "No facility found": "No facility found", "No fulfillment capacity": "No fulfillment capacity", "No groups found": "No groups found", + "No group types found": "No group types found", "no longer sells on": "{facilityName} no longer sells on {facilityGroupId}.", "No party found": "No party found", "No records found": "No records found", @@ -310,6 +314,7 @@ "Search groups": "Search groups", "Search time zones": "Search time zones", "Select time zone": "Select time zone", + "Select type": "Select type", "Select product stores": "Select product stores", "Select which channels this facility publishes inventory too.": "Select which channels this facility publishes inventory too.", "Select your preferred language.": "Select your preferred language.", From 3879e671526b2b99464eb7efdad00df6e870ac8e Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 11:31:19 +0530 Subject: [PATCH 072/103] Improved: updated method / variables names, updated UI for type list and syntax (#208) --- .../FacilityGroupActionsPopover.vue | 6 +-- src/components/GroupTypeModal.vue | 44 +++++++++++-------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/components/FacilityGroupActionsPopover.vue b/src/components/FacilityGroupActionsPopover.vue index 3bdc9e07..2f5c4f92 100644 --- a/src/components/FacilityGroupActionsPopover.vue +++ b/src/components/FacilityGroupActionsPopover.vue @@ -10,7 +10,7 @@ {{ group?.description ? translate("Edit description") : translate("Add description") }} - + {{ translate("Select type") }} @@ -38,7 +38,7 @@ import { hasError } from "@/adapter"; import { mapGetters, useStore } from "vuex"; import logger from "@/logger"; import FacilityGroupDescriptionModal from "@/components/FacilityGroupDescriptionModal.vue"; -import GroupTypeModal from "@/components/GroupTypeModal.vue" +import GroupTypeModal from "@/components/GroupTypeModal.vue"; export default defineComponent({ name: "FacilityGroupActionsPopover", @@ -136,7 +136,7 @@ export default defineComponent({ }); }) }, - async openUpdateGroupTypeModal() { + async updateGroupTypeModal() { const updateGroupTypeModal = await modalController.create({ component: GroupTypeModal, componentProps: { facilityGroup: this.group } diff --git a/src/components/GroupTypeModal.vue b/src/components/GroupTypeModal.vue index f57f7c55..edc6ccc7 100644 --- a/src/components/GroupTypeModal.vue +++ b/src/components/GroupTypeModal.vue @@ -10,23 +10,24 @@ - -
+ + -
+

{{ translate("No group types found")}}

+ + + + {{ groupType.description ? groupType.description : groupType.facilityGroupTypeId }} +

{{ groupType.facilityGroupTypeId }}

+
+ +
+
- - - - {{ groupType.description ? groupType.description : groupType.facilityGroupTypeId }} - - - -
@@ -63,10 +64,9 @@ import { useStore } from "@/store"; import { translate } from "@hotwax/dxp-components"; import { mapGetters } from "vuex"; import { FacilityService } from "@/services/FacilityService"; -import { hasError } from "@hotwax/oms-api"; +import { hasError } from "@/adapter"; import logger from "@/logger"; import { showToast } from "@/utils"; -import { popoverController } from "@ionic/core"; export default defineComponent({ name: "GroupTypeModal", @@ -88,7 +88,7 @@ export default defineComponent({ }, data() { return { - facilityGroupValues: JSON.parse(JSON.stringify(this.facilityGroup)) + facilityGroupValue: JSON.parse(JSON.stringify(this.facilityGroup)) } }, props: ["facilityGroup"], @@ -105,15 +105,15 @@ export default defineComponent({ async saveGroupType() { try { const resp = await FacilityService.updateFacilityGroup({ - facilityGroupId: this.facilityGroupValues.facilityGroupId, - facilityGroupTypeId: this.facilityGroupValues.facilityGroupTypeId + facilityGroupId: this.facilityGroupValue.facilityGroupId, + facilityGroupTypeId: this.facilityGroupValue.facilityGroupTypeId }) if(!hasError(resp)) { showToast(translate("Facility group type updated successfully.")) this.groups.map((group: any) => { - if(group.facilityGroupId === this.facilityGroupValues.facilityGroupId) { - group.facilityGroupTypeId = this.facilityGroupValues.facilityGroupTypeId + if(group.facilityGroupId === this.facilityGroupValue.facilityGroupId) { + group.facilityGroupTypeId = this.facilityGroupValue.facilityGroupTypeId } }) await this.store.dispatch('facility/updateFacilityGroups', this.groups) @@ -137,4 +137,10 @@ export default defineComponent({ }; } }); - \ No newline at end of file + + + \ No newline at end of file From 479ef7d005a4edcd6754c86a5eadde3519673939 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 15:14:03 +0530 Subject: [PATCH 073/103] Improved: api endpoints to create and update ProductStore to facility Group (#210) --- src/components/AddFacilityToGroupModal.vue | 4 +-- .../AddProductStoreToGroupModal.vue | 26 ++++++++++++++----- src/services/FacilityService.ts | 12 ++++----- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/components/AddFacilityToGroupModal.vue b/src/components/AddFacilityToGroupModal.vue index 2b6edd0f..07bbc036 100644 --- a/src/components/AddFacilityToGroupModal.vue +++ b/src/components/AddFacilityToGroupModal.vue @@ -186,7 +186,7 @@ export default defineComponent({ const facilitiesToRemove = this.selectedFacilities.filter((facility: any) => !this.selectedFacilityValues.some((selectedFacility: any) => facility.facilityId === selectedFacility.facilityId)) const removeResponses = await Promise.allSettled(facilitiesToRemove - .map(async (facility: any) => await FacilityService.updateProductStoreToFacilityGroup({ + .map(async (facility: any) => await FacilityService.updateFacilityToGroup({ "facilityId": facility.facilityId, "facilityGroupId": this.facilityGroupId, "fromDate": facility.fromDate, @@ -195,7 +195,7 @@ export default defineComponent({ ) const addResponses = await Promise.allSettled(facilitiesToAdd - .map(async (facility: any) => await FacilityService.addProductStoreToFacilityGroup({ + .map(async (facility: any) => await FacilityService.addFacilityToGroup({ "facilityId": facility.facilityId, "facilityGroupId": this.facilityGroupId })) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index 17a48ff5..a83a67ce 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -21,7 +21,7 @@ - + @@ -133,18 +133,19 @@ export default defineComponent({ const productStoresToRemove = this.selectedProductStores.filter((store: any) => !this.selectedProductStoreValues.some((selectedStore: any) => store.productStoreId === selectedStore.productStoreId)) const removeResponses = await Promise.allSettled(productStoresToRemove - .map(async (store: any) => await FacilityService.updateFacilityToGroup({ - "facilityId": store.facilityId, - "facilityGroupId": store.facilityGroupId, + .map(async (store: any) => await FacilityService.updateProductStoreFacilityGroup({ + "productStoreId": store.productStoreId, + "facilityGroupId": this.group.facilityGroupId, "fromDate": store.fromDate, "thruDate": DateTime.now().toMillis() })) ) const addResponses = await Promise.allSettled(productStoresToAdd - .map(async (store: any) => await FacilityService.addFacilityToGroup({ + .map(async (store: any) => await FacilityService.createProductStoreFacilityGroup({ "productStoreId": store.productStoreId, - "facilityGroupId": store.facilityGroupId + "facilityGroupId": this.group.facilityGroupId, + "fromDate": DateTime.now().toMillis() })) ) @@ -154,8 +155,21 @@ export default defineComponent({ } else { showToast(translate("Product stores associated to group successfully.")) } + this.fetchGroups() modalController.dismiss() }, + async fetchGroups(vSize?: any, vIndex?: any) { + const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; + const viewIndex = vIndex ? vIndex : 0; + const payload = { + viewSize, + viewIndex + }; + await this.store.dispatch('facility/fetchFacilityGroups', payload) + }, + areProductStoresUpdated() { + return JSON.stringify(this.selectedProductStoreValues) !== JSON.stringify(this.selectedProductStores) + } }, setup() { const store = useStore() diff --git a/src/services/FacilityService.ts b/src/services/FacilityService.ts index d7d17d98..17d4a2e1 100644 --- a/src/services/FacilityService.ts +++ b/src/services/FacilityService.ts @@ -776,17 +776,17 @@ const updateFacilityTelecomNumber = async (payload: any): Promise => { }) } -const addProductStoreToFacilityGroup = async (payload: any): Promise => { +const createProductStoreFacilityGroup = async (payload: any): Promise => { return api({ - url: "service/addProductStoreToFacilityGroup", + url: "service/createProductStoreFacilityGroup", method: "post", data: payload }) } -const updateProductStoreToFacilityGroup = async (payload: any): Promise => { +const updateProductStoreFacilityGroup = async (payload: any): Promise => { return api({ - url: "service/updateProductStoreToFacilityGroup", + url: "service/updateProductStoreFacilityGroup", method: "post", data: payload }) @@ -795,7 +795,6 @@ const updateProductStoreToFacilityGroup = async (payload: any): Promise => export const FacilityService = { addFacilityToGroup, addPartyToFacility, - addProductStoreToFacilityGroup, associateCalendarToFacility, createFacilityGroup, createFacility, @@ -807,6 +806,7 @@ export const FacilityService = { createFacilityPostalAddress, createFacilityTelecomNumber, createProductStoreFacility, + createProductStoreFacilityGroup, createShopifyShopLocation, deleteFacilityGroup, deleteFacilityLocation, @@ -845,6 +845,6 @@ export const FacilityService = { updateFacilityTelecomNumber, updateFacilityToGroup, updateProductStoreFacility, - updateProductStoreToFacilityGroup, + updateProductStoreFacilityGroup, updateShopifyShopLocation } \ No newline at end of file From 9c665941a90e4383a72636fa9b0456c84b5ad9e7 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 15:18:59 +0530 Subject: [PATCH 074/103] Improved: title of modal to add product store to facility group (#210) --- src/components/AddProductStoreToGroupModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index a83a67ce..957eeae4 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -6,7 +6,7 @@ - {{ translate("Select product stores") }} + {{ translate("Product stores") }} From 21a59c5b303056b3ad718c30b850233f7ba3627a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 15:30:46 +0530 Subject: [PATCH 075/103] Improved: removed unused console in code (#210) --- src/components/AddProductStoreToGroupModal.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index 957eeae4..a5aa30a9 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -105,7 +105,6 @@ export default defineComponent({ "filterByDate": 'Y' }) - console.log(resp); if(!hasError(resp)) { this.selectedProductStores = resp.data.docs this.selectedProductStoreValues = JSON.parse(JSON.stringify(resp.data.docs)) From f0b40273d64b27696a12e4a02d1930f2c6d3982a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 17:53:28 +0530 Subject: [PATCH 076/103] Improved: added comment, and added operator in api calls (#210) --- src/services/FacilityService.ts | 6 ++++-- src/store/modules/facility/actions.ts | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/FacilityService.ts b/src/services/FacilityService.ts index 17d4a2e1..4f68a9a9 100644 --- a/src/services/FacilityService.ts +++ b/src/services/FacilityService.ts @@ -560,7 +560,8 @@ const fetchFacilityCountByGroup = async (facilityGroupIds: any): Promise => const batch = facilityGroupIdList.splice(0, 10) const params = { inputFields: { - facilityGroupId: batch + facilityGroupId: batch, + facilityGroupId_op: "in" }, viewSize: 250, // maximum view size entityName: 'FacilityGroupAndMember', @@ -610,7 +611,8 @@ const fetchProductStoreCountByGroup = async (facilityGroupIds: any): Promise = { stateGroups = stateGroups.filter((group: any) => !facilityGroupIds.includes(group.facilityGroupId)) try { + // facilityGroupIds is list of ids which gets empty at the end of below api call + // We again want's to use this facilityGroupIds in another api hence deep cloning it. const facilityCountByGroup = await FacilityService.fetchFacilityCountByGroup(JSON.parse(JSON.stringify(facilityGroupIds))) groups.map((group: any) => { group.facilityCount = facilityCountByGroup[group.facilityGroupId] || 0 From b0eb81eef18d2b71c411f08553fcd74a370d9048 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 18:43:01 +0530 Subject: [PATCH 077/103] Improved: code to update state instead of calling api post product store association (#210) --- .../AddProductStoreToGroupModal.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index a5aa30a9..92922e2a 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -77,6 +77,7 @@ export default defineComponent({ ...mapGetters({ productStores: 'util/getProductStores', facilityProductStores: 'facility/getFacilityProductStores', + groups: "facility/getFacilityGroups" }) }, data() { @@ -154,17 +155,17 @@ export default defineComponent({ } else { showToast(translate("Product stores associated to group successfully.")) } - this.fetchGroups() + this.fetchGroupsCount() modalController.dismiss() }, - async fetchGroups(vSize?: any, vIndex?: any) { - const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; - const viewIndex = vIndex ? vIndex : 0; - const payload = { - viewSize, - viewIndex - }; - await this.store.dispatch('facility/fetchFacilityGroups', payload) + async fetchGroupsCount() { + const productStoreCountByGroup = await FacilityService.fetchProductStoreCountByGroup([this.group.facilityGroupId]) + this.groups.map((group: any) => { + if(group.facilityGroupId === this.group.facilityGroupId) { + group.productStoreCount = productStoreCountByGroup[this.group.facilityGroupId] + } + }) + await this.store.dispatch('facility/updateFacilityGroups', this.groups) }, areProductStoresUpdated() { return JSON.stringify(this.selectedProductStoreValues) !== JSON.stringify(this.selectedProductStores) From d291cb44fe67a03ae6cb6e90457889e142622723 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 18:47:21 +0530 Subject: [PATCH 078/103] Improved: parameter name for better understandability (#210) --- src/components/AddProductStoreToGroupModal.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index 92922e2a..fbefd5a3 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -119,13 +119,13 @@ export default defineComponent({ isSelected(productStoreId: any) { return this.selectedProductStoreValues.some((productStore: any) => productStore.productStoreId === productStoreId); }, - toggleProductStoreSelection(updatedStore: any) { - let selectedStore = this.selectedProductStoreValues.some((store: any) => store.productStoreId === updatedStore.productStoreId); + toggleProductStoreSelection(store: any) { + let selectedStore = this.selectedProductStoreValues.some((productStore: any) => productStore.productStoreId === store.productStoreId); if(selectedStore) { - this.selectedProductStoreValues = this.selectedProductStoreValues.filter((store: any) => store.productStoreId !== updatedStore.productStoreId); + this.selectedProductStoreValues = this.selectedProductStoreValues.filter((productStore: any) => productStore.productStoreId !== store.productStoreId); } else { - this.selectedProductStoreValues.push(updatedStore); + this.selectedProductStoreValues.push(store); } }, async saveProductStores() { From 9de6bb87471411a536bbbd23dabbb38832377463 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 19:01:06 +0530 Subject: [PATCH 079/103] Improved: added entry for empty path for tabs route (#207) --- src/router/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/router/index.ts b/src/router/index.ts index a8b9a970..a7fa5189 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -55,6 +55,9 @@ const routes: Array = [ component: Tabs, children: [ { + path: '', + redirect: '/find-facilities' + }, { path: 'find-facilities', component: () => import('@/views/FindFacilities.vue'), }, { From 2461618727aae051338e0ee545d1dab92d892a50 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 5 Mar 2024 19:08:00 +0530 Subject: [PATCH 080/103] Improved: redirect url for /tabs path (#207) --- src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index a7fa5189..8a84c404 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,7 +56,7 @@ const routes: Array = [ children: [ { path: '', - redirect: '/find-facilities' + redirect: '/tabs/find-facilities' }, { path: 'find-facilities', component: () => import('@/views/FindFacilities.vue'), From fac71092665605d399b7d0e595cc44688dd69ede Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Mar 2024 10:58:10 +0530 Subject: [PATCH 081/103] Improved: code for optimizing it, removed unused code, fixed return type from a service (#210) --- src/components/AddProductStoreToGroupModal.vue | 12 ++++-------- src/services/FacilityService.ts | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/AddProductStoreToGroupModal.vue b/src/components/AddProductStoreToGroupModal.vue index fbefd5a3..e3642846 100644 --- a/src/components/AddProductStoreToGroupModal.vue +++ b/src/components/AddProductStoreToGroupModal.vue @@ -120,9 +120,7 @@ export default defineComponent({ return this.selectedProductStoreValues.some((productStore: any) => productStore.productStoreId === productStoreId); }, toggleProductStoreSelection(store: any) { - let selectedStore = this.selectedProductStoreValues.some((productStore: any) => productStore.productStoreId === store.productStoreId); - - if(selectedStore) { + if(this.isSelected(store.productStoreId)) { this.selectedProductStoreValues = this.selectedProductStoreValues.filter((productStore: any) => productStore.productStoreId !== store.productStoreId); } else { this.selectedProductStoreValues.push(store); @@ -160,11 +158,9 @@ export default defineComponent({ }, async fetchGroupsCount() { const productStoreCountByGroup = await FacilityService.fetchProductStoreCountByGroup([this.group.facilityGroupId]) - this.groups.map((group: any) => { - if(group.facilityGroupId === this.group.facilityGroupId) { - group.productStoreCount = productStoreCountByGroup[this.group.facilityGroupId] - } - }) + const currentGroup = this.groups.find((group: any) => group.facilityGroupId === this.group.facilityGroupId) + currentGroup.productStoreCount = productStoreCountByGroup[this.group.facilityGroupId] + await this.store.dispatch('facility/updateFacilityGroups', this.groups) }, areProductStoresUpdated() { diff --git a/src/services/FacilityService.ts b/src/services/FacilityService.ts index 4f68a9a9..b1478f24 100644 --- a/src/services/FacilityService.ts +++ b/src/services/FacilityService.ts @@ -602,8 +602,8 @@ const fetchFacilityCountByGroup = async (facilityGroupIds: any): Promise => }, {}) } -const fetchProductStoreCountByGroup = async (facilityGroupIds: any): Promise => { - if (!facilityGroupIds.length) return [] +const fetchProductStoreCountByGroup = async (facilityGroupIds: Array): Promise => { + if (!facilityGroupIds.length) return {} const requests = [] const facilityGroupIdList = facilityGroupIds From d4cf66edf4b35c7395b5a2bca4dfd4c78a9f4ce2 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Mar 2024 14:39:44 +0530 Subject: [PATCH 082/103] Improved: added slot in icon, grouptype updating in state logic and removed unused ion-list (#208) --- src/components/GroupTypeModal.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/GroupTypeModal.vue b/src/components/GroupTypeModal.vue index edc6ccc7..ddd42bd6 100644 --- a/src/components/GroupTypeModal.vue +++ b/src/components/GroupTypeModal.vue @@ -3,7 +3,7 @@ - + {{ translate("Group type") }} @@ -27,8 +27,6 @@ - -
@@ -60,9 +58,8 @@ import { } from "@ionic/vue"; import { defineComponent } from "vue"; import { closeOutline, saveOutline } from "ionicons/icons"; -import { useStore } from "@/store"; import { translate } from "@hotwax/dxp-components"; -import { mapGetters } from "vuex"; +import { mapGetters, useStore } from "vuex"; import { FacilityService } from "@/services/FacilityService"; import { hasError } from "@/adapter"; import logger from "@/logger"; @@ -111,11 +108,9 @@ export default defineComponent({ if(!hasError(resp)) { showToast(translate("Facility group type updated successfully.")) - this.groups.map((group: any) => { - if(group.facilityGroupId === this.facilityGroupValue.facilityGroupId) { - group.facilityGroupTypeId = this.facilityGroupValue.facilityGroupTypeId - } - }) + const currentGroup = this.groups.find((group: any) => group.facilityGroupId === this.facilityGroupValue.facilityGroupId) + currentGroup.facilityGroupTypeId = this.facilityGroupValue.facilityGroupTypeId + await this.store.dispatch('facility/updateFacilityGroups', this.groups) modalController.dismiss() } else { From bf2c1e356e5255a89f2ec13c6fc65b11621a02c8 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Mar 2024 14:48:14 +0530 Subject: [PATCH 083/103] Fixed: removed unused import for IonList in groupTypeModal (#208) --- src/components/GroupTypeModal.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/GroupTypeModal.vue b/src/components/GroupTypeModal.vue index ddd42bd6..20eaecb8 100644 --- a/src/components/GroupTypeModal.vue +++ b/src/components/GroupTypeModal.vue @@ -49,7 +49,6 @@ import { IonItem, IonIcon, IonLabel, - IonList, IonRadioGroup, IonRadio, IonTitle, @@ -77,7 +76,6 @@ export default defineComponent({ IonIcon, IonItem, IonLabel, - IonList, IonRadioGroup, IonRadio, IonTitle, From 070bfde5e9bcb8f53c1eeda5c6e5b58272a2a068 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Thu, 7 Mar 2024 17:01:03 +0530 Subject: [PATCH 084/103] Improved: code by including the fab components in parking.vue and removed unused class button-card from variable.css --- src/theme/variables.css | 6 ------ src/views/Parking.vue | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/theme/variables.css b/src/theme/variables.css index bf37e049..f5192653 100644 --- a/src/theme/variables.css +++ b/src/theme/variables.css @@ -394,10 +394,4 @@ hr { display: none; } - .button-card { - display: grid; - place-items: center; - align-self: stretch; - } - } \ No newline at end of file diff --git a/src/views/Parking.vue b/src/views/Parking.vue index a161e15e..7e76ce63 100644 --- a/src/views/Parking.vue +++ b/src/views/Parking.vue @@ -110,6 +110,8 @@ export default defineComponent({ IonButtons, IonCard, IonContent, + IonFab, + IonFabButton, IonHeader, IonIcon, IonInfiniteScroll, From 4df3b46b2b39cab217e2479499ff206a2700b38b Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Thu, 7 Mar 2024 18:00:19 +0530 Subject: [PATCH 085/103] Improved: code by including fab components in FindGroups.vue --- src/views/FindGroups.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/FindGroups.vue b/src/views/FindGroups.vue index 1d420e18..7ff240b8 100644 --- a/src/views/FindGroups.vue +++ b/src/views/FindGroups.vue @@ -84,6 +84,8 @@ import { IonCard, IonChip, IonContent, + IonFab, + IonFabButton, IonHeader, IonIcon, IonInfiniteScroll, @@ -124,6 +126,8 @@ export default defineComponent({ IonCard, IonChip, IonContent, + IonFab, + IonFabButton, IonHeader, IonIcon, IonInfiniteScroll, From 65951cc9465513a7863699493d4506dc53c8401c Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Thu, 7 Mar 2024 18:31:53 +0530 Subject: [PATCH 086/103] Improved: code by removing the unused translation fron en.json --- src/locales/en.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index a40004a3..d04780a5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -5,7 +5,6 @@ "Add Group": "Add Group", "Add locations to facility": "Add locations to facility", "Add group description": "Add group description", - "Add new parking": "Add new parking", "Staff member": "Staff member", "Add Store": "Add Store", "Add Store Address": "Add Store Address", @@ -52,7 +51,6 @@ "Country": "Country", "Create ": "Create ", "Create Distribution Center login": "Create Distribution Center login", - "Create group": "Create group", "Create login credentials": "Create login credentials", "Create Outlet Store": "Create Outlet Store", "Create Outlet Store login": "Create Outlet Store login", From aa527a853744e1b71f906c751c072be67a4b5192 Mon Sep 17 00:00:00 2001 From: Ravi Lodhi Date: Fri, 8 Mar 2024 09:49:03 +0530 Subject: [PATCH 087/103] Updated: app version for minor release (1.4.0). --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7585a93..2b85c62e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "facilities", - "version": "1.3.1", + "version": "1.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "facilities", - "version": "1.3.1", + "version": "1.4.0", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", diff --git a/package.json b/package.json index 8aa6383f..5a429765 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "facilities", - "version": "1.3.1", + "version": "1.4.0", "private": true, "description": "App to manage facilities", "scripts": { From acb50da43cd221e03066391cde33fd151c83bc7a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 8 Mar 2024 12:38:46 +0530 Subject: [PATCH 088/103] Improved: removed the back button from the tab pages (#215) --- src/views/FindFacilities.vue | 3 --- src/views/FindGroups.vue | 3 --- src/views/Parking.vue | 3 --- src/views/Settings.vue | 3 --- 4 files changed, 12 deletions(-) diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue index 1fd5fe4f..2d37cf4f 100644 --- a/src/views/FindFacilities.vue +++ b/src/views/FindFacilities.vue @@ -4,7 +4,6 @@ - {{ translate("Find Facilities") }} @@ -126,7 +125,6 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 2bd0c550..47a7352a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -324,6 +324,7 @@ "Settings": "Settings", "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.", "Setup Store": "Setup Store", + "Shipping name": "Shipping name", "Shopify": "Shopify", "Shopify facility": "Shopify facility", "Shopify location": "Shopify location", diff --git a/src/store/modules/facility/actions.ts b/src/store/modules/facility/actions.ts index 81ecd3f7..6e31a051 100644 --- a/src/store/modules/facility/actions.ts +++ b/src/store/modules/facility/actions.ts @@ -237,7 +237,7 @@ const actions: ActionTree = { entityName: "FacilityContactDetailByPurpose", orderBy: 'fromDate DESC', filterByDate: 'Y', - fieldList: ['address1', 'address2', 'city', 'contactMechId', 'countryGeoId', 'countryGeoName', 'latitude', 'longitude', 'postalCode', 'stateGeoId', 'stateGeoName'], + fieldList: ['address1', 'address2', 'city', 'contactMechId', 'countryGeoId', 'countryGeoName', 'latitude', 'longitude', 'postalCode', 'stateGeoId', 'stateGeoName', 'toName'], viewSize: 1 } diff --git a/src/views/AddFacilityAddress.vue b/src/views/AddFacilityAddress.vue index 848194c1..ddaeacd3 100644 --- a/src/views/AddFacilityAddress.vue +++ b/src/views/AddFacilityAddress.vue @@ -13,6 +13,12 @@ {{ translate('Address') }} + + + {{ translate('Shipping name') }} + + + {{ translate('Address line 1') }} * @@ -163,12 +169,14 @@ export default defineComponent({ computed: { ...mapGetters({ countries: 'util/getCountries', - states: 'util/getStates' + states: 'util/getStates', + current: 'facility/getCurrent', }) }, data() { return { formData: { + toName: '', address1: '', address2: '', city: '', @@ -184,6 +192,7 @@ export default defineComponent({ }, props: ['facilityId'], async ionViewWillEnter() { + this.formData.toName = this.current.facilityName await this.store.dispatch('util/fetchCountries', { countryGeoId: "USA" }) }, methods: { diff --git a/src/views/CreateFacility.vue b/src/views/CreateFacility.vue index 06d0a3d3..c1f84b9f 100644 --- a/src/views/CreateFacility.vue +++ b/src/views/CreateFacility.vue @@ -184,6 +184,7 @@ export default defineComponent({ if (!hasError(resp)) { const { facilityId } = resp.data showToast(translate("Facility created successfully.")) + this.store.dispatch('facility/updateCurrentFacility', payload), this.router.replace(`/add-facility-address/${facilityId}`) } else { throw resp.data; diff --git a/src/views/FacilityDetails.vue b/src/views/FacilityDetails.vue index e052dcea..1671d5ff 100644 --- a/src/views/FacilityDetails.vue +++ b/src/views/FacilityDetails.vue @@ -50,6 +50,7 @@