Merge pull request #1172 from Safelite/CSR-1362-navigate-schedule-to-cust-details
Setup navigation from schedule to customer-details.
This commit is contained in:
commit
1f3cc867a0
9 changed files with 61 additions and 40 deletions
|
|
@ -83,6 +83,7 @@ const storeActions = {
|
|||
SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING:
|
||||
"saveSupportingItemsSuppressingStateResetting",
|
||||
SAVE_VAPS: "saveVaps",
|
||||
SAVE_CUSTOMER_DETAILS: "saveCustomerDetails",
|
||||
};
|
||||
|
||||
export { storeActions };
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ const storeMutations = {
|
|||
|
||||
UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress",
|
||||
|
||||
//CUSTOMER MUTATIONS
|
||||
UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails",
|
||||
|
||||
// ORDER MUTATIONS
|
||||
UPDATE_REFERRAL_NUMBER: "updateReferralNumber",
|
||||
UPDATE_REFERRAL_DATE: "updateReferralDate",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="phonenumber-question d-flex flex-column">
|
||||
<textboxQuestion
|
||||
type="tel"
|
||||
type="text"
|
||||
:max-length="12"
|
||||
v-model="selectedValue"
|
||||
:isRequired="isRequired"
|
||||
|
|
@ -33,44 +33,6 @@ export default {
|
|||
centerErrorMessage: Boolean,
|
||||
modelValue: String,
|
||||
},
|
||||
setup(props) {
|
||||
const inputId = !props.customInputId ? `input-${crypto.randomUUID()}` : props.customInputId;
|
||||
|
||||
const propsClone = Object.assign({}, props);
|
||||
const modelValue = propsClone.modelValue;
|
||||
let initialValue;
|
||||
|
||||
switch (typeof modelValue) {
|
||||
case "number":
|
||||
initialValue = modelValue;
|
||||
break;
|
||||
default:
|
||||
initialValue = modelValue && modelValue.length > 0 ? modelValue : "";
|
||||
break;
|
||||
}
|
||||
|
||||
const fieldOptions = {
|
||||
type: "text",
|
||||
value: modelValue,
|
||||
initialValue: initialValue,
|
||||
};
|
||||
|
||||
const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField(
|
||||
inputId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
);
|
||||
|
||||
return {
|
||||
inputId,
|
||||
errorMessage,
|
||||
handleBlur,
|
||||
handleChange,
|
||||
validate,
|
||||
meta,
|
||||
errors,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "",
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ import { routerParams } from "@/router/router-constants/router-params";
|
|||
import { required, regex } from "@/helpers/validation-rules";
|
||||
import { Form, defineRule } from "vee-validate";
|
||||
import { useField, validate } from "vee-validate";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule("first-name-required", required(errorMessages.FIRST_NAME_REQUIRED));
|
||||
|
|
@ -117,6 +118,17 @@ export default {
|
|||
return this.getCmsContent("TextAreaContentWidget", "QuestionText");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
return true;
|
||||
},
|
||||
backButtonAction() {
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
forwardButtonAction() {
|
||||
navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal });
|
||||
},
|
||||
},
|
||||
components: {
|
||||
funnelHeader,
|
||||
funnelSubHeader,
|
||||
|
|
|
|||
|
|
@ -335,7 +335,11 @@ export default {
|
|||
this.appointmentDateAndTime,
|
||||
false
|
||||
);
|
||||
navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal });
|
||||
//Temporary, still need to determine what needs to be saved before continuing.
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_CUSTOMER_DETAILS,
|
||||
this.$route
|
||||
);
|
||||
},
|
||||
|
||||
updateSupportingItems() {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const fmgPageValues = {
|
|||
SERVICE_LOCATION: "service-location",
|
||||
HERITAGE: "heritage",
|
||||
SCHEDULE: "schedule",
|
||||
CUSTOMER_DETAILS: "customer-details",
|
||||
REVIEW: "review",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ const navigationScenarios = {
|
|||
// Scheduling
|
||||
SELECTED_LOCATION: "SELECTED_LOCATION",
|
||||
|
||||
//Customer details
|
||||
CLICKED_FORWARD_WITH_CUSTOMER_DETAILS: "CLICKED_FORWARD_WITH_CUSTOMER_DETAILS",
|
||||
|
||||
// Review
|
||||
CLICKED_VEHICLE_EDIT: "CLICKED_VEHICLE_EDIT",
|
||||
CLICKED_DAMAGE_EDIT: "CLICKED_DAMAGE_EDIT",
|
||||
|
|
|
|||
|
|
@ -433,6 +433,23 @@ const routingTable = function (store) {
|
|||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationFmgPageValue: fmgPageValues.SERVICE_LOCATION,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_CUSTOMER_DETAILS,
|
||||
destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
fmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationFmgPageValue: fmgPageValues.SCHEDULE,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationFmgPageValue: fmgPageValues.REVIEW,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -446,6 +463,10 @@ const routingTable = function (store) {
|
|||
scenario: navigationScenarios.CLICKED_DAMAGE_EDIT,
|
||||
destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -266,6 +266,16 @@ export const mutations = {
|
|||
state.order.schedule.jobMaxMinutes = scheduleInfo.jobMaxMinutes;
|
||||
}
|
||||
},
|
||||
updateCustomerDetails(state, detailsInfo) {
|
||||
if (detailsInfo) {
|
||||
state.order.customerDetails.firstName = detailsInfo.firstName;
|
||||
state.order.customerDetails.lastName = detailsInfo.lastName;
|
||||
state.order.customerDetails.email = detailsInfo.email;
|
||||
state.order.customerDetails.telephone = detailsInfo.telephone;
|
||||
state.order.customerDetails.textUpdates = detailsInfo.textUpdates;
|
||||
state.order.customerDetails.techNotes = detailsInfo.techNotes;
|
||||
}
|
||||
},
|
||||
|
||||
// applicationUser MUTATIONS
|
||||
updateSaveSessionPromise(state, saveSessionPromise) {
|
||||
|
|
@ -1849,6 +1859,10 @@ export const actions = {
|
|||
context.commit(storeMutations.UPDATE_SCHEDULE, scheduleInfo);
|
||||
},
|
||||
|
||||
saveDetails(context, scheduleInfo) {
|
||||
context.commit(storeMutations.UPDATE_DETAILS, scheduleInfo);
|
||||
},
|
||||
|
||||
saveServiceZipCodeInfo(context, serviceZipCodeInfo) {
|
||||
if (
|
||||
context.state.order.serviceLocation &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue