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
|
<siteSubHeader
|
||||||
class="subheader"
|
class="subheader"
|
||||||
cmsWidgetName="SiteSubHeaderWidget" />
|
cmsWidgetName="SiteSubHeaderWidget" />
|
||||||
|
<textBlock
|
||||||
|
v-if="stateSpecificText"
|
||||||
|
class="subheader-secondary"
|
||||||
|
:customText="stateSpecificText" />
|
||||||
<div class="main-content-container">
|
<div class="main-content-container">
|
||||||
<hr class="section-divider" />
|
<hr class="section-divider" />
|
||||||
<reviewDropdown
|
<reviewDropdown
|
||||||
|
|
@ -138,7 +142,7 @@ import buttonMain from '@/ux-components/button-main/button-main.vue';
|
||||||
// Supporting Items
|
// Supporting Items
|
||||||
import settleAllPromises from '@/helpers/layout-helper';
|
import settleAllPromises from '@/helpers/layout-helper';
|
||||||
import { useMainStore } from '@/store';
|
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 { paymentMethods } from '@/constants/payment-method-constants';
|
||||||
import queryStrings from '@/constants/query-strings';
|
import queryStrings from '@/constants/query-strings';
|
||||||
import globalRules from '@/constants/global-rules';
|
import globalRules from '@/constants/global-rules';
|
||||||
|
|
@ -214,7 +218,8 @@ export default {
|
||||||
smsOptInQuestion: 'SMSOptInQuestionWidget',
|
smsOptInQuestion: 'SMSOptInQuestionWidget',
|
||||||
smsPhoneNumber: 'SMSPhoneNumberWidget',
|
smsPhoneNumber: 'SMSPhoneNumberWidget',
|
||||||
smsDisclaimer: 'SMSDisclaimerWidget',
|
smsDisclaimer: 'SMSDisclaimerWidget',
|
||||||
wiperOffer: 'WiperOfferPanelWidget'
|
wiperOffer: 'WiperOfferPanelWidget',
|
||||||
|
stateSpecificText: 'StateSpecificTextWidget'
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
optionRequired: globalRules.OPTION_REQUIRED,
|
optionRequired: globalRules.OPTION_REQUIRED,
|
||||||
|
|
@ -317,6 +322,13 @@ export default {
|
||||||
body: wiperBody,
|
body: wiperBody,
|
||||||
edit: wiperEdit
|
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: {
|
watch: {
|
||||||
|
|
@ -569,6 +581,12 @@ export default {
|
||||||
d
|
d
|
||||||
}
|
}
|
||||||
this.pushEventToGA('Submit Appointment', action, label, true, null, 1);
|
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