diff --git a/jest.config.js b/jest.config.js index f6178df61..33b7d1138 100644 --- a/jest.config.js +++ b/jest.config.js @@ -28,4 +28,6 @@ module.exports = { // Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90 }, }, + // Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit + // silent: true, }; diff --git a/src/constants/analytics.js b/src/constants/analytics.js index eed7da2fe..b5b24660d 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -19,6 +19,7 @@ const GaActions = { CLICKED: "Clicked", VIF: "vif", SUBMITTED: "Submitted", + DISPLAYED: "Displayed", }; const GaLabels = { diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 92d967f39..7d83642a6 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -90,6 +90,14 @@ const endpoints = { url: "/parts/api/v1/parts/supporting-items", method: "POST", }, + GetAlertReasons: { + url: "/location/api/v1/location/alert-reasons", + method: "GET", + }, + GetProviders: { + url: "/location/api/v1/location/providers", + method: "GET", + }, GetCapabilityQuestions: { url: "/parts/api/v1/parts/capability-questions", method: "GET", diff --git a/src/constants/scheduling.js b/src/constants/scheduling.js deleted file mode 100644 index 0ded16a32..000000000 --- a/src/constants/scheduling.js +++ /dev/null @@ -1,18 +0,0 @@ -const monthsOfYear = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", -]; - -const daysOfWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; - -export { monthsOfYear, daysOfWeek }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index b84c004fa..341fcd487 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -21,6 +21,7 @@ const storeActions = { LOOKUP_VIN_BY_PLATE: "lookupVinByPlate", LOOKUP_VIN_BY_ADDRESS: "lookupVinByAddress", LOOKUP_VIN_BY_IMAGE: "lookupVinByImage", + GET_ALERT_REASONS_BY_CTU: "getAlertReasonsByCtu", GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions", GET_PARTS: "getParts", GET_WIPERS: "getWipers", @@ -32,6 +33,7 @@ const storeActions = { GET_MOBILE_FEE_PART: "getMobileFeePart", GET_SERVICEABILITY_DETAILS: "getServiceabilityDetails", GET_SHOP_TIME_SLOTS: "getShopTimeSlots", + GET_PROVIDERS: "getProviders", GET_MOBILE_EARLY_BIRD_FEE: "getMobileEarlyBirdFee", SAVE_SESSION: "saveSession", LOAD_SESSION: "loadSession", @@ -61,6 +63,7 @@ const storeActions = { SAVE_VEHICLE_DAMAGE: "saveVehicleDamage", SAVE_VIN_LOOKUP: "saveVinLookup", SAVE_SERVICE_LOCATION: "saveServiceLocation", + SAVE_SCHEDULE: "saveSchedule", SAVE_EMAIL: "saveEmail", SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup", SAVE_VIN: "saveVin", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 840aff30d..8eeb70c99 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -33,6 +33,7 @@ const storeMutations = { UPDATE_REGISTRATION: "updateRegistration", UPDATE_SERVICE_LOCATION: "updateServiceLocation", + UPDATE_SCHEDULE: "updateSchedule", UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress", diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 07b837e4e..632a3c258 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -87,6 +87,7 @@ import listButtonHorizontal from "@/ux-components/list-button-horizontal/list-bu import listCard from "@/ux-components/list-card/list-card"; import radio from "@/ux-components/radio/radio"; import { useField, ErrorMessage } from "vee-validate"; +import { queryStrings } from "@/constants/query-strings"; export default { name: "buttonQuestion", @@ -119,7 +120,7 @@ export default { isRequired: Boolean, isOverflowScrollable: Boolean, isWide: Boolean, - modelValue: [Array, Number, String], + modelValue: [Array, Number, String, Object], value: [Number, String], validationRules: String, suppressError: Boolean, @@ -128,6 +129,10 @@ export default { additionalButtonStyling: String, isSmallQuestionText: Boolean, customButtonQuestionId: String, + logDisplayedValuesEvent: { + type: Boolean, + default: false, + }, }, setup(props) { const propsClone = Object.assign({}, props); @@ -250,8 +255,33 @@ export default { }, }, watch: { - modelValue() { - this.resetField(); + modelValue(newValue) { + this.resetField({ + value: newValue, + }); + }, + answers() { + //once we get the answers to display from parent, see if we need a GA event to log what we showed + if (this.logDisplayedValuesEvent && this.answers.length > 0) { + var eventLabel = ""; + //build comma separated list of all items in button list that we are going to display on page + this.answers.forEach((item) => { + if (item.Name) { + eventLabel += item.Name + ","; + } + if (item.buttonLabel) { + eventLabel += item.buttonLabel + ","; + } + }); + + eventLabel = eventLabel.slice(0, -1); //remove the last comma + this.pushEventToGA( + this.$route.query[queryStrings.FMG_PAGE], + this.GaActions.DISPLAYED, + eventLabel, + true + ); + } }, }, components: { diff --git a/src/digital-components/date-picker/date-picker-spec.js1 b/src/digital-components/date-picker/date-picker-spec.js1 deleted file mode 100644 index 3d0843e10..000000000 --- a/src/digital-components/date-picker/date-picker-spec.js1 +++ /dev/null @@ -1 +0,0 @@ -test.todo("some test to be written in the future"); diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 26cd90637..d83050f1a 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -1,5 +1,5 @@