INSR-10489: Added state specific text to payment method page
This commit is contained in:
parent
b69092a716
commit
3bc87fd128
1 changed files with 20 additions and 2 deletions
|
|
@ -19,6 +19,10 @@
|
|||
<siteSubHeader
|
||||
class="subheader"
|
||||
cmsWidgetName="SiteSubHeaderWidget" />
|
||||
<textBlock
|
||||
v-if="stateSpecificText"
|
||||
class="subheader-secondary"
|
||||
:customText="stateSpecificText" />
|
||||
<div class="main-content-container">
|
||||
<hr class="section-divider" />
|
||||
<reviewDropdown
|
||||
|
|
@ -138,7 +142,7 @@ import buttonMain from '@/ux-components/button-main/button-main.vue';
|
|||
// Supporting Items
|
||||
import settleAllPromises from '@/helpers/layout-helper';
|
||||
import { useMainStore } from '@/store';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { fetchCmsContentForPage, processIfStatements } from '@/helpers/cms-content-helper';
|
||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||
import queryStrings from '@/constants/query-strings';
|
||||
import globalRules from '@/constants/global-rules';
|
||||
|
|
@ -214,7 +218,8 @@ export default {
|
|||
smsOptInQuestion: 'SMSOptInQuestionWidget',
|
||||
smsPhoneNumber: 'SMSPhoneNumberWidget',
|
||||
smsDisclaimer: 'SMSDisclaimerWidget',
|
||||
wiperOffer: 'WiperOfferPanelWidget'
|
||||
wiperOffer: 'WiperOfferPanelWidget',
|
||||
stateSpecificText: 'StateSpecificTextWidget'
|
||||
},
|
||||
rules: {
|
||||
optionRequired: globalRules.OPTION_REQUIRED,
|
||||
|
|
@ -317,6 +322,13 @@ export default {
|
|||
body: wiperBody,
|
||||
edit: wiperEdit
|
||||
};
|
||||
},
|
||||
stateSpecificText() {
|
||||
const stateSpecificText = this.getCmsContent(this.widget.stateSpecificText, widgetFields.TEXT_BLOCK_WIDGET.TEXT);
|
||||
if (stateSpecificText) {
|
||||
return processIfStatements(stateSpecificText, 'custom', this.getStateSpecificText);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -569,6 +581,12 @@ export default {
|
|||
d
|
||||
}
|
||||
this.pushEventToGA('Submit Appointment', action, label, true, null, 1);
|
||||
},
|
||||
getStateSpecificText(value) {
|
||||
if(value.includes('not')) {
|
||||
return !value?.toLowerCase().includes(this.mainStore.order.customer.address.state?.toLowerCase())
|
||||
}
|
||||
return this.mainStore.order.customer.address.state?.toLowerCase() === value?.toLowerCase();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue