Changing cms retrieval methods
This commit is contained in:
parent
c007430e63
commit
a2008021c7
3 changed files with 20 additions and 6 deletions
|
|
@ -51,6 +51,7 @@ export default {
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const fieldOptions = {
|
const fieldOptions = {
|
||||||
|
|
@ -85,6 +86,9 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
questionTextNew(){
|
||||||
|
return this.getCmsContent(this.cmsWidgetName).QuestionText ? this.getCmsContent(this.cmsWidgetName).QuestionText : '';
|
||||||
|
},
|
||||||
value: {
|
value: {
|
||||||
get: function() {
|
get: function() {
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
|
|
@ -95,7 +99,7 @@ export default {
|
||||||
},
|
},
|
||||||
labelText: {
|
labelText: {
|
||||||
get: function () {
|
get: function () {
|
||||||
let labelText = this.questionText;
|
let labelText = this.questionTextNew;
|
||||||
if (this.disableAutoFill) {
|
if (this.disableAutoFill) {
|
||||||
var noBreakChar = "⁠";
|
var noBreakChar = "⁠";
|
||||||
var position = 1;
|
var position = 1;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<funnelSubHeader ref="funnelSubHeader" />
|
<funnelSubHeader ref="funnelSubHeader" />
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion ref="LicensePlateNumber" v-model="licensePlate" inputId="license_plate" disableAutoFill validationRules="license-plate-required" />
|
<textboxQuestion ref="LicensePlateNumber" cmsWidgetName="LicensePlateNumber" v-model="licensePlate" inputId="license_plate" disableAutoFill validationRules="license-plate-required" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
/>
|
/>
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion v-if="newServiceZipRequired" questionText="Service area ZIP code" v-model="serviceZip" inputId="serviceZip" disableAutoFill validationRules="zip-required" />
|
<textboxQuestion v-if="newServiceZipRequired" v-model="serviceZip" inputId="serviceZip" disableAutoFill validationRules="zip-required" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<funnelFooter
|
<funnelFooter
|
||||||
|
|
@ -92,6 +92,7 @@ export default {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
|
|
||||||
// Settle promises and get results
|
// Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
|
|
@ -104,6 +105,7 @@ export default {
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
|
vm.setCmsContent(resultMap);
|
||||||
vm.$refs.funnelHeader.initializeComponent(
|
vm.$refs.funnelHeader.initializeComponent(
|
||||||
resultMap.cmsContent.FunnelHeaderWidget
|
resultMap.cmsContent.FunnelHeaderWidget
|
||||||
);
|
);
|
||||||
|
|
@ -127,8 +129,8 @@ export default {
|
||||||
);
|
);
|
||||||
vm.noServiceZipWidget = {
|
vm.noServiceZipWidget = {
|
||||||
headline: resultMap.cmsContent.NoServiceZipWidget.HeadlineText,
|
headline: resultMap.cmsContent.NoServiceZipWidget.HeadlineText,
|
||||||
copy: resultMap.cmsContent.NoServiceZipWidget.BodyText
|
copy: resultMap.cmsContent.NoServiceZipWidget.BodyText,
|
||||||
};
|
};
|
||||||
vm.noMatchAlertWidget = {
|
vm.noMatchAlertWidget = {
|
||||||
headline: resultMap.cmsContent.NoMatchAlertWidget.HeadlineText,
|
headline: resultMap.cmsContent.NoMatchAlertWidget.HeadlineText,
|
||||||
copy: resultMap.cmsContent.NoMatchAlertWidget.BodyText
|
copy: resultMap.cmsContent.NoMatchAlertWidget.BodyText
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,17 @@ import { vehicleCategories } from "@/constants/vehicle-categories.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
cmsContentByWidget: {}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
setCmsContent(cmsContent){
|
||||||
|
this.$root.cmsContentByWidget = cmsContent;
|
||||||
|
},
|
||||||
|
getCmsContent(widgetName){
|
||||||
|
return this.$root === undefined ? null : this.$root.cmsContentByWidget.cmsContent[widgetName];
|
||||||
|
},
|
||||||
dispatchNonBlockingStoreAction(type, payload, encodePayload = true) {
|
dispatchNonBlockingStoreAction(type, payload, encodePayload = true) {
|
||||||
// Encode the payload if required
|
// Encode the payload if required
|
||||||
if (encodePayload) {
|
if (encodePayload) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue