diff --git a/src/constants/insurance.js b/src/constants/insurance.js index 075e899b9..fe4d2b8f9 100644 --- a/src/constants/insurance.js +++ b/src/constants/insurance.js @@ -85,4 +85,5 @@ export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [ export const PARENT_ACCOUNT_NUMBERS = { STATE_FARM: "711310", + USAA: "900040", }; \ No newline at end of file diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index c97a8589a..480cf505f 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -182,7 +182,7 @@ export default { await this.dispatchStoreAction( this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, - this.selectedAccount.parentAccountNumber.toString(), + Number(this.selectedAccount.parentAccountNumber).toString(), false ); diff --git a/src/layouts/policy-info/more-policy-questions/more-policy-questions.vue b/src/layouts/policy-info/more-policy-questions/more-policy-questions.vue index 89cf13286..0345efcda 100644 --- a/src/layouts/policy-info/more-policy-questions/more-policy-questions.vue +++ b/src/layouts/policy-info/more-policy-questions/more-policy-questions.vue @@ -18,6 +18,12 @@ import { PARENT_ACCOUNT_NUMBERS } from "@/constants/insurance"; const STATE_FARM_ONLY_ANSWER_NAMES = new Set(["ThirdPartyVehicle", "Injuries"]); 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 { name: "morePolicyQuestions", @@ -39,17 +45,34 @@ export default { PARENT_ACCOUNT_NUMBERS.STATE_FARM ); }, + stateFarmTextOverrides() { + return Object.fromEntries( + Object.entries(STATE_FARM_TEXT_OVERRIDES).map(([name, widget]) => [ + name, + this.getCmsContent(widget, "Text"), + ]) + ); + }, answersToDisplay() { if (!Array.isArray(this.answersFromCms)) return []; - return this.answersFromCms.filter((ans) => { - 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; - } - return true; - }); + return this.answersFromCms + .filter((ans) => { + 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; + } + return true; + }) + .map((ans) => { + if (!this.isStateFarm) return ans; + const overrideText = this.stateFarmTextOverrides[ans?.Name]; + if (overrideText) { + return { ...ans, Text: overrideText }; + } + return ans; + }); }, selectedValues: { get() { diff --git a/src/layouts/policy-info/policy-info.vue b/src/layouts/policy-info/policy-info.vue index f89e5db09..cee968882 100644 --- a/src/layouts/policy-info/policy-info.vue +++ b/src/layouts/policy-info/policy-info.vue @@ -18,15 +18,17 @@ +
@@ -107,6 +110,7 @@ :preventMinMaxNavigation="true" /> \ No newline at end of file