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/locales/en.json b/src/locales/en.json index ea01790..202b698 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 filter options": "Failed to fetch filter 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", diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 1f799cb..27d6813 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -770,7 +770,7 @@ function getPromiseDateValue() { } function getFilterValue(options: any, enums: any, parameter: string) { - return options?.[enums[parameter].code] + return enums[parameter] ? options?.[enums[parameter].code] : undefined } function getSelectedValue(options: any, enumerations: any, parameter: string) { @@ -793,7 +793,7 @@ function getSelectedValue(options: any, enumerations: any, parameter: string) { function getLabel(parentType: string, code: string) { const enumerations = enums.value[parentType] - const enumInfo: any = Object.values(enumerations).find((enumeration: any) => enumeration.enumCode === code) + const enumInfo: any = enumerations ? Object.values(enumerations).find((enumeration: any) => enumeration.enumCode === code) : null return enumInfo?.description }