Created TPA-confirmation shell page
This commit is contained in:
sheena 2023-04-24 15:49:32 +05:30
parent 8e9bc4bc5b
commit bae0030733
4 changed files with 99 additions and 3 deletions

View file

@ -0,0 +1,80 @@
<template>
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }" >
<div class="page-container-grouped-styles">
<div class="fade-on-route-transition position-relative">
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
<div class="container-fluid pb-2">
<p>Placeholder for tpa-confrimation page</p>
<siteFooter
cmsWidgetName="SiteFooterWidget"
ref="siteFooter"
:isForwardActionDisabled="!meta.valid"
@ForwardClicked="forwardButtonAction"
@back-clicked="backButtonAction"
/>
</div>
</div>
</div>
</Form>
</template>
<script>
// Components
import siteHeader from '@/iss-components/site-header/site-header';
import siteFooter from "@/iss-components/site-footer/site-footer";
// Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper";
import { Form } from "vee-validate";
import BaseFormMixin from '@/mixins/base-form-mixin.js';
import { useMainStore } from '@/store';
export default {
name: "tpa-confirmation",
mixins: [BaseFormMixin],
data() {
},
setup() {
const mainStore = useMainStore();
return { mainStore };
},
async beforeRouteEnter(to, from, next)
{
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
// Settle promises and get results
const promiseResultMap = [
{
resultKey: "cmsContent",
promise: cmsContentPromise,
},];
//use resultMap to populate layout content.
let resultMap = await settleAllPromises(promiseResultMap);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
});
},
methods:
{
backButtonAction() {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
async forwardButtonAction() {
return this.navigateForward();
},
navigateForward() {
this.$router.navigate(
this.navigationScenarios.CLICKED_FORWARD_TPA_CONFIRMATION,
this.$route
);
},
},
components: {
siteHeader,
siteFooter,
Form,
},
}
</script>
<style lang="scss">
</style>

View file

@ -17,6 +17,7 @@ export const issPageValues = {
REVIEW_ORDER: 'review-order',
SERVICE_LOCATION: 'service-location',
SERVICE_PACKAGE: 'service-package',
TPA_CONFIRMATION:'tpa-confirmation',
VEHICLE_DAMAGE: 'vehicle-damage',
VEHICLE_LOOKUP: 'vehicle-lookup',
VEHICLE_MAKE: 'vehicle-make',

View file

@ -46,6 +46,8 @@ const navigationScenarios = {
CLICKED_FORWARD_WITH_SAFELITE: "CLICKED_FORWARD_WITH_SAFELITE",
CLICKED_FORWARD_WITH_REVIEW:"CLICKED_FORWARD_WITH_REVIEW",
CLICKED_FORWARD_TPA_CONFIRMATION:"CLICKED_FORWARD_TPA_CONFIRMATION",
};

View file

@ -489,11 +489,11 @@ const routingTable = function(store) {
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationIssPageValue: issPageValues.SERVICE_PACKAGE,
destinationIssPageValue: issPageValues.SERVICE_PACKAGE
},
{
scenario: navigationScenarios.CLICKED_FORWARD_WITH_REVIEW,
destinationIssPageValue: issPageValues.PAYMENT_PAGE,
destinationIssPageValue: issPageValues.PAYMENT_PAGE
},
],
@ -507,7 +507,20 @@ const routingTable = function(store) {
destinationIssPageValue: issPageValues.REVIEW_PAGE
}
]
}
},
{
issPageValue: issPageValues.TPA_CONFIRMATION,
maps: [
{
scenario: navigationScenarios.CLICKED_FORWARD_TPA_CONFIRMATION,
destinationIssPageValue: issPageValues.WELCOME_PAGE
},
],
},
];
};