Merge remote-tracking branch 'origin/feature/CSR-297' into feature/CSR-335
This commit is contained in:
commit
d17f214967
13 changed files with 152 additions and 20 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
:key="answer.Name ? answer.Name : answer"
|
:key="answer.Name ? answer.Name : answer"
|
||||||
@isCheckedChanged="handleCheckedChanged"
|
@isCheckedChanged="handleCheckedChanged"
|
||||||
:buttonID="answer.Name ? groupName + '-' + answer.Name : groupName + '-' + answer"
|
:buttonID="answer.Name ? groupName + '-' + answer.Name : groupName + '-' + answer"
|
||||||
:value="answer.Name ? answer.Name : answer"
|
:value="getValues(answer)"
|
||||||
:buttonLabel="answer.Text ? answer.Text : answer"
|
:buttonLabel="answer.Text ? answer.Text : answer"
|
||||||
:buttonLabelSubCopy="answer.SubText"
|
:buttonLabelSubCopy="answer.SubText"
|
||||||
:textPosition="textPosition"
|
:textPosition="textPosition"
|
||||||
|
|
@ -79,6 +79,7 @@ export default {
|
||||||
modelValue: Array,
|
modelValue: Array,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
suppressError: Boolean,
|
suppressError: Boolean,
|
||||||
|
useTextForValue: Boolean,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getFieldSetClasses() {
|
getFieldSetClasses() {
|
||||||
|
|
@ -121,6 +122,12 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getValues(answer){
|
||||||
|
if (this.useTextForValue){
|
||||||
|
return answer.Text
|
||||||
|
}
|
||||||
|
return answer.Name ? answer.Name : answer;
|
||||||
|
},
|
||||||
handleCheckedChanged(val) {
|
handleCheckedChanged(val) {
|
||||||
if(this.isMultiSelect && this.selectedValues) {
|
if(this.isMultiSelect && this.selectedValues) {
|
||||||
// Add or remove item to array of data to emit
|
// Add or remove item to array of data to emit
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,11 @@ export default {
|
||||||
margin-bottom: .25rem;
|
margin-bottom: .25rem;
|
||||||
}
|
}
|
||||||
.form-select {
|
.form-select {
|
||||||
color: $gray-500;
|
color: $gray-600;
|
||||||
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8.89' xml:space='preserve'%3e%3cpath d='M8 8.89c-.24 0-.46-.09-.63-.26L.26 1.53a.901.901 0 0 1 0-1.27C.43.1.66 0 .9 0s.47.1.64.26L8 6.74 14.47.27c.17-.17.4-.27.64-.27s.47.1.63.27c.17.17.26.4.26.64s-.1.47-.27.63l-7.1 7.09a.86.86 0 0 1-.63.26z' fill='%231474a2'/%3e%3c/svg%3e");
|
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8.89' xml:space='preserve'%3e%3cpath d='M8 8.89c-.24 0-.46-.09-.63-.26L.26 1.53a.901.901 0 0 1 0-1.27C.43.1.66 0 .9 0s.47.1.64.26L8 6.74 14.47.27c.17-.17.4-.27.64-.27s.47.1.63.27c.17.17.26.4.26.64s-.1.47-.27.63l-7.1 7.09a.86.86 0 0 1-.63.26z' fill='%231474a2'/%3e%3c/svg%3e");
|
||||||
border: 1px solid $gray-500;
|
border: 1px solid $gray-500;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
min-height: 3rem;
|
min-height: 3rem;
|
||||||
option[selected] {
|
|
||||||
color: $gray-500;
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
&:focus,
|
&:focus,
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
box-shadow: 0 0 0 2px $blue;
|
box-shadow: 0 0 0 2px $blue;
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@ const endpoints = {
|
||||||
url: "/vehicle/api/v1/vehicle/Lookup",
|
url: "/vehicle/api/v1/vehicle/Lookup",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
|
GetPartsOrQuestions: {
|
||||||
|
url: "/parts/api/v1/parts/parts-or-questions",
|
||||||
|
method: "POST",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export { endpoints };
|
export { endpoints };
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ const storeMutations = {
|
||||||
UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl",
|
UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl",
|
||||||
UPDATE_VEHICLE_IMAGE_VIF_NUMBER: "updateVehicleImageVifNumber",
|
UPDATE_VEHICLE_IMAGE_VIF_NUMBER: "updateVehicleImageVifNumber",
|
||||||
UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor",
|
UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor",
|
||||||
|
UPDATE_IS_REPAIR: "updateIsRepair",
|
||||||
|
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
||||||
|
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
|
||||||
|
|
||||||
// EVENT BUS MUTATIONS
|
// EVENT BUS MUTATIONS
|
||||||
ADD_EVENT_TO_BUS: "addEventToBus",
|
ADD_EVENT_TO_BUS: "addEventToBus",
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export default ({
|
||||||
},
|
},
|
||||||
updateSelectedValues() {
|
updateSelectedValues() {
|
||||||
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
// UPDATE SELECTEDVALUES IF ONLY ONE ANSWER
|
||||||
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1 && this.selectedValues) {
|
if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) {
|
||||||
this.selectedValues = [this.answersToDisplay[0].Name];
|
this.selectedValues = [this.answersToDisplay[0].Name];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,10 @@ export default ({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isDriverSideReplaceOptionsQuestionAvailable(){
|
isDriverSideReplaceOptionsQuestionAvailable(){
|
||||||
return Array.isArray(this.selectedDoorSidesValues) && this.selectedDoorSidesValues.includes("DriverSide");
|
return (Array.isArray(this.selectedDoorSidesValues) && this.selectedDoorSidesValues.includes("DriverSide") && (Array.isArray(this.selectedDamageLocations) && this.selectedDamageLocations.includes("SideDoor")));
|
||||||
},
|
},
|
||||||
isPassengerSideReplaceOptionsQuestionAvailable(){
|
isPassengerSideReplaceOptionsQuestionAvailable(){
|
||||||
return Array.isArray(this.selectedDoorSidesValues) && this.selectedDoorSidesValues.includes("PassengerSide");
|
return (Array.isArray(this.selectedDoorSidesValues) && this.selectedDoorSidesValues.includes("PassengerSide") && (Array.isArray(this.selectedDamageLocations) && this.selectedDamageLocations.includes("SideDoor")));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
v-model="selectedRearReplaceOptions"
|
v-model="selectedRearReplaceOptions"
|
||||||
groupName="BackGlassReplaceOptionsQuestion"
|
groupName="BackGlassReplaceOptionsQuestion"
|
||||||
/>
|
/>
|
||||||
<funnelFooter ref="funnelFooter" @back-clicked="backButtonAction" />
|
<funnelFooter ref="funnelFooter" @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -41,6 +41,7 @@ import windshieldOptions from "@/layouts/vehicle-damage/windshield-options/winds
|
||||||
import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-question/replace-options-question";
|
import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-question/replace-options-question";
|
||||||
|
|
||||||
// Supporting files
|
// Supporting files
|
||||||
|
import { routerParameterKeys } from "@/router/router-constants/router-parameter-keys";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
|
@ -102,14 +103,6 @@ export default {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
isRearWindowDamageLocation() {
|
|
||||||
return this.selectedDamageLocations.some(selectedDamages =>
|
|
||||||
{
|
|
||||||
return selectedDamages.toUpperCase() === "REARWINDOW";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
selectedDamageLocations: [],
|
selectedDamageLocations: [],
|
||||||
|
|
@ -137,7 +130,99 @@ export default {
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
async forwardButtonAction() {
|
||||||
|
var windshieldChipCount = this.selectedWindshieldOptions.selectedWindshieldChipCount && this.isWindshieldDamageLocation ?
|
||||||
|
this.selectedWindshieldOptions.selectedWindshieldChipCount[0] : null;
|
||||||
|
|
||||||
|
this.$store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
|
||||||
|
|
||||||
|
if (windshieldChipCount){
|
||||||
|
this.$store.commit(this.storeMutations.UPDATE_NUMBER_OF_CHIPS, parseInt(windshieldChipCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace());
|
||||||
|
|
||||||
|
const partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS,
|
||||||
|
{ carId: this.$store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false);
|
||||||
|
|
||||||
|
this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_GLASS_MULTIPLE_PARTS, this.$route, { [routerParameterKeys.VEHICLE_PARTS_DATA]: partsData});
|
||||||
|
},
|
||||||
|
|
||||||
|
selectedGlassToReplace() {
|
||||||
|
var selectedGlassToReplace = [];
|
||||||
|
if (this.isWindshieldDamageLocation && !this.isWindshieldRepair){
|
||||||
|
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.forEach(wsItem => {
|
||||||
|
selectedGlassToReplace.push({ location: "Windshield", name: wsItem});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isDriverSideReplace){
|
||||||
|
this.sideDoorOptionsData.selectedDriverSideReplaceOptions.forEach(driverItem => {
|
||||||
|
selectedGlassToReplace.push({ location: "Driver", name: driverItem});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isPassengerSideReplace){
|
||||||
|
this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.forEach(passengerItem => {
|
||||||
|
selectedGlassToReplace.push({ location: "Passenger", name: passengerItem});
|
||||||
|
})
|
||||||
|
selectedGlassToReplace = Array.prototype.concat.apply([], [selectedGlassToReplace, this.sideDoorOptionsData.selectedDoorSides.selectedPassengerSideReplaceOptions]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isRearWindowDamageLocation) {
|
||||||
|
this.selectedRearReplaceOptions.forEach(rearItem => {
|
||||||
|
selectedGlassToReplace.push({ location: "Rear", name: rearItem});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedGlassToReplace;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
isWindshieldDamageLocation() {
|
||||||
|
return this.selectedDamageLocations.some(selectedDamages =>
|
||||||
|
{
|
||||||
|
return selectedDamages.toUpperCase() === "WINDSHIELD";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isSideDoorDamageLocation() {
|
||||||
|
return this.selectedDamageLocations.some(selectedDamages =>
|
||||||
|
{
|
||||||
|
return selectedDamages.toUpperCase() === "SIDEDOOR";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isRearWindowDamageLocation() {
|
||||||
|
return this.selectedDamageLocations.some(selectedDamages =>
|
||||||
|
{
|
||||||
|
return selectedDamages.toUpperCase() === "REARWINDOW";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isWindshieldRepair() {
|
||||||
|
if (!this.isWindshieldDamageLocation) return false;
|
||||||
|
|
||||||
|
return this.selectedWindshieldOptions.selectedWindshieldDamageType.some(selectedDamageType =>
|
||||||
|
{
|
||||||
|
return selectedDamageType.toUpperCase() === "REPAIR";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isDriverSideReplace() {
|
||||||
|
if (!this.isSideDoorDamageLocation) return false;
|
||||||
|
|
||||||
|
return this.sideDoorOptionsData.selectedDoorSides.some(selectedDriverSide =>
|
||||||
|
{
|
||||||
|
return selectedDriverSide.toUpperCase() === "DRIVERSIDE";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isPassengerSideReplace() {
|
||||||
|
if (!this.isSideDoorDamageLocation) return false;
|
||||||
|
|
||||||
|
return this.sideDoorOptionsData.selectedDoorSides.some(selectedPassengerSide =>
|
||||||
|
{
|
||||||
|
return selectedPassengerSide.toUpperCase() === "PASSENGERSIDE";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
funnelFooter,
|
funnelFooter,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
:answers="answersFromCms"
|
:answers="answersFromCms"
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
buttonType="listButtonHorizontal"
|
buttonType="listButtonHorizontal"
|
||||||
|
useTextForValue
|
||||||
v-model="selectedChipCountValues"
|
v-model="selectedChipCountValues"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ const fmgPageValues = {
|
||||||
VEHICLE_MODEL: "vehicle-model",
|
VEHICLE_MODEL: "vehicle-model",
|
||||||
VEHICLE_STYLE: "vehicle-style",
|
VEHICLE_STYLE: "vehicle-style",
|
||||||
VEHICLE_DAMAGE: "vehicle-damage",
|
VEHICLE_DAMAGE: "vehicle-damage",
|
||||||
|
VEHICLE_PARTS: "vehicle-parts",
|
||||||
|
QUOTE : "quote",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { fmgPageValues };
|
export { fmgPageValues };
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ const navigationScenarios = {
|
||||||
SELECTED_MAKE: "SELECTED_MAKE",
|
SELECTED_MAKE: "SELECTED_MAKE",
|
||||||
SELECTED_STYLE: "SELECTED_STYLE",
|
SELECTED_STYLE: "SELECTED_STYLE",
|
||||||
CLICKED_BACK: "CLICKED_BACK",
|
CLICKED_BACK: "CLICKED_BACK",
|
||||||
|
SELECTED_DAMAGE_WITH_SINGLE_PART: "SELECTED_DAMAGE_WITH_SINGLE_PART",
|
||||||
|
SELECTED_GLASS_MULTIPLE_PARTS: "SELECTED_GLASS_MULTIPLE_PARTS"
|
||||||
};
|
};
|
||||||
|
|
||||||
export { navigationScenarios };
|
export { navigationScenarios };
|
||||||
|
|
|
||||||
5
src/router/router-constants/router-parameter-keys.js
Normal file
5
src/router/router-constants/router-parameter-keys.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
const routerParameterKeys = {
|
||||||
|
VEHICLE_PARTS_DATA: "vehiclePartsData",
|
||||||
|
};
|
||||||
|
|
||||||
|
export { routerParameterKeys };
|
||||||
|
|
@ -57,6 +57,23 @@ const routingTable = [
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
|
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART,
|
||||||
|
destinationFmgPageValue: fmgPageValues.QUOTE,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
|
||||||
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
|
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.SELECTED_GLASS_MULTIPLE_PARTS,
|
||||||
|
destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,16 @@ export const mutations = {
|
||||||
updateVehicleImageColor(state, imageColor) {
|
updateVehicleImageColor(state, imageColor) {
|
||||||
state.order.vehicle.imageColor = imageColor;
|
state.order.vehicle.imageColor = imageColor;
|
||||||
},
|
},
|
||||||
|
updateIsRepair(state, isRepair){
|
||||||
|
state.order.damage.isRepair = isRepair;
|
||||||
|
},
|
||||||
|
updateNumberOfChips(state, numberOfChips){
|
||||||
|
state.order.damage.numberOfChips = numberOfChips;
|
||||||
|
},
|
||||||
|
updateGlassToReplace(state, glassToReplace){
|
||||||
|
state.order.damage.glassToReplace = glassToReplace;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// EVENT BUS MUTATIONS
|
// EVENT BUS MUTATIONS
|
||||||
addEventToBus(state, event) {
|
addEventToBus(state, event) {
|
||||||
|
|
@ -252,8 +262,8 @@ export const actions = {
|
||||||
// Parts API Actions
|
// Parts API Actions
|
||||||
getPartsOrQuestions(context, { carId, glassArray, zipCode, vin = '' }) {
|
getPartsOrQuestions(context, { carId, glassArray, zipCode, vin = '' }) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetRouteInfo.method,
|
method: endpoints.GetPartsOrQuestions.method,
|
||||||
endpoint: endpoints.GetRouteInfo.url,
|
endpoint: endpoints.GetPartsOrQuestions.url,
|
||||||
payload: {
|
payload: {
|
||||||
carId: carId,
|
carId: carId,
|
||||||
glass: glassArray,
|
glass: glassArray,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue