Updates to use ContentGroup
This commit is contained in:
parent
b18c151dd5
commit
e903a62c51
2 changed files with 29 additions and 91 deletions
|
|
@ -30,18 +30,30 @@ export default {
|
||||||
components: { buttonBack },
|
components: { buttonBack },
|
||||||
props: {
|
props: {
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
|
contentProperty: String,
|
||||||
|
darkGraySubText: Boolean,
|
||||||
hasBackButton: Boolean,
|
hasBackButton: Boolean,
|
||||||
justification: String,
|
|
||||||
issContainingPage: String,
|
issContainingPage: String,
|
||||||
darkGraySubText: Boolean
|
justification: String,
|
||||||
|
stripRteStyle: Boolean,
|
||||||
|
subContentProperty: String
|
||||||
},
|
},
|
||||||
emits: ['click-event'],
|
emits: ['click-event'],
|
||||||
computed: {
|
computed: {
|
||||||
content() {
|
content() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'SubHeaderText');
|
return this.getCmsContent(this.cmsWidgetName, this.contentProperty ?? 'SubHeaderText');
|
||||||
},
|
},
|
||||||
subText() {
|
subText() {
|
||||||
const subText = this.getCmsContent(this.cmsWidgetName, 'SecondaryText');
|
let subText = this.getCmsContent(
|
||||||
|
this.cmsWidgetName,
|
||||||
|
this.subContentProperty ?? 'SecondaryText'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.stripRteStyle) {
|
||||||
|
const regexExp = /[\s*]style="(.*?)"/g;
|
||||||
|
subText = subText.replace(regexExp, '');
|
||||||
|
}
|
||||||
|
|
||||||
return subText ?? '';
|
return subText ?? '';
|
||||||
},
|
},
|
||||||
backButtonAccessibleText() {
|
backButtonAccessibleText() {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,12 @@
|
||||||
justification="left" />
|
justification="left" />
|
||||||
<siteSubHeader
|
<siteSubHeader
|
||||||
v-if="isNoTpa"
|
v-if="isNoTpa"
|
||||||
cmsWidgetName="SiteSubHeaderNoTPAWidget"
|
cmsWidgetName="ContentGroupNoTPAWidget"
|
||||||
class="sub-header-content"
|
class="sub-header-content"
|
||||||
justification="left" />
|
contentProperty="HeaderText"
|
||||||
|
justification="left"
|
||||||
|
:stripRteStyle="true"
|
||||||
|
subContentProperty="BodyText" />
|
||||||
<textboxQuestion
|
<textboxQuestion
|
||||||
inputId="firstNameField"
|
inputId="firstNameField"
|
||||||
cmsWidgetName="FirstNameQuestion"
|
cmsWidgetName="FirstNameQuestion"
|
||||||
|
|
@ -63,11 +66,11 @@ import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question';
|
import textboxQuestion from '@/digital-components/textbox-question/textbox-question';
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
|
||||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
|
||||||
import { Form } from 'vee-validate';
|
|
||||||
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
||||||
|
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||||
|
import { Form } from 'vee-validate';
|
||||||
import globalRules from '@/constants/global-rules';
|
import globalRules from '@/constants/global-rules';
|
||||||
|
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -93,80 +96,6 @@ export default {
|
||||||
];
|
];
|
||||||
// use resultMap to populate layout content.
|
// use resultMap to populate layout content.
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const cmsMoq = {
|
|
||||||
SiteHeaderWidget: {
|
|
||||||
Answers: [
|
|
||||||
{
|
|
||||||
ClientName: 'Generic',
|
|
||||||
AccountNumber: '0',
|
|
||||||
ImageId: '4912b7b6-e403-450e-a837-44b6e30539fa',
|
|
||||||
AnswerImageUrl:
|
|
||||||
'https://digitalisscms.dev.safelite.io/images/default-source/default-album/logos/generic.svg?sfvrsn=4f01888b_1',
|
|
||||||
AltText: 'Logo',
|
|
||||||
HexCode: '#FFFFFF'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ClientName: 'Liberty Mutual',
|
|
||||||
AccountNumber: '550036',
|
|
||||||
ImageId: '4503e012-aa30-4cf8-9210-3f2f6ba63436',
|
|
||||||
AnswerImageUrl:
|
|
||||||
'https://digitalisscms.dev.safelite.io/images/default-source/default-album/logos/liberty-mutual.svg?sfvrsn=49878147_4',
|
|
||||||
AltText: 'Liberty Mutual Logo',
|
|
||||||
HexCode: '#FFD100'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ClientName: 'Bear River',
|
|
||||||
AccountNumber: '569316',
|
|
||||||
ImageId: 'b64b261c-bcf4-4e35-9969-e9909b1b1160',
|
|
||||||
AnswerImageUrl:
|
|
||||||
'https://digitalisscms.dev.safelite.io/images/default-source/default-album/logos/bearriver_logo341d77a6d7b94441af0658338118994c.png?sfvrsn=bba433ab_0',
|
|
||||||
AltText: 'Bear River Logo',
|
|
||||||
HexCode: '#FFFFFF'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ClientName: 'CSE',
|
|
||||||
AccountNumber: '460196',
|
|
||||||
ImageId: 'ce1faddf-d9dd-410e-8564-bfb6893285de',
|
|
||||||
AnswerImageUrl:
|
|
||||||
'https://digitalisscms.dev.safelite.io/images/default-source/default-album/logos/cse_logob36dba292db8489398993dd21c0170d6.png?sfvrsn=a3d5f26c_0',
|
|
||||||
AltText: 'CSE Logo',
|
|
||||||
HexCode: '#FFFFFF'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
SiteSubHeaderWidget: {
|
|
||||||
SubHeaderText: 'Request a callback',
|
|
||||||
SecondaryText: `Please provide your contact details and we'll get back to you soon.`
|
|
||||||
},
|
|
||||||
FirstNameQuestion: {
|
|
||||||
QuestionText: 'First name',
|
|
||||||
ButtonText: '',
|
|
||||||
Answers: []
|
|
||||||
},
|
|
||||||
LastNameQuestion: {
|
|
||||||
QuestionText: 'Last name',
|
|
||||||
ButtonText: '',
|
|
||||||
Answers: []
|
|
||||||
},
|
|
||||||
PhoneNumberQuestion: {
|
|
||||||
QuestionText: 'Phone number',
|
|
||||||
ButtonText: '',
|
|
||||||
Answers: []
|
|
||||||
},
|
|
||||||
EmailAddressQuestion: {
|
|
||||||
QuestionText: 'Email address',
|
|
||||||
ButtonText: '',
|
|
||||||
Answers: []
|
|
||||||
},
|
|
||||||
SiteFooterWidget: {
|
|
||||||
BackButtonText: 'Back',
|
|
||||||
ForwardButtonText: 'Send callback request',
|
|
||||||
FooterImageId: 'b7bb829f-14a3-41c5-91e5-1f4f5dfafc0d',
|
|
||||||
FooterImageURL: ''
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(resultMap);
|
|
||||||
|
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
|
@ -189,7 +118,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isNoTpa() {
|
isNoTpa() {
|
||||||
return false; // not sure what in the data flags this.
|
return true; // not sure what in the data flags this.
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -202,7 +131,6 @@ export default {
|
||||||
},
|
},
|
||||||
navigateForward() {},
|
navigateForward() {},
|
||||||
getBailoutPageModelFromStore() {
|
getBailoutPageModelFromStore() {
|
||||||
console.log(this.mainStore);
|
|
||||||
return {
|
return {
|
||||||
firstName: this.mainStore.order.customer.firstName,
|
firstName: this.mainStore.order.customer.firstName,
|
||||||
lastName: this.mainStore.order.customer.lastName,
|
lastName: this.mainStore.order.customer.lastName,
|
||||||
|
|
@ -232,16 +160,14 @@ $page-side-padding: 1.5rem;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
|
|
||||||
&.new-paragraph {
|
|
||||||
display: block;
|
|
||||||
margin-top: 0.25rem;
|
|
||||||
line-height: 1.5rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue