Merge branch 'develop' into feature/digital/SSR-353
This commit is contained in:
commit
63418c003b
4 changed files with 110 additions and 10 deletions
86
src/layouts/tpa-submit/tpa-submit.vue
Normal file
86
src/layouts/tpa-submit/tpa-submit.vue
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<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-Submit</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-submit",
|
||||
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() {
|
||||
return this.navigateForward();
|
||||
},
|
||||
|
||||
navigateForward() {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route
|
||||
);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
siteFooter,
|
||||
Form,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
</style>
|
||||
|
|
@ -26,6 +26,7 @@ export const issPageValues = {
|
|||
VEHICLE_PARTS: 'vehicle-parts',
|
||||
VEHICLE_STYLE: 'vehicle-style',
|
||||
VEHICLE_YEAR: 'vehicle-year',
|
||||
VIN_LOOKUP: 'vin-lookup'
|
||||
VIN_LOOKUP: 'vin-lookup',
|
||||
TPA_SUBMIT: 'tpa-submit'
|
||||
};
|
||||
|
||||
|
|
@ -515,6 +515,19 @@ const routingTable = function(store) {
|
|||
destinationIssPageValue: issPageValues.REVIEW_PAGE
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.TPA_SUBMIT,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.TPA_SEARCH
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationIssPageValue: issPageValues.TPA_CONFIRMATION,
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1280,14 +1280,14 @@ function addPricesToLineItems(lineItems, pricingLineItems) {
|
|||
return lineItems;
|
||||
}
|
||||
|
||||
function getLineItemQueryStringForPricing(lineItems) {
|
||||
return lineItems
|
||||
.map((lineItem) => {
|
||||
let queryStringSnippet = `&LineItems=${lineItem.partNumber}`;
|
||||
if (lineItem.childParts) {
|
||||
queryStringSnippet += getLineItemQueryStringForPricing(lineItem.childParts);
|
||||
}
|
||||
function getLineItemQueryStringForPricing(lineItems){
|
||||
return lineItems.map((lineItem, index) => {
|
||||
let queryStringSnippet = `&LineItems[${index}].partNumber=${lineItem.partNumber}`;
|
||||
if (lineItem.childParts) {
|
||||
queryStringSnippet += getLineItemQueryStringForPricing(lineItem.childParts);
|
||||
}
|
||||
|
||||
return queryStringSnippet;
|
||||
})
|
||||
.join('');
|
||||
}).join('');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue