Merge branch 'develop' into feature/SSR-683

This commit is contained in:
Katie Kroell 2024-04-23 05:59:41 -04:00
commit ffb7ca761d
5 changed files with 24 additions and 21 deletions

View file

@ -10,7 +10,8 @@
</router-view> </router-view>
<loadingModal <loadingModal
:showLoader="shouldShowLoader" :showLoader="shouldShowLoader"
:showTextCarousel="shouldShowTextCarousel" /> :showTextCarousel="shouldShowTextCarousel"
:textSlides="hasTextSlides" />
</template> </template>
<script> <script>
@ -27,6 +28,9 @@ export default {
return { globalNonpersistedState }; return { globalNonpersistedState };
}, },
computed: { computed: {
hasTextSlides() {
return this.globalNonpersistedState.carouselTextSlides;
},
shouldShowLoader() { shouldShowLoader() {
return this.globalNonpersistedState.showLoadingModal; return this.globalNonpersistedState.showLoadingModal;
}, },

View file

@ -3,16 +3,20 @@ import { reactive } from 'vue';
// state encapsulated and managed by the composable // state encapsulated and managed by the composable
const globalNonpersistedState = reactive({ const globalNonpersistedState = reactive({
showLoadingModal: true, showLoadingModal: true,
showTextCarousel: false showTextCarousel: false,
carouselTextSlides: []
}); });
const showIssLoadingModal = (newValue, showTextCarousel = false) => { const showIssLoadingModal = (newValue, showTextCarousel = false, carouselTextSlides = []) => {
if (newValue !== undefined) { if (newValue !== undefined) {
globalNonpersistedState.showLoadingModal = newValue; globalNonpersistedState.showLoadingModal = newValue;
} }
if (showTextCarousel !== undefined) { if (showTextCarousel !== undefined) {
globalNonpersistedState.showTextCarousel = showTextCarousel; globalNonpersistedState.showTextCarousel = showTextCarousel;
} }
if (carouselTextSlides !== undefined) {
globalNonpersistedState.carouselTextSlides = carouselTextSlides;
}
return { globalNonpersistedState }; return { globalNonpersistedState };
}; };

View file

@ -38,7 +38,6 @@
export default { export default {
name: 'loading-modal', name: 'loading-modal',
props: { props: {
textSlides: Array,
showLoader: { showLoader: {
type: Boolean, type: Boolean,
default: false default: false
@ -46,6 +45,10 @@ export default {
showTextCarousel: { showTextCarousel: {
type: Boolean, type: Boolean,
default: false default: false
},
textSlides: {
type: Array,
default: () => []
} }
}, },
data() { data() {

View file

@ -4,11 +4,6 @@ exports[`coverageStatement.vue-working returns the initial data 1`] = `
Object { Object {
"baseServiceLineItems": Array [], "baseServiceLineItems": Array [],
"deductibleText": "Your deductible is", "deductibleText": "Your deductible is",
"loadingText": Array [
"Connecting to your insurance company",
"Nearly there",
"Finishing up",
],
"rules": Object { "rules": Object {
"selectionRequired": "option-required", "selectionRequired": "option-required",
}, },

View file

@ -7,9 +7,6 @@
<div class="container-fluid fade-on-route-transition"> <div class="container-fluid fade-on-route-transition">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6 px-0 px-md-2"> <div class="col-md-6 px-0 px-md-2">
<loadingModal
ref="loadingModal"
:textSlides="loadingText" />
<siteHeader <siteHeader
ref="siteHeader" ref="siteHeader"
cmsWidgetName="SiteHeaderWidget" /> cmsWidgetName="SiteHeaderWidget" />
@ -106,7 +103,6 @@ import recalModal from '@/layouts/coverage-statement/recal-modal/recal-modal.vue
import alert from '@/ux-components/alert/alert.vue'; import alert from '@/ux-components/alert/alert.vue';
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal.vue'; import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal.vue';
import buttonQuestion from '@/digital-components/button-question/button-question.vue'; import buttonQuestion from '@/digital-components/button-question/button-question.vue';
import loadingModal from '@/iss-components/loading-modal/loading-modal.vue';
import textBlock from '@/digital-components/text-block/text-block.vue'; import textBlock from '@/digital-components/text-block/text-block.vue';
import pageVariations from '@/constants/coverage-statement-page-variations'; import pageVariations from '@/constants/coverage-statement-page-variations';
@ -129,6 +125,7 @@ import coverageStatuses from '@/constants/coverage-statuses';
import widgetFields from '@/constants/cms-widget-fields.js'; import widgetFields from '@/constants/cms-widget-fields.js';
import getPriceOfLineItems from '@/helpers/price-calculator.js'; import getPriceOfLineItems from '@/helpers/price-calculator.js';
import { formatAmountInDollars } from '@/helpers/text-helper.js'; import { formatAmountInDollars } from '@/helpers/text-helper.js';
import showIssLoadingModal from '@/helpers/loading-modal-helper';
const SAFELITE_PROVIDER = 'Safelite'; const SAFELITE_PROVIDER = 'Safelite';
@ -143,7 +140,6 @@ export default {
alert, alert,
contentGroupModal, contentGroupModal,
buttonQuestion, buttonQuestion,
loadingModal,
textBlock textBlock
}, },
mixins: [baseFormMixin, vehicleQuestionsMixin], mixins: [baseFormMixin, vehicleQuestionsMixin],
@ -196,14 +192,20 @@ export default {
}); });
} }
const loadingText = [
'Connecting to your insurance company',
'Nearly there',
'Finishing up'
];
if (!hasBailedOut) { if (!hasBailedOut) {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
showIssLoadingModal(true, true, loadingText);
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
vm.setSupportingItems(resultMap.supportingItems); vm.setSupportingItems(resultMap.supportingItems);
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
vm.setBaseServiceLineItems(pricingResults); vm.setBaseServiceLineItems(pricingResults);
vm.$refs.loadingModal.showModal();
vm.initializeComponent(); vm.initializeComponent();
if (!vm.unverified) { if (!vm.unverified) {
useMainStore().disableKeyFields(); useMainStore().disableKeyFields();
@ -217,11 +219,6 @@ export default {
selectedProvider: '', selectedProvider: '',
deductibleText: 'Your deductible is', deductibleText: 'Your deductible is',
// TODO update when design team gives appropriate text // TODO update when design team gives appropriate text
loadingText: [
'Connecting to your insurance company',
'Nearly there',
'Finishing up'
],
rules: { rules: {
selectionRequired: globalRules.OPTION_REQUIRED selectionRequired: globalRules.OPTION_REQUIRED
}, },
@ -423,7 +420,7 @@ export default {
.registerClaim() .registerClaim()
?.catch(() => {}); ?.catch(() => {});
} }
this.$refs.loadingModal.hideModal(); showIssLoadingModal(false);
}, },
async navigateForward() { async navigateForward() {
if (this.isUnverifiedVisible || this.isDeductibleVisible) { if (this.isUnverifiedVisible || this.isDeductibleVisible) {