From b18c151dd5795201b9fbf8b69b3faca5232f375e Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Wed, 2 Aug 2023 14:19:27 -0400 Subject: [PATCH] push changes in case i lose them fixing repo --- src/constants/error-messages.js | 10 +- src/constants/global-rules.js | 11 +- src/helpers/global-rule-definer.js | 39 ++- .../site-sub-header/site-sub-header.vue | 109 ++++---- src/layouts/bailout-page/bailout-page.vue | 233 ++++++++++++++++-- src/layouts/welcome-page/welcome-page.vue | 22 +- src/router/index.js | 36 ++- .../router-constants/navigation-scenarios.js | 3 +- src/router/router-constants/routing-table.js | 48 +++- 9 files changed, 393 insertions(+), 118 deletions(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 123cf07e..b03dba2f 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -21,18 +21,21 @@ const errorMessages = { SERVICE_ZIP_REQUIRED: 'Please enter your service ZIP', SERVICE_ZIP_FORMAT: 'Please enter a valid service ZIP', VIN_REQUIRED: 'Please enter your VIN', - VIN_FORMAT: 'Invalid VIN. Please make sure that you entered the correct 17-digit, alpha-numeric number. VINs do not contain the letters I, O, or Q', + VIN_FORMAT: + 'Invalid VIN. Please make sure that you entered the correct 17-digit, alpha-numeric number. VINs do not contain the letters I, O, or Q', OPTION_REQUIRED: 'Please select an option', VEHICLE_REQUIRED: 'Please select a vehicle', POLICY_NUMBER_REQUIRED: 'Please enter your policy number', PHONE_NUMBER_REQUIRED: 'Please enter phone number', PHONE_NUMBER_FORMAT: 'Please enter your phone number. The format must be ###-###-####', + PHONE_NUMBER_FORMAT_SHORT: 'Please enter a valid phone number', POLICY_ZIP_REQUIRED: 'Please enter your policy ZIP', POLICY_ZIP_FORMAT: 'Please enter a valid ZIP', LOSS_CAUSE_REQUIRED: 'Please enter loss cause', LOSS_CITY_REQUIRED: 'Please enter a city', LOSS_STATE_REQUIRED: 'Please select an option', - LOSS_DATE_REQUIRED: 'Please select a date. Format must be MM/DD/YYYY and the date must be not in the future', + LOSS_DATE_REQUIRED: + 'Please select a date. Format must be MM/DD/YYYY and the date must be not in the future', DAMAGE_OPTION_REQUIRED: 'Please select an option', POLICYHOLDER_FIRST_NAME_REQUIRED: 'Please enter the policyholder first name', @@ -43,7 +46,6 @@ const errorMessages = { MAKE_REQUIRED: 'Please select your vehicle make', MODEL_REQUIRED: 'Please select your vehicle model', STYLE_REQUIRED: 'Please select your vehicle style' - }; -export { errorMessages }; \ No newline at end of file +export { errorMessages }; diff --git a/src/constants/global-rules.js b/src/constants/global-rules.js index c78cd07e..aa65a5da 100644 --- a/src/constants/global-rules.js +++ b/src/constants/global-rules.js @@ -1,8 +1,8 @@ /** -* @file global-rules.js -* @author MB -* @copyright Safelite -*/ + * @file global-rules.js + * @author MB + * @copyright Safelite + */ /** * @summary Contains all the globally defined rules. @@ -12,10 +12,11 @@ const globalRules = { POLICYHOLDER_LAST_NAME_REQUIRED: 'policyholder-last-name-required', FIRST_NAME_REQUIRED: 'first-name-required', LAST_NAME_REQUIRED: 'last-name-required', - PHONE_NUMBER_REQUIRED: 'phone-number-required', EMAIL_ADDRESS_REQUIRED: 'email-required', EMAIL_ADDRESS_FORMAT: 'email-address-format', + PHONE_NUMBER_REQUIRED: 'phone-number-required', PHONE_NUMBER_FORMAT: 'phone-number-format', + PHONE_NUMBER_FORMAT_SHORT: 'phone-number-format-short', OPTION_REQUIRED: 'option-required' }; diff --git a/src/helpers/global-rule-definer.js b/src/helpers/global-rule-definer.js index 4763d8e6..4a33990b 100644 --- a/src/helpers/global-rule-definer.js +++ b/src/helpers/global-rule-definer.js @@ -9,10 +9,14 @@ import { required, regex } from '@/helpers/validation-rules'; function defineGlobalNameRules() { defineRule(globalRules.FIRST_NAME_REQUIRED, required(errorMessages.FIRST_NAME_REQUIRED)); defineRule(globalRules.LAST_NAME_REQUIRED, required(errorMessages.LAST_NAME_REQUIRED)); - defineRule(globalRules.POLICYHOLDER_FIRST_NAME_REQUIRED, - required(errorMessages.POLICYHOLDER_FIRST_NAME_REQUIRED)); - defineRule(globalRules.POLICYHOLDER_LAST_NAME_REQUIRED, - required(errorMessages.POLICYHOLDER_LAST_NAME_REQUIRED)); + defineRule( + globalRules.POLICYHOLDER_FIRST_NAME_REQUIRED, + required(errorMessages.POLICYHOLDER_FIRST_NAME_REQUIRED) + ); + defineRule( + globalRules.POLICYHOLDER_LAST_NAME_REQUIRED, + required(errorMessages.POLICYHOLDER_LAST_NAME_REQUIRED) + ); } /** @@ -20,9 +24,13 @@ function defineGlobalNameRules() { */ function defineGlobalEmailRules() { defineRule(globalRules.EMAIL_ADDRESS_REQUIRED, required(errorMessages.EMAIL_ADDRESS_REQUIRED)); - defineRule(globalRules.EMAIL_ADDRESS_FORMAT, - regex(/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/, - errorMessages.EMAIL_ADDRESS_FORMAT)); + defineRule( + globalRules.EMAIL_ADDRESS_FORMAT, + regex( + /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/, + errorMessages.EMAIL_ADDRESS_FORMAT + ) + ); } /** @@ -30,9 +38,20 @@ function defineGlobalEmailRules() { */ function defineGlobalPhoneNumberRules() { defineRule(globalRules.PHONE_NUMBER_REQUIRED, required(errorMessages.PHONE_NUMBER_REQUIRED)); - defineRule(globalRules.PHONE_NUMBER_FORMAT, - regex(/^(\([0-9]{3}\)|[0-9]{3}) *[-.]? *[0-9]{3} *[-.]? *[0-9]{4}$/, - errorMessages.PHONE_NUMBER_FORMAT)); + defineRule( + globalRules.PHONE_NUMBER_FORMAT, + regex( + /^(\([0-9]{3}\)|[0-9]{3}) *[-.]? *[0-9]{3} *[-.]? *[0-9]{4}$/, + errorMessages.PHONE_NUMBER_FORMAT + ) + ); + defineRule( + globalRules.PHONE_NUMBER_FORMAT_SHORT, + regex( + /^(\([0-9]{3}\)|[0-9]{3}) *[-.]? *[0-9]{3} *[-.]? *[0-9]{4}$/, + errorMessages.PHONE_NUMBER_FORMAT_SHORT + ) + ); } /** diff --git a/src/iss-components/site-sub-header/site-sub-header.vue b/src/iss-components/site-sub-header/site-sub-header.vue index c0f0ef77..eea079d9 100644 --- a/src/iss-components/site-sub-header/site-sub-header.vue +++ b/src/iss-components/site-sub-header/site-sub-header.vue @@ -1,35 +1,31 @@ + diff --git a/src/layouts/bailout-page/bailout-page.vue b/src/layouts/bailout-page/bailout-page.vue index b1f28816..274648ff 100644 --- a/src/layouts/bailout-page/bailout-page.vue +++ b/src/layouts/bailout-page/bailout-page.vue @@ -1,21 +1,57 @@