From 2eb2d84ba607af39f93c09963f70f9aac8d4bfb5 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 2 Feb 2022 14:43:15 -0500 Subject: [PATCH 1/4] Updating name for button question emit method --- src/common-components/button-question/button-question.vue | 2 +- .../list-button-horizontal/list-button-horizontal.vue | 7 +++++-- src/ux-components/list-button/list-button.vue | 2 +- src/ux-components/list-card/list-card.vue | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 13cb43240..6031061ab 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -11,7 +11,7 @@ :is="buttonType" v-for="answer in answers" :key="answer.Name ? answer.Name : answer" - @isChecked="handleCheckedChanged" + @isCheckedChanged="handleCheckedChanged" :buttonID="answer.Name ? answer.Name : answer" :value="answer.Name ? answer.Name : answer" :buttonLabel="answer.Text ? answer.Text : answer" diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index 652102f64..967523893 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -69,7 +69,7 @@ export default { type: String, default: "", }, - modelValue: false, + modelValue: [Array, String], }, data() { return { @@ -77,6 +77,9 @@ export default { checkValue: Boolean, }; }, + created(){ + this.checkValue = this.modelValue ? this.modelValue.includes(this.buttonID) : false; + }, methods: { displayLoader() { this.isLoaderDisplayed = true; @@ -90,7 +93,7 @@ export default { }, watch: { checkValue(){ - this.$emit('isChecked', {isChecked: this.checkValue, buttonId: this.buttonID}); + this.$emit('isCheckedChanged', {isChecked: this.checkValue, buttonId: this.buttonID}); } }, components: { diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue index f95c19696..449f464af 100644 --- a/src/ux-components/list-button/list-button.vue +++ b/src/ux-components/list-button/list-button.vue @@ -95,7 +95,7 @@ export default { }, watch: { checkValue(){ - this.$emit('isChecked', {isChecked: this.checkValue, buttonId: this.buttonID}); + this.$emit('isCheckedChanged', {isChecked: this.checkValue, buttonId: this.buttonID}); } }, components: { diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index b6b906ca2..a6e2968b9 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -95,7 +95,7 @@ export default { }, watch: { checkValue(){ - this.$emit('isChecked', {isChecked: this.checkValue, buttonId: this.buttonID}); + this.$emit('isCheckedChanged', {isChecked: this.checkValue, buttonId: this.buttonID}); } }, setup(props) { From 952969291f2bf9c9f8166fff5bd6a886d76cc3b1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 2 Feb 2022 14:54:37 -0500 Subject: [PATCH 2/4] CSR-268: few small fixes --- src/common-components/funnel-footer/funnel-footer.vue | 6 +++--- .../list-button-horizontal/list-button-horizontal.vue | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index 90c380b08..05c184b5c 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -65,6 +65,9 @@ export default { this.$nextTick(() => { window.addEventListener('resize', this.onResize); }) + setTimeout(function(){ // Give it a moment to set the date + document.getElementById('years').innerHTML += new Date().getFullYear(); + }, 100); }, beforeUnmount() { window.removeEventListener('resize', this.onResize); @@ -75,7 +78,4 @@ export default { } } }; -setTimeout(function(){ // Give it a moment to set the date - document.getElementById('years').innerHTML += new Date().getFullYear(); -}, 100); diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index 652102f64..40a0d262a 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -69,7 +69,7 @@ export default { type: String, default: "", }, - modelValue: false, + modelValue: [Array, String], }, data() { return { @@ -77,6 +77,9 @@ export default { checkValue: Boolean, }; }, + created(){ + this.checkValue = this.modelValue ? this.modelValue.includes(this.buttonID) : false; + }, methods: { displayLoader() { this.isLoaderDisplayed = true; From 266137f871625994c68c74ff79cfba4ccd122827 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 2 Feb 2022 16:27:47 -0500 Subject: [PATCH 3/4] changing check change method to take specific value --- src/common-components/button-question/button-question.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 6031061ab..7b9654139 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -108,13 +108,14 @@ export default { if(Array.isArray(this.answers) && this.answers.length === 1) { this.modelValueAnswers.push(typeof(this.answers[0]) === 'object' ? this.answers[0].Name : this.answers[0]); this.$emit("update:modelValue", this.modelValueAnswers); - }; + } }, methods: { handleCheckedChanged(val) { // Add or remove item to array of data to emit val.isChecked ? this.modelValueAnswers.push(val.buttonId) : this.modelValueAnswers.splice(this.modelValueAnswers.indexOf(val.buttonId), 1); - this.$emit("update:modelValue", this.modelValueAnswers.length ? this.modelValueAnswers : undefined); + const answersToEmit = this.modelValueAnswers.length ? this.modelValueAnswers : undefined; + this.$emit("update:modelValue", answersToEmit); }, }, components: { From b46be8a54de8ed164d9f49b528ebc14da8fde01b Mon Sep 17 00:00:00 2001 From: bmauger Date: Wed, 2 Feb 2022 16:56:57 -0500 Subject: [PATCH 4/4] Fix console error. --- src/ux-components/list-card/list-card.vue | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index a6e2968b9..7010ee487 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -1,32 +1,32 @@