From 2c9264f2e6412154854ee19cbf97d148d5ffe892 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 28 Apr 2022 15:50:40 -0400 Subject: [PATCH] Modified auto-fill preventing label obfuscation to inject '⁠' into all the words of the label --- .../dropdown-question/dropdown-question.vue | 18 +++++++++++------- .../textbox-question/textbox-question.vue | 18 +++++++++++------- src/layouts/address-lookup/address-lookup.vue | 4 +--- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/common-components/dropdown-question/dropdown-question.vue b/src/common-components/dropdown-question/dropdown-question.vue index 1f303a995..7afdc0b38 100644 --- a/src/common-components/dropdown-question/dropdown-question.vue +++ b/src/common-components/dropdown-question/dropdown-question.vue @@ -73,18 +73,22 @@ export default { }, labelText: { get: function () { - var thisQuestionText = ""; + const noBreakChar = "⁠"; + var questionText = ""; if (this.disableAutoFill) { + var words = this.questionText.toString().split(/[ ]+/); + words.forEach(function (word) { + const position = 1; + word = [word.toString().slice(0, position), noBreakChar, word.toString().slice(position)].join(''); + questionText += `${word} `; + }); - const noBreakChar = "⁠"; - const position = 1; - thisQuestionText = [this.questionText.toString().slice(0, position), noBreakChar, this.questionText.toString().slice(position)].join(''); - + questionText = questionText.trimEnd(); } else { - thisQuestionText = this.questionText.toString(); + questionText = this.questionText.toString(); } - return thisQuestionText; + return questionText; } } }, diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 94ff8296c..062ceb683 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -91,18 +91,22 @@ export default { }, labelText: { get: function () { - var thisQuestionText = ""; + const noBreakChar = "⁠"; + var questionText = ""; if (this.disableAutoFill) { + var words = this.questionText.toString().split(/[ ]+/); + words.forEach(function (word) { + const position = 1; + word = [word.toString().slice(0, position), noBreakChar, word.toString().slice(position)].join(''); + questionText += `${word} `; + }); - const noBreakChar = "⁠"; - const position = 1; - thisQuestionText = [this.questionText.toString().slice(0, position), noBreakChar, this.questionText.toString().slice(position)].join(''); - + questionText = questionText.trimEnd(); } else { - thisQuestionText = this.questionText.toString(); + questionText = this.questionText.toString(); } - return thisQuestionText; + return questionText; } } }, diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 868ac02e0..4069b0c21 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -5,7 +5,7 @@ ref="theForm" v-slot="{ meta }" autocomplete="off" > -
+
@@ -224,8 +224,6 @@ export default { ); // if the car entered is the same as the car found OR the glass options for the found car match the users damage selections - console.log(glassOptions.data); - console.log(store.getters.damage.glassToReplace); if (carEntered.carId == carFound.carId || !compareGlassOptions(glassOptions.data, store.getters.damage.glassToReplace)) { console.log("navigating to heritage funnel"); //navigateToHeritageFunnel();