CSR-748 Add temp heritage button
This commit is contained in:
parent
b402894b0b
commit
10c1675245
8 changed files with 46 additions and 7 deletions
|
|
@ -15,6 +15,10 @@
|
||||||
data-bs-target="#footerModal"
|
data-bs-target="#footerModal"
|
||||||
data-bs-dismiss="modal" />
|
data-bs-dismiss="modal" />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- TODO KO DELETE FOR QUOTE MVP -->
|
||||||
|
<div class="col-auto">
|
||||||
|
<button @click="$emit('tempButtonClicked')">Heritage</button>
|
||||||
|
</div>
|
||||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 text-break">
|
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 text-break">
|
||||||
<textLink
|
<textLink
|
||||||
linkType="navigation"
|
linkType="navigation"
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -191,7 +192,9 @@ export default {
|
||||||
).parts = partFromCapabilityQuestionAnswer;
|
).parts = partFromCapabilityQuestionAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.navigateForward(partsOrQuestions);
|
// this.navigateForward(partsOrQuestions);
|
||||||
|
// TODO KO delete after quote MVP
|
||||||
|
this.navigateForward(partsOrQuestions, null, this.shouldGoToHeritageQuote);
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(answer) {
|
handleAnswerUpdates(answer) {
|
||||||
// only runs when all questions in a question-chain have been answered
|
// only runs when all questions in a question-chain have been answered
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -168,7 +169,9 @@ export default {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.navigateForward(partsOrQuestions);
|
// this.navigateForward(partsOrQuestions);
|
||||||
|
// TODO KO delete after quote MVP
|
||||||
|
this.navigateForward(partsOrQuestions, null, this.shouldGoToHeritageQuote);
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(answer) {
|
handleAnswerUpdates(answer) {
|
||||||
// only runs when all questions in a question-chain have been answered
|
// only runs when all questions in a question-chain have been answered
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -155,7 +156,9 @@ export default {
|
||||||
|
|
||||||
const glassPiecePartsForStore = partsLookup.data.glassPieceParts;
|
const glassPiecePartsForStore = partsLookup.data.glassPieceParts;
|
||||||
|
|
||||||
this.navigateForward(glassPiecePartsForStore);
|
// this.navigateForward(glassPiecePartsForStore);
|
||||||
|
// TODO KO delete after quote MVP
|
||||||
|
this.navigateForward(glassPiecePartsForStore, null, this.shouldGoToHeritageQuote);
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(answer) {
|
handleAnswerUpdates(answer) {
|
||||||
// only runs when all questions in a question-chain have been answered
|
// only runs when all questions in a question-chain have been answered
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
:isForwardActionDisabled="isForwardActionDisabled"
|
:isForwardActionDisabled="isForwardActionDisabled"
|
||||||
|
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -186,8 +187,10 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO KO delete after quote MVP
|
||||||
|
this.navigateForward(matchedParts, null, this.shouldGoToHeritageQuote);
|
||||||
// Navigate to the next page
|
// Navigate to the next page
|
||||||
this.navigateForward(matchedParts);
|
// this.navigateForward(matchedParts);
|
||||||
},
|
},
|
||||||
|
|
||||||
LoadInitialPartsData() {
|
LoadInitialPartsData() {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,11 @@ import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data() { // TODO KO DELETE AFTER QUOTE MVP
|
||||||
|
return {
|
||||||
|
shouldGoToHeritageQuote: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hasPartQuestions(partsOrQuestions) {
|
hasPartQuestions(partsOrQuestions) {
|
||||||
return partsOrQuestions?.some((pq) => pq.partQuestions?.length > 0);
|
return partsOrQuestions?.some((pq) => pq.partQuestions?.length > 0);
|
||||||
|
|
@ -149,8 +154,9 @@ export default {
|
||||||
|
|
||||||
return glass;
|
return glass;
|
||||||
},
|
},
|
||||||
|
// TODO KO Delete `shouldGoToHeritageQuote`
|
||||||
// Can't use `this` because navigateForward is also called from vin-pages-mixin
|
// Can't use `this` because navigateForward is also called from vin-pages-mixin
|
||||||
async navigateForward(partsOrQuestions, vm) {
|
async navigateForward(partsOrQuestions, vm, shouldGoToHeritageQuote) {
|
||||||
const self = vm ?? this;
|
const self = vm ?? this;
|
||||||
const currentPage = self.$route.query.fmgPage;
|
const currentPage = self.$route.query.fmgPage;
|
||||||
|
|
||||||
|
|
@ -243,7 +249,7 @@ export default {
|
||||||
// save to store lineItems.glassParts
|
// save to store lineItems.glassParts
|
||||||
self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts);
|
self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts);
|
||||||
|
|
||||||
self.$router.navigateWithSaving(
|
shouldGoToHeritageQuote ? navigateToHeritageFunnel() : self.$router.navigateWithSaving(
|
||||||
self.navigationScenarios.HAS_NO_MORE_QUESTIONS,
|
self.navigationScenarios.HAS_NO_MORE_QUESTIONS,
|
||||||
self.$route
|
self.$route
|
||||||
);
|
);
|
||||||
|
|
@ -295,5 +301,10 @@ export default {
|
||||||
|
|
||||||
self.$router.navigateWithoutSaving(backNavigationScenario, self.$route);
|
self.$router.navigateWithoutSaving(backNavigationScenario, self.$route);
|
||||||
},
|
},
|
||||||
|
// TODO KO delete this after quote mvp
|
||||||
|
async handleTempButtonClicked(vm) {
|
||||||
|
this.shouldGoToHeritageQuote = true;
|
||||||
|
// await vm.forwardButtonAction();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data() { // TODO KO DELETE AFTER QUOTE MVP
|
||||||
|
return {
|
||||||
|
shouldGoToHeritageQuote: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async navigateForwardWithSingleCarMatch() {
|
async navigateForwardWithSingleCarMatch() {
|
||||||
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
|
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
|
||||||
|
|
@ -14,7 +19,13 @@ export default {
|
||||||
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
||||||
const partsOrQuestions = result.data.partsOrQuestions;
|
const partsOrQuestions = result.data.partsOrQuestions;
|
||||||
|
|
||||||
vehicleQuestionsMixin.methods.navigateForward(partsOrQuestions, this);
|
// TODO KO delete `this.shouldGoToHeritageQuote`
|
||||||
|
vehicleQuestionsMixin.methods.navigateForward(partsOrQuestions, this, this.shouldGoToHeritageQuote);
|
||||||
|
},
|
||||||
|
// TODO KO delete this after quote mvp
|
||||||
|
async handleTempButtonClicked(vm) {
|
||||||
|
this.shouldGoToHeritageQuote = true;
|
||||||
|
await vm.forwardButtonAction();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue