partial
This commit is contained in:
parent
e820c6b240
commit
941dca6b94
3 changed files with 89 additions and 32 deletions
|
|
@ -37,6 +37,12 @@ export default {
|
|||
},
|
||||
error => {
|
||||
console.error(error);
|
||||
|
||||
//implement if analytics service is down
|
||||
if(endpoint.includes("analytics")){
|
||||
return resolve({data: ""});
|
||||
}
|
||||
|
||||
return reject(error.response);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,14 +8,22 @@
|
|||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeader" id="sub-header" />
|
||||
<button v-on:click="forwardButtonAction">Temp Forward Button</button>
|
||||
<div>
|
||||
<siteFooter
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="isForwardActionDisabled"
|
||||
@backClicked="backButtonAction"
|
||||
@forwardClicked="forwardButtonAction"
|
||||
ref="siteFooter" />
|
||||
</div>
|
||||
|
||||
<buttonQuestion ref="buttonQuestion"
|
||||
:answers="prefAnswers"
|
||||
:groupName="prefQuestions"
|
||||
buttonTypeString="providerPrefRadio"
|
||||
:buttonTypeObject="providerPrefRadio"
|
||||
v-model="selectedProvider"
|
||||
:validationRules="option-required"
|
||||
:isRequired="isRequired" />
|
||||
|
||||
<siteFooter
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="isForwardActionDisabled"
|
||||
@backClicked="backButtonAction"
|
||||
@forwardClicked="forwardButtonAction"
|
||||
ref="siteFooter" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -52,9 +60,11 @@ import { Form,defineRule } from "vee-validate";
|
|||
import siteFooter from "@/iss-components/site-footer/site-footer.vue";
|
||||
import siteHeader from "@/iss-components/site-header/site-header.vue";
|
||||
import siteSubHeader from "@/iss-components/site-sub-header/site-sub-header.vue";
|
||||
import providerPrefRadio from "@/layouts/provider-preference/provider-pref-radio/provider-pref-radio.vue"
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
||||
defineRule('option-required', required(errorMessages.OPTION_REQUIRED));
|
||||
|
||||
export default {
|
||||
name: "provider-preference",
|
||||
mixins: [baseFormMixin],
|
||||
|
|
@ -66,11 +76,12 @@ export default {
|
|||
Form,
|
||||
buttonQuestion,
|
||||
contentGroupModal,
|
||||
modal
|
||||
modal,
|
||||
providerPrefRadio
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
SelectedshopLocation : null,
|
||||
selectedProvider : null,
|
||||
};
|
||||
},
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -89,31 +100,71 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
isForwardActionDisabled() {
|
||||
return this.SelectedshopLocation === null;
|
||||
return this.selectedProvider === null;
|
||||
},
|
||||
|
||||
ProviderPreferenceHeaderText(){
|
||||
return this.getCmsContent("ProviderPreference", "HeaderText");
|
||||
},
|
||||
questionText() {
|
||||
return this.getCmsContent("ProviderPreference", "SubHeaderText");
|
||||
},
|
||||
|
||||
prefAnswers() {
|
||||
const cmsAnswersContent = [
|
||||
{
|
||||
cmsWidgetName: 'SafeliteOption'
|
||||
},
|
||||
{
|
||||
cmsWidgetName: 'TPAOption'
|
||||
}
|
||||
];
|
||||
//if cms content has not yet loaded, skip
|
||||
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
|
||||
return {};
|
||||
}
|
||||
const modifiedAnswers = cmsAnswersContent.map((answer) => ({
|
||||
value: answer.cmsWidgetName,
|
||||
buttonLabel: this.getHeaderTextFromCms(answer.cmsWidgetName),
|
||||
buttonLabelSubCopy: this.getSubheaderTextFromCms(answer.cmsWidgetName),
|
||||
buttonBodyCopy: this.getBodyTextFromCms(answer.cmsWidgetName),
|
||||
buttonFooterCopy: this.getFooterTextFromCms(answer.cmsWidgetName)
|
||||
}
|
||||
));
|
||||
return modifiedAnswers;
|
||||
},
|
||||
|
||||
steeringModalHeader() {
|
||||
let header = this.getCmsContent("StateSteeringModal", "HeaderText");
|
||||
return header.replace("{custom:state}", states[this.mainStore.order.customer.address.state])
|
||||
},
|
||||
steeringModalBody() {
|
||||
const bodyText = this.getCmsContent("StateSteeringModal", "BodyText");
|
||||
return processIfStatements(bodyText, "custom", this.getStateSpecificText);
|
||||
return processIfStatements(bodyText, "custom", this.getStateSpecificText);
|
||||
},
|
||||
steeringModalBody2() {
|
||||
const bodyText = this.getCmsContent("StateSteeringModal", "BodyText2");
|
||||
return processIfStatements(bodyText, "custom", this.getStateSpecificText);
|
||||
return processIfStatements(bodyText, "custom", this.getStateSpecificText);
|
||||
},
|
||||
steeringModalFooter() {
|
||||
return this.getCmsContent("StateSteeringModal", "FooterText");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getHeaderTextFromCms(cmsWidgetName) {
|
||||
return this.getCmsContent(cmsWidgetName, 'HeaderText');
|
||||
},
|
||||
getSubheaderTextFromCms(cmsWidgetName) {
|
||||
return this.getCmsContent(cmsWidgetName, 'SubheaderText');
|
||||
},
|
||||
getBodyTextFromCms(cmsWidgetName) {
|
||||
const bodyText = this.getCmsContent(cmsWidgetName, "BodyText");
|
||||
return processIfStatements(bodyText, "custom", this.getCustomValueFromString);
|
||||
},
|
||||
getFooterTextFromCms(cmsWidgetName) {
|
||||
const footerText = this.getCmsContent(cmsWidgetName, "FooterText");
|
||||
return processIfStatements(footerText, "custom", this.getCustomValueFromString);
|
||||
},
|
||||
getStateSpecificText(value) {
|
||||
return this.mainStore.order.customer.address.state?.toLowerCase() == value?.toLowerCase();
|
||||
},
|
||||
|
|
@ -129,7 +180,7 @@ export default {
|
|||
forwardButtonAction() {
|
||||
//todo
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, this.$route);
|
||||
//if(this.SelectedshopLocation == "Schedule with Safelite")
|
||||
//if(this.selectedProvider == "Schedule with Safelite")
|
||||
//{
|
||||
// this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, this.$route);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -956,24 +956,24 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
logPageView({ userId, sessionKey, pageName, sessionId, action, event, shouldUseSessionId, experimentsForUser })
|
||||
{
|
||||
var payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
action: action,
|
||||
event: event,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser,
|
||||
}
|
||||
var payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
action: action,
|
||||
event: event,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser,
|
||||
}
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogPageView.method,
|
||||
endpoint: endpoints.LogPageView.url,
|
||||
payload: payload,
|
||||
logApiCall: false
|
||||
});
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogPageView.method,
|
||||
endpoint: endpoints.LogPageView.url,
|
||||
payload: payload,
|
||||
logApiCall: false
|
||||
});
|
||||
},
|
||||
logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser})
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue