Merge pull request #1247 from Safelite/feature/humphries/INSR-9816
INSR-9816: Update customer review component to be more reactive
This commit is contained in:
commit
9c2a035124
1 changed files with 15 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import reviewBlock from '@/layouts/payment-method/review-dropdown/review-block/review-block.vue';
|
import reviewBlock from '@/layouts/payment-method/review-dropdown/review-block/review-block.vue';
|
||||||
|
import { getStringWithCustomValues, processIfStatements } from '@/helpers/cms-content-helper';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'customer-review',
|
name: 'customer-review',
|
||||||
|
|
@ -21,13 +22,26 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
displayContent() {
|
displayContent() {
|
||||||
return [this.getCmsContent(this.cmsWidgetName, 'BodyText')];
|
const contentFromCms = this.getCmsContent(this.cmsWidgetName, 'BodyText');
|
||||||
|
const processedIfStatementsContent = processIfStatements(
|
||||||
|
contentFromCms,
|
||||||
|
'custom',
|
||||||
|
(str) => this.customValueMap[str]
|
||||||
|
);
|
||||||
|
return [getStringWithCustomValues(processedIfStatementsContent, this.customValueMap)];
|
||||||
},
|
},
|
||||||
header() {
|
header() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'HeaderText');
|
return this.getCmsContent(this.cmsWidgetName, 'HeaderText');
|
||||||
},
|
},
|
||||||
editLinkText() {
|
editLinkText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'FooterText');
|
return this.getCmsContent(this.cmsWidgetName, 'FooterText');
|
||||||
|
},
|
||||||
|
customValueMap() {
|
||||||
|
return {
|
||||||
|
homePhone: this.mainStore.contactInfo.homePhone ?? '',
|
||||||
|
extension: this.mainStore.contactInfo.extension ?? '',
|
||||||
|
emailAddress: this.mainStore.contactInfo.emailAddress ?? ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue