CSR-297 bug fixes

This commit is contained in:
CarlNation 2022-03-03 14:09:31 -05:00
parent bd08341dde
commit 9dc96ba9e8
3 changed files with 14 additions and 31 deletions

View file

@ -132,7 +132,7 @@ export default {
}, },
async forwardButtonAction() { async forwardButtonAction() {
var windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ? const windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ?
this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null; this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null;
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
@ -143,7 +143,7 @@ export default {
store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace()); store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace());
var partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS, const partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS,
{ carId: store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false); { carId: store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false);
this.navigateForward(partsData); this.navigateForward(partsData);
@ -158,14 +158,12 @@ export default {
//found multiple parts for a single glass location (Windshield, Driver, Passenger, Rear) //found multiple parts for a single glass location (Windshield, Driver, Passenger, Rear)
if (partsData.data.partsOrQuestions){ if (partsData.data.partsOrQuestions){
var multiParts = false; for (var i = 0; i < partsData.data.partsOrQuestions.length; i++){
partsData.data.partsOrQuestions.forEach(pq => { if (partsData.data.partsOrQuestions[i].parts != null && partsData.data.partsOrQuestions[i].parts.length > 1){
if (pq.parts != null && pq.parts.length > 1){
this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, this.$route, {}, {}, partsData.data); this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, this.$route, {}, {}, partsData.data);
multiParts = true; return;
}
} }
});
if (multiParts) return;
} }
//if not a repair then there should only be 1 part and no problem questions at this point so save the part to the store. //if not a repair then there should only be 1 part and no problem questions at this point so save the part to the store.
@ -177,7 +175,7 @@ export default {
}, },
selectedGlassToReplace() { selectedGlassToReplace() {
var selectedGlassToReplace = []; const selectedGlassToReplace = [];
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){ if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => { this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
selectedGlassToReplace.push({ location: damageLocationsParts.WINDSHIELD, name: wsItem}); selectedGlassToReplace.push({ location: damageLocationsParts.WINDSHIELD, name: wsItem});

View file

@ -61,19 +61,14 @@ const routingTable = [
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART,
destinationFmgPageValue: fmgPageValues.REVEAL, destinationFmgPageValue: fmgPageValues.REVEAL,
}, },
],
},
{
fmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
},
{ {
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, scenario: navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS,
destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
}, },
{
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
},
], ],
}, },
{ {
@ -89,19 +84,6 @@ const routingTable = [
}, },
], ],
}, },
{
fmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
},
{
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
},
],
},
]; ];
export { routingTable }; export { routingTable };

View file

@ -68,6 +68,9 @@ export const mutations = {
}, },
updateIsRepair(state, isRepair){ updateIsRepair(state, isRepair){
state.order.damage.isRepair = isRepair; state.order.damage.isRepair = isRepair;
if (!isRepair){
this.commit(storeMutations.UPDATE_NUMBER_OF_CHIPS, null);
}
}, },
updateNumberOfChips(state, numberOfChips){ updateNumberOfChips(state, numberOfChips){
state.order.damage.numberOfChips = numberOfChips; state.order.damage.numberOfChips = numberOfChips;