diff --git a/jest.config.js b/jest.config.js index 812d1b36c..7a8b2eb2b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -25,6 +25,7 @@ module.exports = { "!src/layouts/payment/*.vue", // Temp test exclusion while in development "!src/layouts/payment-pia-return/*.vue", // Temp test exclusion while in development "!src/layouts/insurance/*.vue", // Temp test exclusion while in development + "!src/layouts/insurance-company/*.vue", // Temp test exclusion while in development // END ], // ! means exclude from coverage. testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], diff --git a/package-lock.json b/package-lock.json index 91e44113b..eef1c9479 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,8 @@ "http-status-codes": "^2.1.4", "iframe-resizer": "^4.3.7", "jest-junit": "^13.0.0", + "jquery": "^3.7.1", + "jquery-ui": "^1.13.2", "maska": "^1.5.0", "vee-validate": "^4.5.7", "vue": "^3.0.0", @@ -16173,6 +16175,19 @@ "node": ">=6" } }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + }, + "node_modules/jquery-ui": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.13.2.tgz", + "integrity": "sha512-wBZPnqWs5GaYJmo1Jj0k/mrSkzdQzKDwhXNtHKcBdAcKVxMM3KNYFq+iJ2i1rwiG53Z8M4mTn3Qxrm17uH1D4Q==", + "dependencies": { + "jquery": ">=1.8.0 <4.0.0" + } + }, "node_modules/js-beautify": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.0.tgz", @@ -37364,6 +37379,19 @@ } } }, + "jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + }, + "jquery-ui": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.13.2.tgz", + "integrity": "sha512-wBZPnqWs5GaYJmo1Jj0k/mrSkzdQzKDwhXNtHKcBdAcKVxMM3KNYFq+iJ2i1rwiG53Z8M4mTn3Qxrm17uH1D4Q==", + "requires": { + "jquery": ">=1.8.0 <4.0.0" + } + }, "js-beautify": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.0.tgz", diff --git a/package.json b/package.json index d99b971c2..3c9cc10fa 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "http-status-codes": "^2.1.4", "iframe-resizer": "^4.3.7", "jest-junit": "^13.0.0", + "jquery": "^3.7.1", + "jquery-ui": "^1.13.2", "maska": "^1.5.0", "vee-validate": "^4.5.7", "vue": "^3.0.0", diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index ea40af19d..592d2d668 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -164,6 +164,10 @@ const endpoints = { url: "/experiments/api/v1/experiments/run", method: "POST", }, + GetInsuranceCompanyList: { + url: "/account/api/v1/account/insurance-companies", + method: "GET", + }, }; export { endpoints }; diff --git a/src/constants/experiments.js b/src/constants/experiments.js index 18ca6387d..bd480636f 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -7,6 +7,7 @@ const experimentSettings = { SUPPRESS_VIN_CAPTURE: "SuppressVinCapture", DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators", PIA_EXPERIENCE: "PIA Experience", + PIA_INSURANCE: "DisplayPIAInsurance", SUBMIT_ORDER_ENABLE_PIA: "SubmitOrder_Enable_PIA", IS_EMAIL_OPTIONAL: "isEmailOptional", }; diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index 12089fca5..76411c542 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -22,6 +22,9 @@ const queryStrings = { LAST_FOUR: "last_four", DISPLAY_PIA_ALERT: "displayPiaAlert", PAGE_ERROR: "pageerror", + REFERRAL_NUMBER: "rn", + PARENT_ACCOUNT: "pa", + CORRELATION_ID: "ci", }; export { queryStrings }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index d77237170..36be92432 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -51,6 +51,7 @@ const storeActions = { GET_SIGNATURE: "getSignature", VALIDATE_ORDER_PROMO_AND_SAVE_SERVER_DATA: "validateOrderPromoAndSaveServerData", REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA: "revalidateOrderPromosAndSaveServerData", + GET_INSURANCE_COMPANY_LIST: "getInsuranceCompanyList", // DEPENDENCY MUTATIONS RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies", diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index dc99951da..13e845f08 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -252,9 +252,6 @@ export default { .input-wrapper { position: relative; &.has-search-icon { - input[type="text"] { - border-radius: 50rem; - } button[type="submit"] { position: absolute; top: 50%; @@ -263,13 +260,14 @@ export default { background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%231574A1'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; background-position: center; - border-radius: 0 50rem 50rem 0; - background-color: $blue-100; + background-color: transparent; width: 2.75rem; height: 100%; - border: 1px solid $gray-500; - border-left: none; + border: none; display: flex; + &:hover { + cursor: default; + } } } &.has-camera-icon { diff --git a/src/layouts/insurance-company/insurance-company-spec.js b/src/layouts/insurance-company/insurance-company-spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue new file mode 100644 index 000000000..9d4682622 --- /dev/null +++ b/src/layouts/insurance-company/insurance-company.vue @@ -0,0 +1,208 @@ + + + + diff --git a/src/layouts/insurance/insurance.spec.js b/src/layouts/insurance/insurance.spec.js deleted file mode 100644 index 3ad2b30cc..000000000 --- a/src/layouts/insurance/insurance.spec.js +++ /dev/null @@ -1,3 +0,0 @@ -describe("insurance", () => { - it.todo("Should render a normal string"); -}); diff --git a/src/layouts/insurance/insurance.vue b/src/layouts/insurance/insurance.vue deleted file mode 100644 index 88441fd9a..000000000 --- a/src/layouts/insurance/insurance.vue +++ /dev/null @@ -1,326 +0,0 @@ - - - diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index b54265ebe..6d233a797 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -512,8 +512,12 @@ export default { }, isPiaDisabled() { const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE); + const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE); - const isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required"; + const isEnabled = + piaExperience === "PIA Optional" || + piaExperience === "PIA Required" || + piaInsurance === "true"; return !isEnabled; }, diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 27093cfdf..96123b03a 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -92,7 +92,6 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; import { Form, defineRule } from "vee-validate"; -import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { applicationConfig } from "@/constants/application-config"; import { payWithInsuranceStates } from "@/constants/pay-with-insurance-states"; import { @@ -324,15 +323,10 @@ export default { const payment = this.$store.getters.payment; if (payment.isInsurance) { - navigateToHeritageFunnel({ - shouldSaveSession: true, - pageNameToLog: "quote", - loadingModal: this.$refs.loadingModal, - }); - // this.$router.navigateWithSaving( - // this.navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE, - // this.$route - // ); + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE, + this.$route + ); } else { this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_CASH, diff --git a/src/main.js b/src/main.js index d65165398..1017651f8 100644 --- a/src/main.js +++ b/src/main.js @@ -8,8 +8,12 @@ import baseMixin from "@/mixins/base-mixin.js"; import analyticsMixin from "@/mixins/analytics-mixin.js"; import experimentMixin from "@/mixins/experiment-mixin.js"; import "../node_modules/bootstrap/dist/js/bootstrap.js"; -import Logger from "@/helpers/logger"; +import "../node_modules/jquery-ui/dist/jquery-ui.min.js"; +// Make jQuery avaialble globally +window.$ = window.jQuery = require("jquery"); + +import Logger from "@/helpers/logger"; // Instantiate global logging object global.$logger = new Logger(); diff --git a/src/router/index.js b/src/router/index.js index c5484be14..90ac5881b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -75,6 +75,25 @@ const routes = [ if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release + + // for testing end to end locally, see if there is a referralNumber on the querystring + // that could have changed in heritage and then stick it in the store and then update the cookie + // so load-session runs properly. this can be removed when heritage goes away + const referralNumber = getQuerystringParameter( + queryStrings.REFERRAL_NUMBER + ); + const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); + const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); + if (referralNumber) { + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); + store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount); + store.commit( + storeMutations.UPDATE_REFERRAL_CORRELATION_ID, + correlationId + ); + updateOrCreateFunnelCookie(); + } + const loadSessionResponse = await loadSessionIfPresent( to.query.isInsurance != null ? to.query.isInsurance == "true" diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js index b70d9ec9f..356fbf2c1 100644 --- a/src/router/router-constants/fmgPage-values.js +++ b/src/router/router-constants/fmgPage-values.js @@ -11,7 +11,8 @@ const fmgPageValues = { ESTIMATE: "estimate", ADDRESS_VEHICLES: "address-vehicles", QUOTE: "quote", - INSURANCE: "insurance", + INSURANCE_COMPANY: "insurance-company", + INSURANCE_DETAILS: "insurance-details", SERVICE_LOCATION: "service-location", HERITAGE: "heritage", SCHEDULE: "schedule", diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index a7d993d62..afa6baf82 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -391,12 +391,12 @@ const routingTable = function (store) { }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE, - destinationFmgPageValue: fmgPageValues.INSURANCE, + destinationFmgPageValue: fmgPageValues.INSURANCE_COMPANY, }, ], }, { - fmgPageValue: fmgPageValues.INSURANCE, + fmgPageValue: fmgPageValues.INSURANCE_COMPANY, maps: [ { scenario: navigationScenarios.CLICKED_BACK, @@ -404,7 +404,7 @@ const routingTable = function (store) { }, { scenario: navigationScenarios.CLICKED_FORWARD, - destinationFmgPageValue: fmgPageValues.SCHEDULE, + destinationFmgPageValue: fmgPageValues.INSURANCE_DETAILS, }, ], }, diff --git a/src/store/index.js b/src/store/index.js index 20b84af21..4fe96703e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2463,6 +2463,28 @@ export const actions = { return revalidateResponse?.data; }, + // List all insurance companies + async getInsuranceCompanyList(context, { pageNameToLog }) { + const insuranceCompanyList = await globalMethods.callHttpClient({ + method: endpoints.GetInsuranceCompanyList.method, + endpoint: endpoints.GetInsuranceCompanyList.url, + payload: {}, + logApiCall: true, + pageNameToLog: pageNameToLog, + }); + + return insuranceCompanyList.data.sort((a, b) => { + const nameA = a.accountName.toUpperCase(); + const nameB = b.accountName.toUpperCase(); + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; + }); + }, // Misc order actions saveSchedule(context, scheduleInfo) {