From 8bc0a291cb1d298cce4fac9e6e64f0ddbabdb61e Mon Sep 17 00:00:00 2001 From: brydon1 Date: Fri, 30 Jun 2023 13:46:46 -0400 Subject: [PATCH 01/15] Replacing all spaces in string with dashes, instead of some --- .../base-input-button/base-input-button.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/digital-components/base-input-button/base-input-button.vue b/src/digital-components/base-input-button/base-input-button.vue index 8768bb8c..0c92db50 100644 --- a/src/digital-components/base-input-button/base-input-button.vue +++ b/src/digital-components/base-input-button/base-input-button.vue @@ -121,9 +121,7 @@ export default { return this.isMultiSelect ? "checkbox" : "radio"; }, buttonId() { - return `${this.groupName?.replace(" ", "-")}-${this.value - ?.toString() - ?.replace(" ", "-")}`; + return `${this.groupName}-${this.value}`.replaceAll(" ", "-"); }, isValueSelectedOnClick() { return this.isMultiSelect || this.selectingInitiatesLoad; From 4eea65b58d624747bbe87564bd1d331021352c3c Mon Sep 17 00:00:00 2001 From: brydon1 Date: Fri, 30 Jun 2023 13:47:11 -0400 Subject: [PATCH 02/15] Simplified syntax --- src/digital-components/button-question/button-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 5679e96c..55033df7 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -31,7 +31,7 @@
+ :key="answer.value ?? answer"> Date: Fri, 30 Jun 2023 13:47:49 -0400 Subject: [PATCH 03/15] Removing all spaces from group names --- .../glass-part-question/glass-part-question.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue index 9b1beaec..a5e862bd 100644 --- a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue +++ b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue @@ -12,7 +12,7 @@ :isWide="true" altText="" isRequired - :groupName="`${glassLocation}-${glassName}`" + :groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}`)" :validationRules="tintValidationRules">
@@ -27,7 +27,7 @@ :loaderEnabled="false" isRequired isSmallQuestionText - :groupName="`${glassLocation}-${glassName}-${selectedTint}`" + :groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}-${selectedTint}`)" :validationRules="partValidationRules" />
@@ -210,6 +210,10 @@ export default { } }); }, + + replaceAllSpaceWithDash(str) { + return String(str).replaceAll(" ", "-"); + }, }, watch: { selectedTint() { From 2485e2ac73032f03a4c89b5b5c58348f71dd99bc Mon Sep 17 00:00:00 2001 From: brydon1 Date: Fri, 30 Jun 2023 13:48:19 -0400 Subject: [PATCH 04/15] When unmounted, resetting field --- src/ux-components/radio/radio.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue index 1a0d52d7..2c02e245 100644 --- a/src/ux-components/radio/radio.vue +++ b/src/ux-components/radio/radio.vue @@ -76,6 +76,7 @@ value: inputValue, handleChange, errors, + resetField } = useField(props.groupName, props.validationRules, { type: inputType, @@ -84,8 +85,12 @@ return { handleChange, errors, + resetField }; }, + unmounted(){ + this.resetField(); + } }; From 0fa3b5aa248341e6edc3c473b007a501afef1403 Mon Sep 17 00:00:00 2001 From: brydon1 Date: Fri, 30 Jun 2023 14:00:36 -0400 Subject: [PATCH 05/15] Removing ignored value --- src/ux-components/radio/radio.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue index cdb3b273..5be0c629 100644 --- a/src/ux-components/radio/radio.vue +++ b/src/ux-components/radio/radio.vue @@ -71,7 +71,6 @@ export default { }, }, setup(props) { - const inputType = "radio"; const { value: inputValue, @@ -80,8 +79,7 @@ export default { resetField } = useField(props.groupName, props.validationRules, { - type: inputType//, - //checkedValue: props.value, + type: inputType }); return { From e473f747372d9f399ef654c400e5940f2d9cfa03 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Fri, 30 Jun 2023 14:33:43 -0400 Subject: [PATCH 06/15] do not handle error if vehicle lookup is successful --- src/layouts/policy-vehicles/policy-vehicles.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 4a92c1c2..43971e91 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -193,7 +193,7 @@ export default { const vehicle = await this.lookupVehicleByVin(value); // handle error in case vehicle info doesn't come back for selected VIN - if (vehicle?.error ?? true) { + if (vehicle?.error === true) { this.mainStore.resetVehicleState(); this.displayGeneric = true; return; From 33a617ea25bfb5352dff9e3ba19ec4753335016a Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Fri, 30 Jun 2023 14:41:24 -0400 Subject: [PATCH 07/15] handle nulls --- src/layouts/policy-vehicles/policy-vehicles.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 43971e91..0444498f 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -200,14 +200,14 @@ export default { } // save selected vehicle to the store - this.mainStore.updateVehicle(vehicle.data); + this.mainStore.updateVehicle(vehicle?.data); this.displayGeneric = true; // get the style(s) associated with the selected YMM const styleOptions = await this.mainStore.getVehicleStyles( - vehicle.data.year, - vehicle.data.make, - vehicle.data.model + vehicle?.data.year, + vehicle?.data.make, + vehicle?.data.model ) // if there is more than 1 style for the selected vehicle, display generic/blurred image From fd1f630677966f9ee56ded503f2e0a030bd6dbfe Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 3 Jul 2023 14:13:13 -0400 Subject: [PATCH 08/15] refactor --- .../policy-vehicles/policy-vehicles.vue | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 0444498f..fd7a8c52 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -194,24 +194,22 @@ export default { // handle error in case vehicle info doesn't come back for selected VIN if (vehicle?.error === true) { - this.mainStore.resetVehicleState(); - this.displayGeneric = true; - return; + this.mainStore.resetVehicleState(); + this.displayGeneric = true; + } else { + // save selected vehicle to the store + this.mainStore.updateVehicle(vehicle?.data); + this.displayGeneric = true; + + // get the style(s) associated with the selected YMM + const styleOptions = await this.mainStore.getVehicleStyles( + vehicle.data.year, + vehicle.data.make, + vehicle.data.model, + ); + // if there is more than 1 style for the selected vehicle, display generic/blurred image + this.displayGeneric = styleOptions?.data?.length > 1; } - - // save selected vehicle to the store - this.mainStore.updateVehicle(vehicle?.data); - this.displayGeneric = true; - - // get the style(s) associated with the selected YMM - const styleOptions = await this.mainStore.getVehicleStyles( - vehicle?.data.year, - vehicle?.data.make, - vehicle?.data.model - ) - - // if there is more than 1 style for the selected vehicle, display generic/blurred image - this.displayGeneric = styleOptions?.data?.length > 1; } } }, From 3485373a4c637bc4e40a078ab1617cedfe638d5c Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 3 Jul 2023 14:25:40 -0400 Subject: [PATCH 09/15] refactor v2 --- src/layouts/policy-vehicles/policy-vehicles.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index fd7a8c52..e847e94b 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -196,9 +196,10 @@ export default { if (vehicle?.error === true) { this.mainStore.resetVehicleState(); this.displayGeneric = true; - } else { + } + if (vehicle) { // save selected vehicle to the store - this.mainStore.updateVehicle(vehicle?.data); + this.mainStore.updateVehicle(vehicle); this.displayGeneric = true; // get the style(s) associated with the selected YMM From b767f162ba498ecf9a9100c447819cb274c83f85 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 3 Jul 2023 14:38:36 -0400 Subject: [PATCH 10/15] final refactor --- src/layouts/policy-vehicles/policy-vehicles.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index e847e94b..3466f5b9 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -196,12 +196,13 @@ export default { if (vehicle?.error === true) { this.mainStore.resetVehicleState(); this.displayGeneric = true; + return; } if (vehicle) { // save selected vehicle to the store - this.mainStore.updateVehicle(vehicle); + this.mainStore.updateVehicle(vehicle.data); this.displayGeneric = true; - + // get the style(s) associated with the selected YMM const styleOptions = await this.mainStore.getVehicleStyles( vehicle.data.year, From 4bb65ce160687ac77113c02ddea3bac9f958b65e Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Tue, 4 Jul 2023 09:39:20 -0400 Subject: [PATCH 11/15] correct placement of question text --- src/digital-components/textbox-question/textbox-question.vue | 1 + .../service-zip-modal-question/service-zip-modal-question.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index c502681c..85c21243 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -1,6 +1,7 @@ + \ No newline at end of file + diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.vue b/src/layouts/vehicle-lookup/vehicle-lookup.vue index ee7d74df..f2ebe6d0 100644 --- a/src/layouts/vehicle-lookup/vehicle-lookup.vue +++ b/src/layouts/vehicle-lookup/vehicle-lookup.vue @@ -11,7 +11,7 @@ - +
diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 7bd3241c..e88c5c6d 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -38,6 +38,7 @@ :alreadyPopulatedPartsData="alreadyPopulatedPartsData" />