small refactor + defect fix
This commit is contained in:
parent
b42f99f2c2
commit
46ed8caa6f
2 changed files with 14 additions and 6 deletions
|
|
@ -4,10 +4,17 @@ import { storeActions } from "@/constants/store-actions";
|
|||
|
||||
export function getDamageString() {
|
||||
const damageLocations = store.getters.damage.glassToReplace;
|
||||
const isRepair = store.getters.damage.isRepair;
|
||||
|
||||
let returnString;
|
||||
if (!damageLocations) {
|
||||
return;
|
||||
}
|
||||
// If it's a repair it's always a windshield.
|
||||
if(isRepair){
|
||||
return "windshield"
|
||||
}
|
||||
|
||||
if (damageLocations.length > 1) {
|
||||
returnString = "match"
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -372,13 +372,14 @@ export default {
|
|||
return text;
|
||||
},
|
||||
AlertMatchedDifferentVehicleBody(){
|
||||
let content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText");
|
||||
content = content.replaceAll("{custom:glassText}", getDamageString());
|
||||
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`;
|
||||
|
||||
content = content.replaceAll("{custom:vinYmmFound}", vinYmmFound);
|
||||
content = content.replaceAll("{custom:vinYmmExpected}", vinYmmExpected);
|
||||
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`;
|
||||
|
||||
const content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText")
|
||||
.replaceAll("{custom:glassText}", getDamageString())
|
||||
.replaceAll("{custom:vinYmmFound}", vinYmmFound)
|
||||
.replaceAll("{custom:vinYmmExpected}", vinYmmExpected);
|
||||
|
||||
return content;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue