From 732b1a5f8f4138f6f156c3150267cf876cf46657 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Thu, 4 May 2023 13:04:07 -0400 Subject: [PATCH 01/86] WIP CSR-1357 Add text area component. --- .../customer-details/customer-details.spec.js | 0 .../customer-details/customer-details.vue | 18 ++++++ src/router/index.js | 6 ++ .../text-area/text-area-multi-line.spec.js | 0 .../text-area/text-area-multi-line.vue | 58 +++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 src/layouts/customer-details/customer-details.spec.js create mode 100644 src/layouts/customer-details/customer-details.vue create mode 100644 src/ux-components/text-area/text-area-multi-line.spec.js create mode 100644 src/ux-components/text-area/text-area-multi-line.vue diff --git a/src/layouts/customer-details/customer-details.spec.js b/src/layouts/customer-details/customer-details.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue new file mode 100644 index 000000000..91bd77afe --- /dev/null +++ b/src/layouts/customer-details/customer-details.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/router/index.js b/src/router/index.js index 3abfa058d..d76a0905a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -31,8 +31,14 @@ import { applicationConfig } from "../constants/application-config"; // Components import datePicker from "@/digital-components/date-picker/date-picker.vue"; import demoDatePicker from "@/layouts/demo-date-picker/demo-date-picker.vue"; +import customerDetails from "@/layouts/customer-details/customer-details.vue"; const routes = [ + { + path: "/customer-details", // This is a temporary route for testing. + name: "customer-details", + component: customerDetails, + }, { path: "/demo-date-picker", // This is a temporary route for testing. name: "demo-date-picker", diff --git a/src/ux-components/text-area/text-area-multi-line.spec.js b/src/ux-components/text-area/text-area-multi-line.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/ux-components/text-area/text-area-multi-line.vue b/src/ux-components/text-area/text-area-multi-line.vue new file mode 100644 index 000000000..ad87f9893 --- /dev/null +++ b/src/ux-components/text-area/text-area-multi-line.vue @@ -0,0 +1,58 @@ + + + + + From ac95ee1344663f564f1df274fdc8ca573337a1de Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Thu, 4 May 2023 13:06:39 -0400 Subject: [PATCH 02/86] WIP format code. --- .../customer-details/customer-details.vue | 7 ++-- .../text-area/text-area-multi-line.vue | 35 ++++++++++++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 91bd77afe..975ef7804 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -3,8 +3,7 @@ labelText="Notes for your technician" labelTextOptional="(Optional)" textAreaFooterText="250/250 characters remaining" - footerText - /> + footerText /> diff --git a/src/ux-components/text-area/text-area-multi-line.vue b/src/ux-components/text-area/text-area-multi-line.vue index ad87f9893..c5d285193 100644 --- a/src/ux-components/text-area/text-area-multi-line.vue +++ b/src/ux-components/text-area/text-area-multi-line.vue @@ -1,8 +1,19 @@ @@ -13,20 +24,20 @@ export default { labelText: String, labelTextOptional: String, textAreaFooterText: String, - footerText: Boolean + footerText: Boolean, }, - mounted: function() { - const my_textarea = document.getElementById('textarea-comments'); - const remaining = document.getElementById('charactersremaining'); + mounted: function () { + const my_textarea = document.getElementById("textarea-comments"); + const remaining = document.getElementById("charactersremaining"); const remain = 250; - my_textarea.addEventListener('input',()=>{ + my_textarea.addEventListener("input", () => { const total = remain - my_textarea.value.length; - const color = total < remain * 0.1 ? 'red' : null; //Change text to red when the total remaining goes below 25; + const color = total < remain * 0.1 ? "red" : null; //Change text to red when the total remaining goes below 25; remaining.innerHTML = `${total}/250 characters remaining`; - remaining.style.color = color; + remaining.style.color = color; }); - } + }, }; @@ -40,7 +51,7 @@ export default { } } textarea { - border-radius: .5rem; + border-radius: 0.5rem; border: 1px solid $gray-550; height: 88px; &:hover { From 16f52932d6d59483caa6284847d662785964b174 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 5 May 2023 10:17:23 -0400 Subject: [PATCH 03/86] WIP --- .../customer-details/customer-details.vue | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 975ef7804..723fd8a8a 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -1,17 +1,48 @@ From 0c5ac3ef69a950ea62c8accd3540f864180621e7 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 8 May 2023 09:22:45 -0400 Subject: [PATCH 04/86] WIP rename and move to digital-components. --- .../textarea-question/textarea-question.spec.js} | 0 .../textarea-question/textarea-question.vue} | 10 ++++------ src/layouts/customer-details/customer-details.vue | 12 ++++++++---- 3 files changed, 12 insertions(+), 10 deletions(-) rename src/{ux-components/text-area/text-area-multi-line.spec.js => digital-components/textarea-question/textarea-question.spec.js} (100%) rename src/{ux-components/text-area/text-area-multi-line.vue => digital-components/textarea-question/textarea-question.vue} (86%) diff --git a/src/ux-components/text-area/text-area-multi-line.spec.js b/src/digital-components/textarea-question/textarea-question.spec.js similarity index 100% rename from src/ux-components/text-area/text-area-multi-line.spec.js rename to src/digital-components/textarea-question/textarea-question.spec.js diff --git a/src/ux-components/text-area/text-area-multi-line.vue b/src/digital-components/textarea-question/textarea-question.vue similarity index 86% rename from src/ux-components/text-area/text-area-multi-line.vue rename to src/digital-components/textarea-question/textarea-question.vue index c5d285193..3c72b9862 100644 --- a/src/ux-components/text-area/text-area-multi-line.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -1,8 +1,6 @@ @@ -19,6 +19,10 @@ export default { name: "textareaquestion", props: { + cmsWidgetName: String, + isRequired: Boolean, + maxLength: Number, + modelValue: String, labelText: String, labelTextOptional: String, textAreaFooterText: String, diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 080c3f3dc..936c8eb12 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -1,11 +1,10 @@ @@ -43,10 +42,7 @@ export default { computed: { textAreaLabelCopy() { return this.getCmsContent("CustomerDetailsTextAreaLabelText", "HeaderText"); - }, - textAreaLabelCopyOptional() { - return this.getCmsContent("CustomerDetailsTextAreaLabelText", "SubheaderText"); - }, + } } }; From f5dfcab4d0206e43f6277419d239fb32877c5257 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 09:03:49 -0400 Subject: [PATCH 06/86] WIP --- src/digital-components/textarea-question/textarea-question.vue | 3 --- src/layouts/customer-details/customer-details.vue | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index 468efde4c..81ff0e9ec 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -24,9 +24,6 @@ export default { maxLength: Number, modelValue: String, labelText: String, - labelTextOptional: String, - textAreaFooterText: String, - footerText: Boolean, }, mounted: function () { const my_textarea = document.getElementById("textarea-comments"); diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 936c8eb12..6174868f2 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -42,7 +42,7 @@ export default { computed: { textAreaLabelCopy() { return this.getCmsContent("CustomerDetailsTextAreaLabelText", "HeaderText"); - } + }, } }; From 7575e03866b90046b5103f3bdc7f3ec84fb54c38 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 09:26:29 -0400 Subject: [PATCH 07/86] WIP --- .../textarea-question/textarea-question.vue | 4 ++-- src/layouts/customer-details/customer-details.vue | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index 81ff0e9ec..412cffa19 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -4,13 +4,13 @@

