diff --git a/package-lock.json b/package-lock.json index 6e7d429..2c4e7d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "order-routing-rules", - "version": "1.1.0", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "order-routing-rules", - "version": "1.1.0", + "version": "1.2.1", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", diff --git a/package.json b/package.json index 482601e..4a2b531 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "order-routing-rules", - "version": "1.1.0", + "version": "1.2.1", "private": true, "description": "An Ionic project", "scripts": { diff --git a/src/components/AddInventoryFilterOptionsModal.vue b/src/components/AddInventoryFilterOptionsModal.vue index 48130d8..9c3753f 100644 --- a/src/components/AddInventoryFilterOptionsModal.vue +++ b/src/components/AddInventoryFilterOptionsModal.vue @@ -9,7 +9,10 @@ - +
+

{{ translate(`Failed to fetch ${props.label?.toLowerCase()} options`) }}

+
+ {{ condition.description || condition.enumCode }} @@ -66,7 +69,7 @@ const associatedOptions = { IIP_PROXIMITY: { enum: "IIP_MSMNT_SYSTEM", defaultVa onMounted(() => { inventoryRuleConditions.value = props.ruleConditions ? JSON.parse(JSON.stringify(props.ruleConditions)) : {} - enumerations.value = Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => !hiddenOptions.includes(enumeration.enumId)) + enumerations.value = enums.value[props.parentEnumId] ? Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => !hiddenOptions.includes(enumeration.enumId)) : [] }) function checkFilters() { diff --git a/src/components/AddOrderRouteFilterOptions.vue b/src/components/AddOrderRouteFilterOptions.vue index a173721..1f6b913 100644 --- a/src/components/AddOrderRouteFilterOptions.vue +++ b/src/components/AddOrderRouteFilterOptions.vue @@ -9,8 +9,11 @@ - - +
+

{{ translate(`Failed to fetch ${$props.label?.toLowerCase()} options`) }}

+
+ + {{ sort.description || sort.enumCode }} diff --git a/src/components/ArchivedRoutingModal.vue b/src/components/ArchivedRoutingModal.vue index 35ae17a..b03afda 100644 --- a/src/components/ArchivedRoutingModal.vue +++ b/src/components/ArchivedRoutingModal.vue @@ -72,6 +72,6 @@ async function updateOrderRouting(routing: Route, fieldToUpdate: string, value: props.saveRoutings([{ ...routing, [fieldToUpdate]: value - }]) + }, ...routings.value]) } diff --git a/src/components/PromiseFilterPopover.vue b/src/components/PromiseFilterPopover.vue index 21b391b..694619e 100644 --- a/src/components/PromiseFilterPopover.vue +++ b/src/components/PromiseFilterPopover.vue @@ -53,7 +53,13 @@ async function updatePromiseDate(header = '', isPastDuration = false) { placeholder: translate("duration"), min: 0, type: "number", - value: props.value?.replace("-", "") + value: props.value > 0 && !isPastDuration ? props.value : props.value < 0 && isPastDuration ? props.value?.replace("-", "") : '', // Prefill the value only when the previously selected option and current selection matches + attributes: { + // Added check to not allow mainly .(period) and other special characters to be entered in the alert input + onkeydown: ($event: any) => { + if(/[`!@#$%^&*()_+\-=\\|,.<>?~]/.test($event.key)) $event.preventDefault(); + } + } }] }) diff --git a/src/locales/en.json b/src/locales/en.json index ea01790..037607f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -48,6 +48,8 @@ "Failed to create brokering run": "Failed to create brokering run", "Failed to create inventory rule": "Failed to create inventory rule", "Failed to create order routing": "Failed to create order routing", + "Failed to fetch filters options": "Failed to fetch filters options", + "Failed to fetch sort options": "Failed to fetch sort options", "Failed to update group information": "Failed to update group information", "Failed to update group status": "Failed to update group status", "Failed to schedule service": "Failed to schedule service", @@ -96,6 +98,7 @@ "Order priority": "Order priority", "Order Rule Filters": "Order Rule Filters", "Order Rule Sort": "Order Rule Sort", + "Order routing information updated": "Order routing information updated", "Orders will be brokered based on order date if no sorting is specified.": "Orders will be brokered based on order date if no sorting is specified.", "operator": "operator", "Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.": "Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.", diff --git a/src/services/RoutingService.ts b/src/services/RoutingService.ts index e8ac61e..a8f426e 100644 --- a/src/services/RoutingService.ts +++ b/src/services/RoutingService.ts @@ -22,17 +22,19 @@ const fetchRoutingScheduleInformation = async (routingGroupId: string): Promise< }); } -const fetchRoutingHistory = async (routingGroupId: string): Promise => { +const fetchRoutingHistory = async (routingGroupId: string, params: any): Promise => { return api({ url: `groups/${routingGroupId}/routingRuns`, - method: "GET" + method: "GET", + params }); } -const fetchGroupHistory = async (jobName: string): Promise => { +const fetchGroupHistory = async (jobName: string, params: any): Promise => { return api({ url: `serviceJobRuns/${jobName}`, - method: "GET" + method: "GET", + params }); } diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index 67f6f17..ffd93ea 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -164,13 +164,14 @@ const actions: ActionTree = { }, async fetchCurrentOrderRouting({ dispatch }, orderRoutingId) { - let currentRoute = {} + let currentRoute = {} as any try { const resp = await OrderRoutingService.fetchOrderRouting(orderRoutingId); if(!hasError(resp) && resp.data) { currentRoute = resp.data + currentRoute["rules"] = currentRoute["rules"]?.length ? sortSequence(currentRoute["rules"]) : [] } else { throw resp.data } @@ -185,18 +186,11 @@ const actions: ActionTree = { commit(types.ORDER_ROUTING_CURRENT_ROUTE_UPDATED, payload) }, - async fetchRoutingHistory({ commit, state }, routingGroupId) { - const history = Object.values(state.routingHistory)[0] as any - - // If the routing history for the current group is already available then don't fetch the history again - if(history?.length && history[0].routingGroupId === routingGroupId) { - return; - } - + async fetchRoutingHistory({ commit }, routingGroupId) { let routingHistory = {} try { - const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId) + const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId, { orderByField: "startDate DESC" }) if(!hasError(resp)) { // Sorting the history based on startTime, as we does not get the records in sorted order from api diff --git a/src/theme/variables.css b/src/theme/variables.css index fe2d458..c4dafed 100644 --- a/src/theme/variables.css +++ b/src/theme/variables.css @@ -262,6 +262,10 @@ http://ionicframework.com/docs/theming/ */ text-align: center; } +ion-input.name { + --background: var(--ion-color-light) +} + .pointer { cursor: pointer; } diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 6d10f1f..ded1297 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -1,16 +1,34 @@