From 00e62c42404c2288f70c124e061e307551023ed1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 8 Mar 2022 15:07:47 -0500 Subject: [PATCH 1/3] CSR-319: update repair/replace validation logic --- .../windshield-options/windshield-options.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue index 1d483f269..792b1ed11 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue @@ -37,7 +37,11 @@ defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_C defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED)); defineRule("checkForRepairAndReplace", (value, [other]) => { - if (value.toString().toUpperCase().includes("REPAIR") && other.toString().toUpperCase().includes("WINDSHIELD") && other.length > 1) { + if (value.toString().toUpperCase().includes("REPAIR") && + other.toString().toUpperCase().includes("WINDSHIELD") && + Array.isArray(other) && + other.length > 1) + { return "checkForRepairAndReplace error" } return true; From a3c8998345c72c3a5a142565057301f0093846ea Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 8 Mar 2022 17:36:34 -0500 Subject: [PATCH 2/3] CSR-319: add new alert error if no windshield replace option is available --- .../windshield-options/windshield-options.vue | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue index 792b1ed11..c3a7aca68 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-options.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-options.vue @@ -1,12 +1,20 @@