Merge pull request #242 from Safelite/feature/digital/SSR-399
shell for schedule-page
This commit is contained in:
commit
32a5bbfdb7
3 changed files with 92 additions and 0 deletions
81
src/layouts/schedule-page/schedule-page.vue
Normal file
81
src/layouts/schedule-page/schedule-page.vue
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
<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 schedule 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: "schedule-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);
|
||||||
|
},
|
||||||
|
|
||||||
|
forwardButtonAction() {
|
||||||
|
},
|
||||||
|
|
||||||
|
navigateForward() {
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
siteHeader,
|
||||||
|
siteFooter,
|
||||||
|
Form,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
</style>
|
||||||
|
|
@ -19,6 +19,7 @@ export const issPageValues = {
|
||||||
COVERAGE_STATEMENT: "coverage-statement",
|
COVERAGE_STATEMENT: "coverage-statement",
|
||||||
PROVIDER_PREFERENCE: "provider-preference",
|
PROVIDER_PREFERENCE: "provider-preference",
|
||||||
SERVICE_LOCATION: "service-location",
|
SERVICE_LOCATION: "service-location",
|
||||||
|
SCHEDULE_PAGE: "schedule-page",
|
||||||
REVEAL: "reveal",
|
REVEAL: "reveal",
|
||||||
ESTIMATE: "estimate",
|
ESTIMATE: "estimate",
|
||||||
ADDRESS_VEHICLES: "address-vehicles",
|
ADDRESS_VEHICLES: "address-vehicles",
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,16 @@ const routingTable = function(store) {
|
||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
issPageValue: issPageValues.SCHEDULE_PAGE,
|
||||||
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
|
destinationIssPageValue: issPageValues.SERVICE_LOCATION,
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue