include parameters in the prereq calls
This commit is contained in:
parent
8e1c5fef34
commit
25f0eaf075
3 changed files with 10 additions and 10 deletions
|
|
@ -8,7 +8,6 @@
|
|||
<div class="container nested-radio" v-for="(value, name, index) in featureListData" :key="index">
|
||||
<div class="row my-2">
|
||||
<div class="col">
|
||||
{{ selectedTint }}
|
||||
<listCard v-model="selectedTint[name]" :isRadio="true" :isWide="true" :buttonImage="
|
||||
require(`@/assets/img/tints/${getTintSourceImage(
|
||||
glassLocation,
|
||||
|
|
@ -23,7 +22,7 @@
|
|||
selectedTint[name].buttonId === `${glassLocation}-${glassName}-${name}`
|
||||
" class="row my-2" aria-live="polite">
|
||||
<div class="col">
|
||||
<buttonQuestion v-model="selectedPart[glassLocation]" buttonType="radio" class="radioQuestion" questionText="ok now select your features" :answers="value" textPosition="text-start" :loaderEnabled="false" :isRequired="true" :groupName="`${glassLocation}-${glassName}-${name}`" />
|
||||
<buttonQuestion v-model="selectedPart[glassLocation]" buttonType="radio" class="radioQuestion" :questionText="glassFeatureQuestion" :answers="value" textPosition="text-start" :loaderEnabled="false" :isRequired="true" :groupName="`${glassLocation}-${glassName}-${name}`" />
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
|
|
@ -67,6 +66,7 @@ export default {
|
|||
colorQuestionText() {
|
||||
return getCustomTransformValue(this.glassColorQuestion, `${this.glassLocation} ${this.glassName}`);
|
||||
},
|
||||
|
||||
selectedPart: {
|
||||
get: function () {
|
||||
return this.modelValue;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
<funnelHeader ref="funnelHeader" />
|
||||
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage="false" />
|
||||
<funnelSubHeader ref="funnelSubHeader" />
|
||||
{{ glassParts }}
|
||||
<div class="container-fluid prevent-squish my-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -173,9 +172,10 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
// return store.getters.damage.isRepair !== null;
|
||||
|
||||
arePagePrerequisitesValid(parameters) {
|
||||
// store.getters.damage.isRepair !== null;
|
||||
// parameters.PartsByGlassName.length > 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ const routes = [
|
|||
.getRoutes()
|
||||
.filter((x) => x.name === to.query.fmgPage)[0].components;
|
||||
|
||||
if (!arePagePrerequisitesValid(component)) {
|
||||
if (!arePagePrerequisitesValid(component, to.params)) {
|
||||
await GoToFunnelStartOn404(next);
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ const routes = [
|
|||
.filter((x) => x.name === routeData[0].name)[0]
|
||||
.components.default();
|
||||
|
||||
if (!arePagePrerequisitesValid(nextComponent)) {
|
||||
if (!arePagePrerequisitesValid(nextComponent, to.params)) {
|
||||
await GoToFunnelStartOn404(next);
|
||||
}
|
||||
|
||||
|
|
@ -217,8 +217,8 @@ async function GoToFunnelStartOn404(next) {
|
|||
}
|
||||
|
||||
// Checks arePagePrerequisitesValid on the component passed in.
|
||||
function arePagePrerequisitesValid(component) {
|
||||
return component.default.methods.arePagePrerequisitesValid();
|
||||
function arePagePrerequisitesValid(component, parameters = {}) {
|
||||
return component.default.methods.arePagePrerequisitesValid(parameters);
|
||||
}
|
||||
|
||||
// Reset dependant state on route change.
|
||||
|
|
|
|||
Loading…
Reference in a new issue