CASH-2468 customizations

CASH-2468 customizations
This commit is contained in:
CarlNation 2026-05-11 13:56:22 -04:00
parent df3cdebf2e
commit 35c1b1d650
4 changed files with 68 additions and 12 deletions

View file

@ -85,4 +85,5 @@ export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [
export const PARENT_ACCOUNT_NUMBERS = { export const PARENT_ACCOUNT_NUMBERS = {
STATE_FARM: "711310", STATE_FARM: "711310",
USAA: "900040",
}; };

View file

@ -182,7 +182,7 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
this.selectedAccount.parentAccountNumber.toString(), Number(this.selectedAccount.parentAccountNumber).toString(),
false false
); );

View file

@ -18,6 +18,12 @@ import { PARENT_ACCOUNT_NUMBERS } from "@/constants/insurance";
const STATE_FARM_ONLY_ANSWER_NAMES = new Set(["ThirdPartyVehicle", "Injuries"]); const STATE_FARM_ONLY_ANSWER_NAMES = new Set(["ThirdPartyVehicle", "Injuries"]);
const HIDDEN_FOR_STATE_FARM_ANSWER_NAMES = new Set(["OtherResponsibleParty"]); const HIDDEN_FOR_STATE_FARM_ANSWER_NAMES = new Set(["OtherResponsibleParty"]);
// Maps an answer's Name to the CMS widget that supplies a State Farm-specific
// label override. The widget's "Text" property replaces the answer's Text.
const STATE_FARM_TEXT_OVERRIDES = {
AdditionalDamage: "AdditionalDamageStateFarmWidget",
Rental: "RentalStateFarmWidget",
};
export default { export default {
name: "morePolicyQuestions", name: "morePolicyQuestions",
@ -39,17 +45,34 @@ export default {
PARENT_ACCOUNT_NUMBERS.STATE_FARM PARENT_ACCOUNT_NUMBERS.STATE_FARM
); );
}, },
stateFarmTextOverrides() {
return Object.fromEntries(
Object.entries(STATE_FARM_TEXT_OVERRIDES).map(([name, widget]) => [
name,
this.getCmsContent(widget, "Text"),
])
);
},
answersToDisplay() { answersToDisplay() {
if (!Array.isArray(this.answersFromCms)) return []; if (!Array.isArray(this.answersFromCms)) return [];
return this.answersFromCms.filter((ans) => { return this.answersFromCms
if (STATE_FARM_ONLY_ANSWER_NAMES.has(ans?.Name)) { .filter((ans) => {
return this.isStateFarm; if (STATE_FARM_ONLY_ANSWER_NAMES.has(ans?.Name)) {
} return this.isStateFarm;
if (HIDDEN_FOR_STATE_FARM_ANSWER_NAMES.has(ans?.Name)) { }
return !this.isStateFarm; if (HIDDEN_FOR_STATE_FARM_ANSWER_NAMES.has(ans?.Name)) {
} return !this.isStateFarm;
return true; }
}); return true;
})
.map((ans) => {
if (!this.isStateFarm) return ans;
const overrideText = this.stateFarmTextOverrides[ans?.Name];
if (overrideText) {
return { ...ans, Text: overrideText };
}
return ans;
});
}, },
selectedValues: { selectedValues: {
get() { get() {

View file

@ -18,15 +18,17 @@
<textBlock <textBlock
cmsWidgetName="PageInstructionsWidget" cmsWidgetName="PageInstructionsWidget"
typeStyle="body" typeStyle="body"
:customText="pageInstructionsText"
class="mb-5 text-left text-md-left" /> class="mb-5 text-left text-md-left" />
<textboxQuestion <textboxQuestion
isRequired isRequired
class="mb-4" class="mb-1"
cmsWidgetName="PolicyNumberWidget" :cmsWidgetName="policyNumberWidgetName"
v-model="policyNumber" v-model="policyNumber"
inputId="policyNumber" inputId="policyNumber"
validationRules="policy-number-required" /> validationRules="policy-number-required" />
<span v-if="displayPolicyHelperText" class="d-block mb-5 helper-text" v-html="policyHelperText"></span>
<datePickerPopup <datePickerPopup
v-if="displayDateOfBirth" v-if="displayDateOfBirth"
@ -79,6 +81,7 @@
cmsWidgetName="PhoneWidget" cmsWidgetName="PhoneWidget"
v-model="phoneNumber" v-model="phoneNumber"
inputId="phoneNumber" inputId="phoneNumber"
mask="###-###-####"
validationRules="phone-number-required" /> validationRules="phone-number-required" />
</div> </div>
<div class="col-12 col-md-4"> <div class="col-12 col-md-4">
@ -107,6 +110,7 @@
:preventMinMaxNavigation="true" /> :preventMinMaxNavigation="true" />
<dropdownQuestion <dropdownQuestion
v-if="displayLossTime"
isRequired isRequired
:questionText="timeOfLossQuestionText" :questionText="timeOfLossQuestionText"
class="mb-4" class="mb-4"
@ -210,6 +214,7 @@ import { Form, defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules"; import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages"; import { errorMessages } from "@/constants/error-messages";
import { regex } from "@/helpers/validation-rules"; import { regex } from "@/helpers/validation-rules";
import { PARENT_ACCOUNT_NUMBERS } from "@/constants/insurance";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
@ -279,6 +284,22 @@ export default {
pageTitleText() { pageTitleText() {
return this.clientConfig?.PageTitleOverrideWidget?.Text || this.getCmsContent("PageTitleWidget", "Text"); return this.clientConfig?.PageTitleOverrideWidget?.Text || this.getCmsContent("PageTitleWidget", "Text");
}, },
pageInstructionsText() {
return this.clientConfig?.PageInstructionsOverrideWidget?.Text || this.getCmsContent("PageInstructionsWidget", "Text");
},
isUSAA() {
return (
store.getters.order?.payment?.parentAccountNumber?.toString() ===
PARENT_ACCOUNT_NUMBERS.USAA
);
},
policyNumberWidgetName() {
console.log("isUSAA", this.isUSAA);
return this.isUSAA ? "PolicyNumberUSAAWidget" : "PolicyNumberWidget";
},
policyHelperText() {
return this.clientConfig?.PolicyHelperTextOverrideWidget?.Text;
},
damageTypesQuestionText() { damageTypesQuestionText() {
return this.getCmsContent("DamageTypesWidget", "QuestionText"); return this.getCmsContent("DamageTypesWidget", "QuestionText");
}, },
@ -349,6 +370,9 @@ export default {
displayLossTime() { displayLossTime() {
return this.parsedClientConfig.displayLossTime ?? false; return this.parsedClientConfig.displayLossTime ?? false;
}, },
displayPolicyHelperText() {
return this.policyHelperText !== null && this.policyHelperText !== "";
},
subrogationQuestionText() { subrogationQuestionText() {
return this.getCmsContent("SubrogationQuestionWidget", "QuestionText"); return this.getCmsContent("SubrogationQuestionWidget", "QuestionText");
}, },
@ -492,4 +516,12 @@ export default {
color: $gray-600; color: $gray-600;
line-height: 1.625; line-height: 1.625;
} }
.helper-text {
font-size: 14px !important;
font-weight: 400;
color: $gray-600;
line-height: 1.625;
font-style: italic;
}
</style> </style>