diff --git a/src/constants/dynamic-strings.js b/src/constants/dynamic-strings.js
index fdadc6f1..b81c0f30 100644
--- a/src/constants/dynamic-strings.js
+++ b/src/constants/dynamic-strings.js
@@ -2,7 +2,7 @@ const dynamicStrings = {
GLOBAL_STATE: "globalState",
CUSTOM: "custom",
ROUTER_LINK: "routerLink:",
- TEXT_LINK: "textLink:"
+ MODAL_LINK: "modalLink"
};
export { dynamicStrings };
\ No newline at end of file
diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js
index 36d21a69..27cc4df1 100644
--- a/src/constants/endpoints.js
+++ b/src/constants/endpoints.js
@@ -98,6 +98,10 @@ const endpoints = {
url: "/clientauth/api/v1/clientauth/validateClientTag",
method: "GET",
},
+ IsVinbyAddressPermissible:{
+ url:"/vehicle/api/v1/vehicle/is-vin-by-address-permissible",
+ method:"Get",
+ }
};
export { endpoints };
diff --git a/src/constants/vin-lookup-methods.js b/src/constants/vin-lookup-methods.js
index a12f29eb..ce2f2859 100644
--- a/src/constants/vin-lookup-methods.js
+++ b/src/constants/vin-lookup-methods.js
@@ -1,7 +1,7 @@
-const VIN_LOOKUP_METHODS = Object.freeze({
- manualVin: 'ManualVin',
- licensePlate: 'LicensePlate',
- homeAddress: 'HomeAddress',
+const vinLookupMethodSelections = Object.freeze({
+ MANUALVIN: 'ManualVin',
+ LICENSEPLATE: 'LicensePlate',
+ HOMEADDRESS: 'HomeAddress',
});
-export default VIN_LOOKUP_METHODS;
+export {vinLookupMethodSelections};
diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue
index 010eea5b..628b7c48 100644
--- a/src/digital-components/button-question/button-question.vue
+++ b/src/digital-components/button-question/button-question.vue
@@ -229,7 +229,7 @@ export default {
.overflow-scroll {
// Height will be determined by overall height of content above list
- height: calc(100% - 314px);
+ height: calc(100% - 383px);
overflow-x: hidden !important;
-webkit-overflow-scrolling: touch;
}
diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js
index 95fb1850..30255527 100644
--- a/src/helpers/cms-content-helper.js
+++ b/src/helpers/cms-content-helper.js
@@ -124,6 +124,9 @@ function processWidgetItemForReplacement(widgetModel, key) {
if (widgetModel[key].includes(dynamicStrings.GLOBAL_STATE)) {
widgetModel[key] = mapStringToState(widgetModel[key]);
}
+ if (widgetModel[key].includes(dynamicStrings.MODAL_LINK)) {
+ widgetModel[key] = mapStringToModal(widgetModel[key]);
+ }
return widgetModel[key];
}
@@ -143,6 +146,18 @@ function processWidgetItemForReplacement(widgetModel, key) {
return widgetModel[key];
}
+function mapStringToModal(str) {
+ let startIndex = str.indexOf("{" + dynamicStrings.MODAL_LINK);
+ let linkToReplace = str.substring(startIndex, str.length);
+ linkToReplace = linkToReplace.substring(0, linkToReplace.indexOf("}") + 1);
+
+ let params = linkToReplace.substring((dynamicStrings.MODAL_LINK).length + 2, linkToReplace.length -1)
+ let splitParams = params.split(",");
+ let bodyText = '' + splitParams[1] +''
+
+ return str.replace(linkToReplace, bodyText);
+}
+
// Function to convert a string, into a matching global state item.
function mapStringToState(str) {
// Pull all matches out of the string.
@@ -185,10 +200,6 @@ export function doesCopyContainRouterLink(copy) {
return copy.includes(this.dynamicStrings.ROUTER_LINK);
}
-export function doesCopyContainTextLink(copy) {
- return copy.includes(this.dynamicStrings.TEXT_LINK);
-}
-
export function splitCopyOnCMSPlaceHolder(copy) {
// splits copy on { ... } such as {routerlink: ...}
return copy.split(/{(.*?)}/g);
diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue
index 22dde734..7778c6e6 100644
--- a/src/layouts/coverage-statement/coverage-statement.vue
+++ b/src/layouts/coverage-statement/coverage-statement.vue
@@ -18,45 +18,12 @@
+ >
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
part.requiresRecalibration).length > 0) {
+ return this.unverifiedADASNextStepsBodyText;
+ }
+ // if non-ADAS, display NonADASNextSteps
+ else {
+ return this.unverifiedNonADASNextStepsBodyText;
+ }
+ }
+ },
continueWithSchedulingBodyText() {
return this.getCmsContent('continueWithSchedulingCopy', 'BodyText');
},
unverifiedADASNextStepsBodyText() {
- return this.getCmsContent('UnverifiedADASNextStepsWidget', 'BodyText').replaceAll("{custom:damage}", getDamageString());
+ return this.getCmsContent('UnverifiedADASNextStepsWidget', 'BodyText').replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASNextStepsBodyText() {
- return this.getCmsContent('UnverifiedNonADASNextStepsWidget', 'BodyText').replaceAll("{custom:damage}", getDamageString());
+ return this.getCmsContent('UnverifiedNonADASNextStepsWidget', 'BodyText').replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASRepairBodyText() {
return this.getCmsContent('UnverifiedNonADASRepairWidget', 'BodyText');
},
- splitADASCoverageStatementCopy() {
- // Splits content when brackets are found in text so that text can be looped through and text-link can be injected when needed
- return this.splitCopyOnCMSPlaceHolder(this.unverifiedADASNextStepsBodyText);
+ damageText() {
+ var damageString = getDamageString();
+ return damageString == "match" ? "" : damageString;
},
- arrayOfListItemsFromBodyText() {
- return this.getArrayOfListItemsFromRawCmsCopy(this.unverifiedADASNextStepsBodyText);
- }
},
async beforeRouteEnter(to, from, next) {
// Call APIs
@@ -179,32 +143,6 @@ export default {
*/
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
- displayReplaceCoverageStatement() {
- // get array of parts for vehicle
- let parts = useMainStore().order.lineItems.glassParts;
-
- // loop through parts to check for ADAS
- for (let part of parts) {
- // if ADAS, display ADASNextSteps
- if (part.requiresRecalibration) {
- this.unverifiedADASNextSteps = true
- }
- // if non-ADAS, display NonADASNextSteps
- else {
- this.unverifiedNonADASNextSteps = true
- }
- }
- },
- stripOlTagFromCopy(copy) {
- const regex = /(?:)|(?:<\/ol>)/g;
- return copy.replace(regex, "");
- },
- getArrayOfListItemsFromRawCmsCopy(copy) {
- const withoutOlTags = this.stripOlTagFromCopy(copy);
- return withoutOlTags
- .split(/(?:- )|(?:<\/li>)/g)
- .filter((lineItem) => lineItem);
- },
},
async forwardButtonAction() {},
resetDependentState() {},
diff --git a/src/layouts/provider-preference/provider-preference.vue b/src/layouts/provider-preference/provider-preference.vue
new file mode 100644
index 00000000..6e8c2067
--- /dev/null
+++ b/src/layouts/provider-preference/provider-preference.vue
@@ -0,0 +1,69 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js
index 12a84a88..491adc70 100644
--- a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js
+++ b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js
@@ -5,6 +5,7 @@ import { issPageValues } from '@/router/router-constants/issPage-values';
import { queryStrings } from '@/constants/query-strings';
import { GaActions } from "@/constants/analytics";
import VehicleLookup from './vehicle-lookup.vue';
+import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
const vinLookupMethodsMockData = {
QuestionText: 'To find the right part, let’s get your VIN. Or we can look it up for you!',
@@ -47,6 +48,10 @@ function setupMocks() {
const mockRouter = {
navigate: jest.fn(),
};
+
+ const mockIsVinbyAddressPermissibleToBeFalse={
+ IsVinbyAddressPermissible:false,
+ };
const wrapper = mount(VehicleLookup, {
data() {
@@ -95,7 +100,7 @@ function setupMocks() {
],
mocks: {
$route: mockRoute,
- $router: mockRouter,
+ $router: mockRouter,
},
stubs: {
SiteHeader: true,
@@ -105,10 +110,29 @@ function setupMocks() {
},
});
- return { mockRoute, mockRouter, wrapper };
+ return { mockRoute, mockRouter, wrapper,mockIsVinbyAddressPermissibleToBeFalse };
}
describe('vehicle-lookup.vue', () => {
+ test('IsVinbyAddressPermissible to be false', () => {
+ const { wrapper,mockIsVinbyAddressPermissibleToBeFalse } = setupMocks();
+
+ const vinLookupMethodsWrapper = wrapper.findComponent({ name: 'vin-lookup-methods' });
+ // Not using initializeComponent() because it doesn't trigger reactivity in test.
+ const Answers = JSON.parse(JSON.stringify(vinLookupMethodsMockData.Answers));
+ if(!mockIsVinbyAddressPermissibleToBeFalse.IsVinbyAddressPermissible){
+ Answers.splice(Answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1);
+ }
+ vinLookupMethodsWrapper.setData({
+ questionTextFromCms: vinLookupMethodsMockData.QuestionText,
+ answersFromCms: Answers,
+ });
+
+ const lookupByAddressOptionLabel = wrapper.find('[data-test-id="vin-lookup-methods-button-question"] label[for="VinLookupMethods-HomeAddress"]');
+ expect(lookupByAddressOptionLabel.exists()).toBe(false);
+
+ });
+
test('"Continue" button is disabled when no VIN Lookup method is selected.', () => {
const { wrapper } = setupMocks();
diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.vue b/src/layouts/vehicle-lookup/vehicle-lookup.vue
index 34124672..4f16ccd5 100644
--- a/src/layouts/vehicle-lookup/vehicle-lookup.vue
+++ b/src/layouts/vehicle-lookup/vehicle-lookup.vue
@@ -38,7 +38,7 @@ 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';
-import VIN_LOOKUP_METHODS from '@/constants/vin-lookup-methods';
+import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
// Import Component
import SiteFooter from '@/iss-components/site-footer/site-footer.vue';
@@ -98,13 +98,13 @@ export default {
},
forwardButtonAction() {
switch (this.selectedVinLookupMethod) {
- case VIN_LOOKUP_METHODS.manualVin:
+ case vinLookupMethodSelections.MANUALVIN:
this.$router.navigate(this.navigationScenarios.SELECTED_MANUAL_VIN, this.$route);
break;
- case VIN_LOOKUP_METHODS.licensePlate:
+ case vinLookupMethodSelections.LICENSEPLATE:
this.$router.navigate(this.navigationScenarios.SELECTED_LICENSE_PLATE, this.$route);
break;
- case VIN_LOOKUP_METHODS.homeAddress:
+ case vinLookupMethodSelections.HOMEADDRESS:
this.$router.navigate(this.navigationScenarios.SELECTED_HOME_ADDRESS, this.$route);
break;
default:
diff --git a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue
index e5b8bee2..392dbdfa 100644
--- a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue
+++ b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue
@@ -16,6 +16,9 @@
import { defineRule } from 'vee-validate';
import { required } from '@/helpers/validation-rules';
import { errorMessages } from '@/constants/error-messages';
+import { useMainStore } from "@/store";
+import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods';
+import { settleAllPromises } from "@/helpers/layout-helper";
// Import Component
import ButtonQuestion from '@/digital-components/button-question/button-question.vue';
@@ -38,6 +41,7 @@ export default {
required,
},
},
+
emits: ['update:modelValue'],
components: {
ButtonQuestion,
@@ -53,14 +57,31 @@ export default {
},
},
methods: {
- initializeComponent() {
+ async initializeComponent() {
+ const isVinbyAddressPermissible = await this.getIsVinbyAddressPermissible();
this.questionTextFromCms = this.getCmsContent(this.cmsWidgetName, 'QuestionText');
const answers = this.getCmsContent(this.cmsWidgetName, 'Answers');
if (Array.isArray(answers)) {
+ if(!isVinbyAddressPermissible){
+ answers.splice(answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1);
+ }
this.answersFromCms = answers;
}
},
+ async getIsVinbyAddressPermissible(){
+ const isVinbyAddressPermissibleResponse = useMainStore().getIsVinbyAddressPermissible();
+ // Settle promises and get results
+ const promiseResultMap = [
+ {
+ resultKey: "isVinbyAddressPermissible",
+ promise: isVinbyAddressPermissibleResponse,
+ }
+ ];
+
+ const resultMap = await settleAllPromises(promiseResultMap);
+ return resultMap.isVinbyAddressPermissible;
+ }
},
};
diff --git a/src/store/index.js b/src/store/index.js
index de09569f..3604e55b 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -98,7 +98,7 @@ const getDefaultState = () => {
triggeredSiteEntry: false,
},
issConfig: {
- clientName: "",
+ clientName: "Generic Insurance", // this is the default and will be overriden by the client's name
clientDisplayName: "",
styleSheet: "",
accountNumber: 0,
@@ -300,7 +300,22 @@ export const useMainStore = defineStore({
payload: {},
});
},
-
+ getIsVinbyAddressPermissible(){
+ try{
+ const response = globalMethods.callHttpClient({
+ method:endpoints.IsVinbyAddressPermissible.method,
+ endpoint:`${endpoints.IsVinbyAddressPermissible.url}?state=${this.order.customer.address.state}`,
+ payload: {},
+ });
+ return response;
+ } catch (responseError) {
+ return {
+ error: {
+ status: responseError.status,
+ },
+ };
+ }
+ },
async lookupVinByPlate(licensePlate, licenseState) {
try {
const response = await globalMethods.callHttpClient({
@@ -1032,7 +1047,7 @@ export const useMainStore = defineStore({
resetPartsAndDependencies() {
this.resetGlassPartsState();
this.updateSupportingItems(null);
- },
+ },
},
persist: true
});