Remove shop-preference-modal

Removed files entirely
This commit is contained in:
scottkiener-at-safelite 2026-01-14 09:34:34 -05:00
parent ea231c8ac1
commit c7984ca111
3 changed files with 1 additions and 183 deletions

View file

@ -41,11 +41,6 @@
<steeringModal
:ref="STEERING_MODAL_REF_NAME"
cmsWidgetName="StateSteeringModal" />
<shopPreferenceModal
:ref="SHOP_PREFERENCE_MODAL_REF_NAME"
cmsWidgetName="ShopPreferenceDrawer"
:showSteeringLink="showSteeringLink"
@openSteering="openStateSteeringModal" />
<tpaRecalModal
:ref="TPA_RECAL_MODAL_REF_NAME"
cmsWidgetName="TPARecalModal"
@ -73,7 +68,6 @@ import siteFooter from '@/iss-components/site-footer/site-footer.vue';
import siteHeader from '@/iss-components/site-header/site-header.vue';
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
import steeringModal from '@/layouts/provider-preference/steering-modal/steering-modal.vue';
import shopPreferenceModal from '@/layouts/provider-preference/shop-preference-modal/shop-preference-modal.vue';
import tpaRecalModal from '@/layouts/provider-preference/tpa-recal-modal/tpa-recal-modal.vue';
import globalRules from '@/constants/global-rules';
import bailoutMessage from '@/constants/bailoutMessage';
@ -83,7 +77,6 @@ import buttonMain from '@/ux-components/button-main/button-main.vue';
const options = { SAFELITE: 'SafeliteOption', TPA: 'TPAOption' };
const STEERING_MODAL_REF_NAME = 'StateSteeringModal';
const SHOP_PREFERENCE_MODAL_REF_NAME = 'ShopPreferenceDrawer';
const TPA_RECAL_MODAL_REF_NAME = 'TPARecalModal';
const SITE_FOOTER_REF_NAME = 'siteFooter';
@ -98,7 +91,6 @@ export default {
buttonQuestion,
buttonMain,
steeringModal,
shopPreferenceModal,
tpaRecalModal,
contentGroupModal,
textLink
@ -116,9 +108,7 @@ export default {
const resultMap = await settleAllPromises(promiseResultMap);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSteeringLink = !!vm.$refs[STEERING_MODAL_REF_NAME].ModalBodyText;
if (vm.showSteeringLink) {
if (!!vm.$refs[STEERING_MODAL_REF_NAME].ModalBodyText) {
vm.openStateSteeringModal();
}
});
@ -126,13 +116,11 @@ export default {
data() {
return {
selectedProvider: null,
showSteeringLink: false,
tpaAcknowledgement: false,
rules: {
optionRequired: globalRules.OPTION_REQUIRED
},
STEERING_MODAL_REF_NAME,
SHOP_PREFERENCE_MODAL_REF_NAME,
TPA_RECAL_MODAL_REF_NAME,
SITE_FOOTER_REF_NAME
};

View file

@ -1,59 +0,0 @@
import { shallowMount } from '@vue/test-utils';
import settleAllPromises from '@/helpers/layout-helper.js';
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
import { getMountOptions } from '@/helpers/unit-test-helper.js';
import shopPreferenceModal from '@/layouts/provider-preference/shop-preference-modal/shop-preference-modal.vue';
// Mock our module for promises.
jest.mock('@/helpers/layout-helper.js', () => jest.fn());
// Mock fetchCmsContentForPage
jest.mock('@/helpers/cms-content-helper', () => ({
fetchCmsContentForPage: jest.fn(),
setupModalLinks: jest.fn()
}));
/** @ignore */
function setupMocks(propsData) {
const mountOptions = getMountOptions({
router: {
navigate: jest.fn()
}
});
mountOptions.propsData = propsData;
const wrapper = shallowMount(
shopPreferenceModal,
mountOptions
);
const apiResponses = {};
settleAllPromises.mockImplementation(() => apiResponses);
fetchCmsContentForPage.mockImplementation(() => { });
return { wrapper };
}
describe('provider-preference.vue', () => {
test('Should display state specific steering modal link when in state with steering language', async () => {
// Arrange
const { wrapper } = setupMocks({ showSteeringLink: true });
// Act
// Test
expect(wrapper.vm.showSteeringLink).toBeTruthy();
});
test('Should not display state specific steering modal link when not in state with steering language', async () => {
// Arrange
const { wrapper } = setupMocks({ showSteeringLink: false });
// Act
// Test
expect(wrapper.vm.showSteeringLink).toBeFalsy();
});
});

View file

@ -1,111 +0,0 @@
<template>
<modal
:ref="ModalName"
:modalId="ModalName"
:onModalClosedCallback="onModalClosed"
:footerButtonText="ModalCloseButtonText"
@footerButtonEvent="footerButtonClick">
<h5 class="text-center mb-4">
{{ ModalHeadline }}
</h5>
<div>
<div
class="mb-4"
v-html="ModalBodyText"></div>
<a
v-if="showSteeringLink"
class="modal-text"
@click="openSteeringModal"
v-html="ModalSubBodyText">
</a>
</div>
</modal>
</template>
<script>
import modal from '@/digital-components/modal/modal.vue';
import states from '@/constants/states';
export default {
name: 'content-group-modal',
components: {
modal
},
props: {
cmsWidgetName: String,
showSteeringLink: Boolean
},
emits: ['openSteering'],
data() {
return {
clickedSteeringLink: false
};
},
computed: {
ModalName() {
return this.cmsWidgetName;
},
ModalHeadline() {
return this.getCmsContent(this.cmsWidgetName, 'HeaderText');
},
ModalSubheadertext() {
return this.getCmsContent(this.cmsWidgetName, 'SubheaderText');
},
ModalBodyText() {
return this.getCmsContent(this.cmsWidgetName, 'BodyText');
},
ModalSubBodyText() {
const header = this.getCmsContent(this.cmsWidgetName, 'BodyText2');
return header.replace('{custom:state}', states[this.mainStore.order.customer.address.state]);
},
ModalImage() {
return this.getCmsContent(this.cmsWidgetName, 'Image');
},
ModalCloseButtonText() {
return this.getCmsContent(this.cmsWidgetName, 'FooterText');
}
},
methods: {
openModal() {
this.$refs[this.ModalName].openModal();
},
onModalClosed() {
if (this.clickedSteeringLink) {
this.$emit('openSteering');
this.clickedSteeringLink = false;
}
},
footerButtonClick() {
this.$refs[this.ModalName].closeModal();
},
openSteeringModal() {
this.clickedSteeringLink = true;
this.$refs[this.ModalName].closeModal();
}
}
};
</script>
<style lang="scss" scoped>
.modal {
&.modal-component {
.modal-dialog {
.modal-content {
.modal-body {
.modal-sub-body {
color: $gray-600;
}
ul {
margin-bottom: 0;
}
p {
&:last-child {
margin-bottom: 0;
}
}
}
}
}
}
}
</style>