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:
AHumphriesSL 2026-05-29 15:20:53 -04:00 committed by GitHub
commit 9c2a035124
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@
<script>
import reviewBlock from '@/layouts/payment-method/review-dropdown/review-block/review-block.vue';
import { getStringWithCustomValues, processIfStatements } from '@/helpers/cms-content-helper';
export default {
name: 'customer-review',
@ -21,13 +22,26 @@ export default {
},
computed: {
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() {
return this.getCmsContent(this.cmsWidgetName, 'HeaderText');
},
editLinkText() {
return this.getCmsContent(this.cmsWidgetName, 'FooterText');
},
customValueMap() {
return {
homePhone: this.mainStore.contactInfo.homePhone ?? '',
extension: this.mainStore.contactInfo.extension ?? '',
emailAddress: this.mainStore.contactInfo.emailAddress ?? ''
}
}
}
};