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="container nested-radio" v-for="(value, name, index) in featureListData" :key="index">
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
{{ selectedTint }}
|
|
||||||
<listCard v-model="selectedTint[name]" :isRadio="true" :isWide="true" :buttonImage="
|
<listCard v-model="selectedTint[name]" :isRadio="true" :isWide="true" :buttonImage="
|
||||||
require(`@/assets/img/tints/${getTintSourceImage(
|
require(`@/assets/img/tints/${getTintSourceImage(
|
||||||
glassLocation,
|
glassLocation,
|
||||||
|
|
@ -23,7 +22,7 @@
|
||||||
selectedTint[name].buttonId === `${glassLocation}-${glassName}-${name}`
|
selectedTint[name].buttonId === `${glassLocation}-${glassName}-${name}`
|
||||||
" class="row my-2" aria-live="polite">
|
" class="row my-2" aria-live="polite">
|
||||||
<div class="col">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
@ -67,6 +66,7 @@ export default {
|
||||||
colorQuestionText() {
|
colorQuestionText() {
|
||||||
return getCustomTransformValue(this.glassColorQuestion, `${this.glassLocation} ${this.glassName}`);
|
return getCustomTransformValue(this.glassColorQuestion, `${this.glassLocation} ${this.glassName}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
selectedPart: {
|
selectedPart: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
<funnelHeader ref="funnelHeader" />
|
<funnelHeader ref="funnelHeader" />
|
||||||
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage="false" />
|
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage="false" />
|
||||||
<funnelSubHeader ref="funnelSubHeader" />
|
<funnelSubHeader ref="funnelSubHeader" />
|
||||||
{{ glassParts }}
|
|
||||||
<div class="container-fluid prevent-squish my-5">
|
<div class="container-fluid prevent-squish my-5">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
@ -173,9 +172,10 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid(parameters) {
|
||||||
// return store.getters.damage.isRepair !== null;
|
// store.getters.damage.isRepair !== null;
|
||||||
|
// parameters.PartsByGlassName.length > 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ const routes = [
|
||||||
.getRoutes()
|
.getRoutes()
|
||||||
.filter((x) => x.name === to.query.fmgPage)[0].components;
|
.filter((x) => x.name === to.query.fmgPage)[0].components;
|
||||||
|
|
||||||
if (!arePagePrerequisitesValid(component)) {
|
if (!arePagePrerequisitesValid(component, to.params)) {
|
||||||
await GoToFunnelStartOn404(next);
|
await GoToFunnelStartOn404(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ const routes = [
|
||||||
.filter((x) => x.name === routeData[0].name)[0]
|
.filter((x) => x.name === routeData[0].name)[0]
|
||||||
.components.default();
|
.components.default();
|
||||||
|
|
||||||
if (!arePagePrerequisitesValid(nextComponent)) {
|
if (!arePagePrerequisitesValid(nextComponent, to.params)) {
|
||||||
await GoToFunnelStartOn404(next);
|
await GoToFunnelStartOn404(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,8 +217,8 @@ async function GoToFunnelStartOn404(next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks arePagePrerequisitesValid on the component passed in.
|
// Checks arePagePrerequisitesValid on the component passed in.
|
||||||
function arePagePrerequisitesValid(component) {
|
function arePagePrerequisitesValid(component, parameters = {}) {
|
||||||
return component.default.methods.arePagePrerequisitesValid();
|
return component.default.methods.arePagePrerequisitesValid(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset dependant state on route change.
|
// Reset dependant state on route change.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue