diff --git a/src/common-components/button-question/button-question.spec.js b/src/common-components/button-question/button-question.spec.js
index 9cd9307db..799df76a5 100644
--- a/src/common-components/button-question/button-question.spec.js
+++ b/src/common-components/button-question/button-question.spec.js
@@ -117,8 +117,7 @@ describe("buttonQuestion.vue", () => {
const wrapper = shallowMount(buttonQuestion, setupMocks({propsData: {groupName: "group-name"}}));
await wrapper.setProps({
answers: ["2022", "2021", "2020"],
- isMultiSelect: false,
- modelValue: []
+ isMultiSelect: false
});
const val = { checkValue: true, value: "2021", }
wrapper.vm.handleCheckedChanged(val);
diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue
index 2ea6d1c3a..7556f11d1 100644
--- a/src/common-components/button-question/button-question.vue
+++ b/src/common-components/button-question/button-question.vue
@@ -35,7 +35,6 @@
data-test="button"
:validationRules="validationRules"
:class="[suppressError ? 'alertError' : '']"
- :clearOnUnmount="clearOnUnmount"
/>
{{ alertHeadline }}
@@ -54,7 +54,15 @@ export default { alert-info (blue) */ alertClass: String, - cmsWidgetName: String, + cmsWidgetName: { + type: String, + default(rawProps) { + if (!rawProps.cmsWidgetName) { + console.log('Error: Missing a CMS Widget Name (required field)'); + } + return 'widgetUndefined'; + }, + }, manualHeadline: String, manualCopy: String, shouldScrollToOnMount: { @@ -64,10 +72,10 @@ export default { }, computed: { alertHeadline(){ - return this.cmsWidgetName ? this.getCmsContent(this.cmsWidgetName, 'HeadlineText') : this.manualHeadline; + return this.manualHeadline ? this.manualHeadline : this.getCmsContent(this.cmsWidgetName, 'HeadlineText'); }, alertCopy(){ - return this.cmsWidgetName ? this.getCmsContent(this.cmsWidgetName, 'BodyText') : this.manualCopy; + return this.manualCopy ? this.manualCopy : this.getCmsContent(this.cmsWidgetName, 'BodyText'); }, splitAlertCopyForParagraphTag(){ return splitCMSCopyOnParagraphTag(this.alertCopy); 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 49978aa1e..2fef5119f 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -78,10 +78,6 @@ export default { validationRules: String, selectedValues: [Array, String], hasError: Boolean, - clearOnUnmount: { - type: Boolean, - default: true - } }, data() { return { @@ -96,11 +92,9 @@ export default { : this.selectedValues[0]; } }, - unmounted() { // needed to clear this button's selectedValues if it is removed to keep validation in sync - if (this.clearOnUnmount) { - this.checkValue = false; - this.handleCheckChange(); - } + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); }, methods: { displayLoader() { diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue index 0c347de52..c560006cf 100644 --- a/src/ux-components/list-button/list-button.vue +++ b/src/ux-components/list-button/list-button.vue @@ -77,10 +77,6 @@ export default { validationRules: String, selectedValues: [Array, String], hasError: Boolean, - clearOnUnmount: { - type: Boolean, - default: true - } }, data() { return { @@ -95,11 +91,9 @@ export default { : this.selectedValues[0]; } }, - unmounted() { // needed to clear this button's selectedValues if it is removed to keep validation in sync - if (this.clearOnUnmount) { - this.checkValue = false; - this.handleCheckChange(); - } + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); }, methods: { displayLoader() { diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index de5a1a72f..df79fd07f 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -89,10 +89,6 @@ export default { selectedValues: [Array, String], modelValue: Object, hasError: Boolean, - clearOnUnmount: { - type: Boolean, - default: true - } }, data() { return { @@ -114,11 +110,9 @@ export default { this.checkValue = this.selectedValues == this.value || this.modelValue == this.value; } }, - unmounted() { // needed to clear this button's selectedValues if it is removed to keep validation in sync - if (this.clearOnUnmount) { - this.checkValue = false; - this.handleCheckChange(); - } + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); }, computed: { getLabelClasses() {