- 250/250 characters remaining + {{maxLength}}/{{maxLength}} characters remaining

diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 6174868f2..a23918284 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -2,8 +2,7 @@ From 5104ee4ecac73fb23974486f4296259e49b57e6a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 11:00:55 -0400 Subject: [PATCH 08/86] WIP update maxLength. --- .../textarea-question/textarea-question.vue | 4 ++-- src/layouts/customer-details/customer-details.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index 412cffa19..fb0e90e02 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -28,12 +28,12 @@ export default { mounted: function () { const my_textarea = document.getElementById("textarea-comments"); const remaining = document.getElementById("charactersremaining"); - const remain = 250; + const remain = this.maxLength; my_textarea.addEventListener("input", () => { const total = remain - my_textarea.value.length; const color = total < remain * 0.1 ? "red" : null; //Change text to red when the total remaining goes below 25; - remaining.innerHTML = `${total}/250 characters remaining`; + remaining.innerHTML = `${total}/${this.maxLength} characters remaining`; remaining.style.color = color; }); }, diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index a23918284..03aadfacb 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -2,7 +2,7 @@ From 610e82e382323d0a645f88c1158913083e31eec0 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 11:01:47 -0400 Subject: [PATCH 09/86] WIP change value. --- src/digital-components/textarea-question/textarea-question.vue | 2 +- src/layouts/customer-details/customer-details.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index fb0e90e02..ffea9a713 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -32,7 +32,7 @@ export default { my_textarea.addEventListener("input", () => { const total = remain - my_textarea.value.length; - const color = total < remain * 0.1 ? "red" : null; //Change text to red when the total remaining goes below 25; + const color = total < remain * 0.1 ? "red" : null; //Change text to red when the total remaining goes below 10%; remaining.innerHTML = `${total}/${this.maxLength} characters remaining`; remaining.style.color = color; }); diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 03aadfacb..a23918284 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -2,7 +2,7 @@ From 40414580da19d58cde9cebf780097c792d011efa Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 13:41:19 -0400 Subject: [PATCH 10/86] WIP update computed. --- src/layouts/customer-details/customer-details.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index a23918284..1f77f2f1c 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -40,7 +40,7 @@ export default { }, computed: { textAreaLabelCopy() { - return this.getCmsContent("CustomerDetailsTextAreaLabelText", "HeaderText"); + return this.getCmsContent("TextAreaContentWidget", "QuestionText"); }, } }; From 10d0f24f5a9ac7379c5fb59d170e66d514ecbd67 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 9 May 2023 15:14:06 -0400 Subject: [PATCH 11/86] WIP update computed and other code. --- .../textarea-question/textarea-question.vue | 57 +++++++++++++++++-- .../customer-details/customer-details.vue | 2 +- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index ffea9a713..fbe0e1f78 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -1,6 +1,8 @@ diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 616132532..a7c2c1701 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -1,5 +1,5 @@ + + diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index cfda9f3b4..ff27ebddd 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -93,6 +93,9 @@ export default { .textarea-question { display: flex; flex-direction: column; + label { + color: $black; + } .label-wrapper { display: flex; align-items: center; diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index a7c2c1701..689f87ede 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -1,9 +1,17 @@ From b054afaf9abeb95346dce33793d96493ddc2205e Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 16 May 2023 12:55:23 -0400 Subject: [PATCH 19/86] WIP add to customer-details page. --- src/constants/error-messages.js | 2 + .../phonenumber-question.vue | 95 ++++++++++--------- .../textarea-question/textarea-question.vue | 4 +- .../customer-details/customer-details.vue | 79 ++++++++++++--- 4 files changed, 122 insertions(+), 58 deletions(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 810929d20..415647879 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -27,6 +27,8 @@ const errorMessages = { VEHICLE_REQUIRED: "Please select a vehicle", MOBILE_LOCATION_REQUIRED: "Please enter your service address", DATE_REQUIRED: "Please select a date", + PHONE_REQUIRED: "Please enter your phone number", + PHONE_FORMAT: "Phone number must be 10 digits", }; export { errorMessages }; diff --git a/src/digital-components/phonenumber-question/phonenumber-question.vue b/src/digital-components/phonenumber-question/phonenumber-question.vue index 37ce2d2d4..a741fdb68 100644 --- a/src/digital-components/phonenumber-question/phonenumber-question.vue +++ b/src/digital-components/phonenumber-question/phonenumber-question.vue @@ -1,24 +1,33 @@ diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index ff27ebddd..175a4190e 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -27,7 +27,7 @@ From ca05c03fc54e9f7b8c57ee127064befb92f2447a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 16 May 2023 13:27:35 -0400 Subject: [PATCH 20/86] WIP update focus and hover styles. --- .../phonenumber-question/phonenumber-question.vue | 6 +++--- .../textarea-question/textarea-question.vue | 6 +++--- src/layouts/customer-details/customer-details.vue | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/digital-components/phonenumber-question/phonenumber-question.vue b/src/digital-components/phonenumber-question/phonenumber-question.vue index a741fdb68..9057510d8 100644 --- a/src/digital-components/phonenumber-question/phonenumber-question.vue +++ b/src/digital-components/phonenumber-question/phonenumber-question.vue @@ -102,13 +102,13 @@ export default { border-radius: 0.5rem; border: 1px solid $gray-500; height: 48px; - &:hover { - box-shadow: 0 0 0 4px #9fcee6; - } &:focus { box-shadow: 0 0 0 2.5px $blue; outline: none; } + &:hover { + box-shadow: 0 0 0 4px $blue-300; + } } } diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index 175a4190e..4e26ff048 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -109,13 +109,13 @@ export default { border-radius: 0.5rem; border: 1px solid $gray-500; height: 88px; - &:hover { - box-shadow: 0 0 0 4px #9fcee6; - } &:focus { box-shadow: 0 0 0 2.5px $blue; outline: none; } + &:hover { + box-shadow: 0 0 0 4px $blue-300; + } } p { color: $gray-500; diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index d108fbd42..c1e8c0031 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -51,6 +51,7 @@ import { errorMessages } from "@/constants/error-messages"; import { routerParams } from "@/router/router-constants/router-params"; import { required, regex } from "@/helpers/validation-rules"; import { Form, defineRule } from "vee-validate"; +import { useField, validate } from "vee-validate"; // DEFINE VALIDATION RULES defineRule("first-name-required", required(errorMessages.FIRST_NAME_REQUIRED)); @@ -86,6 +87,20 @@ export default { vm.setCmsContent(resultMap.cmsContent); }); }, + setup(props) { + const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField( + props.validationRules, + ); + + return { + errorMessage, + handleBlur, + handleChange, + validate, + meta, + errors, + }; + }, data() { return { techNotes: "", From eb70fda412b241524828156b00ae18b889c9d744 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 17 May 2023 08:36:40 -0400 Subject: [PATCH 21/86] WIP update validation for phone. --- .../phonenumber-question.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/digital-components/phonenumber-question/phonenumber-question.vue b/src/digital-components/phonenumber-question/phonenumber-question.vue index 9057510d8..89b0387f5 100644 --- a/src/digital-components/phonenumber-question/phonenumber-question.vue +++ b/src/digital-components/phonenumber-question/phonenumber-question.vue @@ -22,12 +22,15 @@ From 59f4c0d7ccf03ac6b10443146cb9bbd00dfd76a6 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 17 May 2023 14:40:06 -0400 Subject: [PATCH 23/86] Update validation. --- .../phonenumber-question.vue | 17 +++++++++- .../customer-details/customer-details.vue | 34 ++++++------------- src/styles/common-error-styles.scss | 3 +- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/digital-components/phonenumber-question/phonenumber-question.vue b/src/digital-components/phonenumber-question/phonenumber-question.vue index 89b0387f5..c1c39a971 100644 --- a/src/digital-components/phonenumber-question/phonenumber-question.vue +++ b/src/digital-components/phonenumber-question/phonenumber-question.vue @@ -1,11 +1,18 @@