Added cmsWidgetName attribute to alerts in addressQuestions component to allow 'binding' of the CMS data to the alert

This commit is contained in:
Leah Schumann 2022-04-08 16:17:51 -04:00
parent b5c86c5cd7
commit 1800f596af

View file

@ -22,15 +22,13 @@
</div>
</transition>
<alert ref="alertVerificationWarning" v-show="displayVerificationWarning"
cmsWidgetName="AlertVerificationWarningWidget"
alertClass="alert-warning"
:alertHeadline="alertNotifications?.alertVerification?.headline"
:alertCopy="alertNotifications?.alertVerification?.copy"
v-bind:isDismissible="false"
/>
<alert ref="alertNoMatchWarning" v-show="displayNoMatchWarning"
cmsWidgetName="AlertNoMatchWarningWidget"
alertClass="alert-warning"
:alertHeadline="alertNotifications?.alertNoMatchWarning?.headline"
:alertCopy="alertNotifications?.alertNoMatchWarning?.copy"
v-bind:isDismissible="false"
/>
</template>
@ -41,12 +39,10 @@ import textboxQuestion from "@/common-components/textbox-question/textbox-questi
import dropdownQuestion from "@/common-components/dropdown-question/dropdown-question";
import alert from "@/ux-components/alert/alert";
import { applicationConfig } from "@/constants/application-config.js";
import { computed } from 'vue';
import { defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules";
import { regex } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
//import store from "@/store";
// DEFINE VALIDATION RULES
defineRule("street-address-required", required(errorMessages.STREET_ADDRESS_REQUIRED));
@ -150,20 +146,6 @@ export default ({
},
},
methods: {
initializeComponent(cmsContent) {
// this.$refs.autocomplete.initializeComponent(cmsContent[0].QuestionText);
// this.$refs.city.initializeComponent(cmsContent[1].QuestionText);
// this.$refs.state.initializeComponent(cmsContent[2].QuestionText);
// this.$refs.zip.initializeComponent(cmsContent[3].QuestionText);
// assign alert texts to this component
this.alertHeadlineVerificationWarning = cmsContent[4].HeadlineText;
this.alertCopyVerificationWarning = cmsContent[4].BodyText;
this.alertHeadlineNoMatchWarning = cmsContent[5].HeadlineText;
this.alertCopyNoMatchWarning = cmsContent[5].BodyText;
},
setupAddressLookup() {
const addressField1 = document.getElementById("autocomplete");
const self = this;