Merge pull request #846 from Safelite/feature/CSR-889
CSR-889 | Tech review changes
This commit is contained in:
commit
de51a2728f
4 changed files with 32 additions and 39 deletions
|
|
@ -65,7 +65,9 @@ const storeActions = {
|
||||||
"resetMoldingAndCapabilityQuestionAnswersIfNeeded",
|
"resetMoldingAndCapabilityQuestionAnswersIfNeeded",
|
||||||
SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers",
|
SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers",
|
||||||
SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers",
|
SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers",
|
||||||
SAVE_QUOTE_PAGE_SELECTIONS: "saveQuotePageSelections",
|
SAVE_PAYMENT_TYPE: "savePaymentType",
|
||||||
|
SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
|
||||||
|
SAVE_VAPS: "saveVaps",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { storeActions };
|
export { storeActions };
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ const storeMutations = {
|
||||||
RESET_DAMAGE_STATE: "resetDamageState",
|
RESET_DAMAGE_STATE: "resetDamageState",
|
||||||
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
||||||
RESET_GLASS_PARTS_STATE: "resetGlassPartsState",
|
RESET_GLASS_PARTS_STATE: "resetGlassPartsState",
|
||||||
RESET_SUPPORTING_ITEMS_STATE: "resetSupportingItemsState",
|
|
||||||
RESET_VAPS_STATE: "resetVapsState",
|
|
||||||
RESET_STATE: "resetState",
|
RESET_STATE: "resetState",
|
||||||
RESET_SAVE_SESSION_PROMISE: "resetSaveSessionPromise",
|
RESET_SAVE_SESSION_PROMISE: "resetSaveSessionPromise",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
ref="servicePackage"
|
ref="servicePackage"
|
||||||
cashCmsWidgetName="CashServicePackageQuestionWidget"
|
cashCmsWidgetName="CashServicePackageQuestionWidget"
|
||||||
insuranceCmsWidgetName="InsuranceServicePackageQuestionWidget"
|
insuranceCmsWidgetName="InsuranceServicePackageQuestionWidget"
|
||||||
v-model="selectedPackage"
|
v-model="selectedVaps"
|
||||||
groupName="ServicePackageQuestion"
|
groupName="ServicePackageQuestion"
|
||||||
:availableLineItems="availableLineItems"
|
:availableLineItems="availableLineItems"
|
||||||
:isInsuranceSelected="isInsuranceSelected" />
|
:isInsuranceSelected="isInsuranceSelected" />
|
||||||
|
|
@ -117,7 +117,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isInsuranceSelected: null,
|
isInsuranceSelected: null,
|
||||||
selectedPackage: null,
|
selectedVaps: null,
|
||||||
availableLineItems: null,
|
availableLineItems: null,
|
||||||
supportingItems: null,
|
supportingItems: null,
|
||||||
};
|
};
|
||||||
|
|
@ -140,16 +140,18 @@ export default {
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
vehicleQuestionsMixin.methods.navigateBack(this);
|
vehicleQuestionsMixin.methods.navigateBack(this);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
forwardButtonAction() {
|
||||||
await this.dispatchStoreAction(
|
this.dispatchStoreAction(
|
||||||
this.storeActions.SAVE_QUOTE_PAGE_SELECTIONS,
|
this.storeActions.SAVE_PAYMENT_TYPE,
|
||||||
{
|
this.isInsuranceSelected,
|
||||||
isInsuranceSelected: this.isInsuranceSelected,
|
|
||||||
vapsItemsToAdd: this.selectedPackage,
|
|
||||||
supportingItemsToAdd: this.supportingItems,
|
|
||||||
},
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_SUPPORTING_ITEMS,
|
||||||
|
this.supportingItems,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.selectedVaps, false);
|
||||||
|
|
||||||
//return this.navigateForward();
|
//return this.navigateForward();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -302,12 +302,6 @@ export const mutations = {
|
||||||
state.applicationUser.pageData[fmgPageValues.MOLDING_QUESTIONS] = null;
|
state.applicationUser.pageData[fmgPageValues.MOLDING_QUESTIONS] = null;
|
||||||
state.applicationUser.pageData[fmgPageValues.CAPABILITY_QUESTIONS] = null;
|
state.applicationUser.pageData[fmgPageValues.CAPABILITY_QUESTIONS] = null;
|
||||||
},
|
},
|
||||||
resetSupportingItemsState(state) {
|
|
||||||
state.order.lineItems.supportingItems = null;
|
|
||||||
},
|
|
||||||
resetVapsState(state) {
|
|
||||||
state.order.lineItems.vaps = null;
|
|
||||||
},
|
|
||||||
resetState(state) {
|
resetState(state) {
|
||||||
Object.assign(state, getDefaultState());
|
Object.assign(state, getDefaultState());
|
||||||
},
|
},
|
||||||
|
|
@ -590,19 +584,17 @@ export const actions = {
|
||||||
resetDamageAndDependencies(context) {
|
resetDamageAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_DAMAGE_STATE);
|
context.commit(storeMutations.RESET_DAMAGE_STATE);
|
||||||
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.RESET_VAPS_STATE);
|
context.commit(storeMutations.UPDATE_VAPS, null);
|
||||||
},
|
},
|
||||||
resetRegistrationAndDependencies(context) {
|
resetRegistrationAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_REGISTRATION_STATE);
|
context.commit(storeMutations.RESET_REGISTRATION_STATE);
|
||||||
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.RESET_VAPS_STATE);
|
|
||||||
},
|
},
|
||||||
resetPartsAndDependencies(context) {
|
resetPartsAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.RESET_VAPS_STATE);
|
|
||||||
},
|
},
|
||||||
resetState(context) {
|
resetState(context) {
|
||||||
context.commit(storeMutations.RESET_STATE);
|
context.commit(storeMutations.RESET_STATE);
|
||||||
|
|
@ -1173,6 +1165,7 @@ export const actions = {
|
||||||
if (isDamageChanging) {
|
if (isDamageChanging) {
|
||||||
//Reset dependent state when changing
|
//Reset dependent state when changing
|
||||||
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
context.commit(storeMutations.UPDATE_VAPS, null);
|
||||||
|
|
||||||
// Save new values
|
// Save new values
|
||||||
context.commit(storeMutations.UPDATE_IS_REPAIR, isWindshieldRepair);
|
context.commit(storeMutations.UPDATE_IS_REPAIR, isWindshieldRepair);
|
||||||
|
|
@ -1264,7 +1257,7 @@ export const actions = {
|
||||||
|
|
||||||
if (havePartQuestionAnswersChanged) {
|
if (havePartQuestionAnswersChanged) {
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.UPDATE_MOLDING_QUESTION_ANSWERS, null);
|
context.commit(storeMutations.UPDATE_MOLDING_QUESTION_ANSWERS, null);
|
||||||
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
||||||
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
||||||
|
|
@ -1310,7 +1303,7 @@ export const actions = {
|
||||||
|
|
||||||
if (haveSelectedVehiclePartsChanged) {
|
if (haveSelectedVehiclePartsChanged) {
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.UPDATE_MOLDING_QUESTION_ANSWERS, null);
|
context.commit(storeMutations.UPDATE_MOLDING_QUESTION_ANSWERS, null);
|
||||||
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
||||||
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
||||||
|
|
@ -1340,7 +1333,7 @@ export const actions = {
|
||||||
|
|
||||||
if (haveMoldingQuestionAnswersChanged) {
|
if (haveMoldingQuestionAnswersChanged) {
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
context.commit(storeMutations.UPDATE_CAPABILITY_QUESTION_ANSWERS, null);
|
||||||
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
context.commit(storeMutations.UPDATE_PAGE_DATA, {
|
||||||
page: fmgPageValues.CAPABILITY_QUESTIONS,
|
page: fmgPageValues.CAPABILITY_QUESTIONS,
|
||||||
|
|
@ -1368,7 +1361,7 @@ export const actions = {
|
||||||
|
|
||||||
if (haveCapabilityQuestionAnswersChanged) {
|
if (haveCapabilityQuestionAnswersChanged) {
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
|
|
@ -1377,16 +1370,14 @@ export const actions = {
|
||||||
capabilityQuestionAnswers
|
capabilityQuestionAnswers
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
// Quote Page
|
savePaymentType(context, isInsurance) {
|
||||||
saveQuotePageSelections(
|
context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance);
|
||||||
context,
|
},
|
||||||
{ isInsuranceSelected, vapsItemsToAdd, supportingItemsToAdd }
|
saveSupportingItems(context, supportingItems) {
|
||||||
) {
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
|
||||||
context.commit(storeMutations.RESET_SUPPORTING_ITEMS_STATE);
|
},
|
||||||
context.commit(storeMutations.RESET_VAPS_STATE);
|
saveVaps(context, vaps) {
|
||||||
context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsuranceSelected);
|
context.commit(storeMutations.UPDATE_VAPS, vaps);
|
||||||
context.commit(storeMutations.UPDATE_VAPS, vapsItemsToAdd);
|
|
||||||
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItemsToAdd);
|
|
||||||
},
|
},
|
||||||
// Price order actions
|
// Price order actions
|
||||||
// PLACEHOLDER, WILL CHANGE WHEN PRICING END POINT IS IMPLEMENTED
|
// PLACEHOLDER, WILL CHANGE WHEN PRICING END POINT IS IMPLEMENTED
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue