diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index 7de269644..013a42168 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -2,7 +2,7 @@ @@ -48,6 +49,15 @@ export default { name: "modal", props: { cmsWidgetName: String, + onShownCallback: { + type: Function, + }, + + footerButtonCallback: { + type: Function, + // return true to close modal + // if undefined, footer button closes modal + }, }, computed: { ModalHeadline() { @@ -68,11 +78,26 @@ export default { ModalCloseButtonText() { return this.getCmsContent(this.cmsWidgetName, "FooterText"); }, + showModalBody() { + return this.ModalBodyText; + }, }, methods: { resetButtonStyle() { this.$refs.buttonMain.resetButtonStyle(); }, + closeModal() { + this.$refs.modalXButton.click(); + }, + async footerButtonClick() { + if (this.footerButtonCallback) { + if (await this.footerButtonCallback()) { + this.closeModal(); + } + } else { + this.closeModal(); + } + }, }, components: { buttonMain, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index e29ebdb5e..418a1ec2e 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -4,6 +4,12 @@ fmg
+ // Components +import serviceZipModalQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-modal-question"; import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; -import { Form } from "vee-validate"; -// Supporting files +//Supporting Files +import { Form } from "vee-validate"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -57,6 +64,7 @@ export default { forwardButtonAction() {}, }, components: { + serviceZipModalQuestion, funnelHeader, funnelFooter, funnelSubHeader, diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js new file mode 100644 index 000000000..a81727c73 --- /dev/null +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js @@ -0,0 +1,3 @@ +describe("service-zip-modal-question.vue", () => { + test.todo("test this"); +}); diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue new file mode 100644 index 000000000..1ab55f165 --- /dev/null +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -0,0 +1,199 @@ + + + + +