-
+
@@ -80,152 +90,160 @@ export default {
// Glass Part Question dynamic component
Object.keys(vm.$refs)
- .filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined)
- .forEach((c) =>
- vm.$refs[c][0].initializeComponent({
- ColorQuestionWidget: resultMap.cmsContent.ColorQuestionWidget,
- FeatureQuestionWidget: resultMap.cmsContent.FeatureQuestionWidget,
- })
- );
- });
+ .filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined)
+ .forEach((c) =>
+ vm.$refs[c][0].initializeComponent({
+ ColorQuestionWidget: resultMap.cmsContent.ColorQuestionWidget,
+ FeatureQuestionWidget: resultMap.cmsContent.FeatureQuestionWidget,
+ })
+ );
+ });
+},
+data() {
+ return {
+ selectedGlassParts: {},
+ alertWidgetData: Object,
+ alreadyPopulatedPartsData: [],
+ };
+},
+computed: {
+ isForwardActionDisabled() {
+ return (
+ this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
+ );
},
- data() {
- return {
- selectedGlassParts: {},
- alertWidgetData: Object,
- alreadyPopulatedPartsData: [],
- };
+ selectedGlassPartNumbers() {
+ // Compile all selected parts from the page.
+ const numberArray = [];
+ for (let glassPart of Object.values(this.selectedGlassParts)) {
+ if (glassPart?.partNumber) {
+ numberArray.push(glassPart.partNumber);
+ }
+ }
+ return numberArray;
},
- computed: {
- isForwardActionDisabled() {
- return (
- this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
- );
- },
- selectedGlassPartNumbers() {
- // Compile all selected parts from the page.
- const numberArray = [];
- for (let glassPart of Object.values(this.selectedGlassParts)) {
- if (glassPart?.partNumber) {
- numberArray.push(glassPart.partNumber);
- }
- }
- return numberArray;
- },
- PartsOrQuestions() {
- const partsData = this.PartsFromApi;
+ PartsOrQuestions() {
+ const partsData = this.PartsFromApi;
- // Map API result data, to vehicle-parts data structure
- const mappedData = partsData.partsOrQuestions.map((g) => {
- return {
- glassName: g.glassName,
- glassLocation: g.glassLocation,
- colorAnswers: g.parts?.reduce((arr, p) => {
- arr.push({
- ColorAnswerText: p.color,
- FeatureAnswers: [
- {
- FeatureAnswerText:
- p.description === "" ? p.color : p.description,
- PartNumber: p.partNumber,
- },
- ],
- });
- return arr;
- }, []),
- };
- });
-
- return mappedData;
- },
-
- PartsFromApi() {
- return this.mainStore.pageData(issPageValues.VEHICLE_PARTS);
- },
-
- RefPrefix() {
- return "partQuestion";
- },
- },
- methods: {
- arePagePrerequisitesValid() {
- // Check if isRepair is populated and if the pageData we need is here (Parts data)
- return (
- this.mainStore.damage.isRepair != null &&
- this.mainStore.pageData(issPageValues.VEHICLE_PARTS) &&
- Object.keys(this.mainStore.pageData(issPageValues.VEHICLE_PARTS)).length !== 0
- );
- },
- async forwardButtonAction() {
- const matchedParts = [];
-
- // Match them to the parts from the API.
- for (let [key, value] of Object.entries(this.PartsFromApi.partsOrQuestions)) {
- for (let [partKey, partValue] of Object.entries(value.parts)) {
- const currentPart = this.PartsFromApi.partsOrQuestions[key].parts[partKey];
-
- const isMatched = this.selectedGlassPartNumbers.some(
- (p) => p === currentPart.partNumber
- );
-
- if (isMatched) {
- matchedParts.push({
- glassLocation: value.glassLocation,
- glassName: value.glassName,
- parts: [currentPart],
- });
- }
- }
- }
- // If no parts could be matched, throw an error (isForwardActionDisabled is based off of matchedParts)
- if (this.isForwardActionDisabled) {
- this.$refs.siteFooter.removeLoader();
- throw new Error("Could not match any parts to the selected parts");
- }
-
- await this.mainStore.resetMoldingAndCapabilityQuestionAnswersIfNeeded(matchedParts);
-
- this.navigateForward(matchedParts, null);
- },
-
- LoadInitialPartsData() {
- const partsData = this.PartsFromApi;
- this.alreadyPopulatedPartsData =
- this.mainStore.lineItems.glassParts === null
- ? []
- : this.mainStore.lineItems.glassParts;
-
- partsData.partsOrQuestions.map((g) => {
- // If the part is already populated, use the value from the store and populate the v-model.
- Object.keys(this.alreadyPopulatedPartsData).forEach((key) => {
- const partNumber = this.alreadyPopulatedPartsData[key].partNumber;
- g.parts.forEach((p) => {
- if (p.partNumber === partNumber) {
- this.selectedGlassParts[g.glassLocation + "-" + g.glassName] = p;
- }
+ // Map API result data, to vehicle-parts data structure
+ const mappedData = partsData.partsOrQuestions.map((g) => {
+ return {
+ glassName: g.glassName,
+ glassLocation: g.glassLocation,
+ colorAnswers: g.parts?.reduce((arr, p) => {
+ arr.push({
+ ColorAnswerText: p.color,
+ FeatureAnswers: [
+ {
+ FeatureAnswerText:
+ p.description === "" ? p.color : p.description,
+ PartNumber: p.partNumber,
+ },
+ ],
});
+ return arr;
+ }, []),
+ };
+ });
+
+ return mappedData;
+ },
+
+ PartsFromApi() {
+ return this.mainStore.pageData(issPageValues.VEHICLE_PARTS);
+ },
+
+ RefPrefix() {
+ return "partQuestion";
+ },
+},
+methods: {
+ arePagePrerequisitesValid() {
+ // Check if isRepair is populated and if the pageData we need is here (Parts data)
+ return (
+ this.mainStore.damage.isRepair != null &&
+ this.mainStore.pageData(issPageValues.VEHICLE_PARTS) &&
+ Object.keys(this.mainStore.pageData(issPageValues.VEHICLE_PARTS)).length !== 0
+ );
+ },
+ async forwardButtonAction() {
+ const matchedParts = [];
+
+ // Match them to the parts from the API.
+ for (let [key, value] of Object.entries(this.PartsFromApi.partsOrQuestions)) {
+ for (let [partKey, partValue] of Object.entries(value.parts)) {
+ const currentPart = this.PartsFromApi.partsOrQuestions[key].parts[partKey];
+
+ const isMatched = this.selectedGlassPartNumbers.some(
+ (p) => p === currentPart.partNumber
+ );
+
+ if (isMatched) {
+ matchedParts.push({
+ glassLocation: value.glassLocation,
+ glassName: value.glassName,
+ parts: [currentPart],
+ });
+ }
+ }
+ }
+ // If no parts could be matched, throw an error (isForwardActionDisabled is based off of matchedParts)
+ if (this.isForwardActionDisabled) {
+ this.$refs.siteFooter.removeLoader();
+ throw new Error("Could not match any parts to the selected parts");
+ }
+
+ await this.mainStore.resetMoldingAndCapabilityQuestionAnswersIfNeeded(matchedParts);
+
+ this.navigateForward(matchedParts, null);
+ },
+
+ LoadInitialPartsData() {
+ const partsData = this.PartsFromApi;
+ this.alreadyPopulatedPartsData =
+ this.mainStore.lineItems.glassParts === null
+ ? []
+ : this.mainStore.lineItems.glassParts;
+
+ partsData.partsOrQuestions.map((g) => {
+ // If the part is already populated, use the value from the store and populate the v-model.
+ Object.keys(this.alreadyPopulatedPartsData).forEach((key) => {
+ const partNumber = this.alreadyPopulatedPartsData[key].partNumber;
+ g.parts.forEach((p) => {
+ if (p.partNumber === partNumber) {
+ this.selectedGlassParts[g.glassLocation + "-" + g.glassName] = p;
+ }
});
});
- },
- },
- mounted() {
- this.LoadInitialPartsData();
- },
- components: {
- Form,
- glassPartQuestion,
- siteHeader,
- vehicleBanner,
- siteSubHeader,
- siteFooter,
- alert,
+ });
},
+},
+mounted() {
+ this.LoadInitialPartsData();
+},
+components: {
+ Form,
+ glassPartQuestion,
+ siteHeader,
+ vehicleBanner,
+ siteSubHeader,
+ siteFooter,
+ alert,
+},
};
-
diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue
index 10ea7b52..1241ab63 100644
--- a/src/layouts/vehicle-year/vehicle-year.vue
+++ b/src/layouts/vehicle-year/vehicle-year.vue
@@ -1,101 +1,116 @@
-
-
-
-
-
+
-
+};
+
+
+
diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue
index 31fe2ec0..a7eca68b 100644
--- a/src/layouts/vin-lookup/vin-lookup.vue
+++ b/src/layouts/vin-lookup/vin-lookup.vue
@@ -1,47 +1,27 @@
-