SSR-401
CMS/Frontend Created review page
This commit is contained in:
parent
080b9b4b1c
commit
5a2e532106
4 changed files with 100 additions and 0 deletions
80
src/layouts/review-page/review-page.vue
Normal file
80
src/layouts/review-page/review-page.vue
Normal 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 review 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: "review-page",
|
||||
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_WITH_REVIEW,
|
||||
this.$route
|
||||
);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
siteFooter,
|
||||
Form,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
</style>
|
||||
|
|
@ -12,6 +12,7 @@ export const issPageValues = {
|
|||
PART_QUESTIONS: 'part-questions',
|
||||
POLICY_HOLDER_DETAILS: 'policy-holder-details',
|
||||
PROVIDER_PREFERENCE: 'provider-preference',
|
||||
REVIEW_PAGE: 'review-page',
|
||||
REVEAL: 'reveal',
|
||||
REVIEW_ORDER: 'review-order',
|
||||
SERVICE_LOCATION: 'service-location',
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ const navigationScenarios = {
|
|||
CLICKED_FORWARD_COVERAGE_STATEMENT: "CLICKED_FORWARD_COVERAGE_STATEMENT",
|
||||
|
||||
CLICKED_FORWARD_WITH_SAFELITE: "CLICKED_FORWARD_WITH_SAFELITE",
|
||||
|
||||
CLICKED_FORWARD_WITH_REVIEW:"CLICKED_FORWARD_WITH_REVIEW",
|
||||
};
|
||||
|
||||
|
||||
export { navigationScenarios };
|
||||
|
|
@ -483,6 +483,22 @@ const routingTable = function(store) {
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
issPageValue: issPageValues.REVIEW_PAGE,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.SERVICE_PACKAGE,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_REVIEW,
|
||||
destinationIssPageValue: issPageValues.PAYMENT_PAGE,
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
issPageValue: issPageValues.PAYMENT_PAGE,
|
||||
maps: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue