From b42d55c51744362e030a12646483ca97700614c2 Mon Sep 17 00:00:00 2001 From: James Dinh Date: Mon, 1 Jul 2024 10:37:11 -0700 Subject: [PATCH] fix(abp1-fixes): add hcd feedback to ABP1 * add all abp1 v2 changes * add horizontal radio button logic * add clear data button * add parent ID into RHF slot * Update SlotField.tsx * add logic to show hide incremental amount * Update textarea.tsx * Update v202402.ts * add px changes * Update v202402.ts * Update tailwind.config.js * add additional prop classname * Update v202402.ts * cleanup --- src/packages/shared-types/forms.ts | 1 + src/packages/shared-types/inputs.ts | 1 + src/services/api/webforms/ABP1/v202402.ts | 592 ++++++++++-------- .../ui/src/components/Inputs/button.tsx | 2 +- .../ui/src/components/Inputs/input.tsx | 10 +- src/services/ui/src/components/RHF/Slot.tsx | 14 +- .../ui/src/components/RHF/SlotField.tsx | 5 +- .../src/components/RHF/dependencyWrapper.tsx | 6 +- .../ui/src/features/webforms/WebFormBody.tsx | 2 +- 9 files changed, 347 insertions(+), 286 deletions(-) diff --git a/src/packages/shared-types/forms.ts b/src/packages/shared-types/forms.ts index f600c1050..1810f5081 100644 --- a/src/packages/shared-types/forms.ts +++ b/src/packages/shared-types/forms.ts @@ -33,6 +33,7 @@ export type RHFSlotProps = { descriptionClassName?: string; dependency?: DependencyRule; rules?: RegisterOptions; + horizontalLayout?: boolean; } & { [K in keyof RHFComponentMap]: { rhf: K; diff --git a/src/packages/shared-types/inputs.ts b/src/packages/shared-types/inputs.ts index 23164f1df..7d839f281 100644 --- a/src/packages/shared-types/inputs.ts +++ b/src/packages/shared-types/inputs.ts @@ -18,6 +18,7 @@ export type DatePickerProps = { export interface InputProps extends React.InputHTMLAttributes { icon?: string; + iconRight?: boolean; } export type RadioProps = React.ComponentPropsWithoutRef< diff --git a/src/services/api/webforms/ABP1/v202402.ts b/src/services/api/webforms/ABP1/v202402.ts index 4aecbb886..874ff24d1 100644 --- a/src/services/api/webforms/ABP1/v202402.ts +++ b/src/services/api/webforms/ABP1/v202402.ts @@ -17,6 +17,9 @@ export const v202402: FormSchema = { name: "abp-pop-name", label: "ABP package name", labelClassName: "font-bold", + props: { + className: "w-[355px]", + }, rules: { required: "* Required", pattern: { @@ -24,7 +27,6 @@ export const v202402: FormSchema = { message: "Must not have leading or trailing whitespace.", }, }, - props: { placeholder: "enter name" }, }, ], }, @@ -51,222 +53,224 @@ export const v202402: FormSchema = { className: "w-[300px]", options: [ { - label: "Parents and Other Caretaker Relatives", - value: "parents_caretaker_relatives", + label: "Adult", + value: "adult", }, { - label: "Transitional Medical Assistance", - value: "transitional_medical_assist", + label: + "Aged, blind, and disabled individuals in 209(b) states", + value: "aged_blind_disabled_individuals_209b_states", }, { label: - "Extended Medicaid Due to Spousal Support Collections", - value: "extend_medicaid_spousal_support_collect", + "Aged, blind, or disabled individuals eligible for but not receiving cash", + value: + "aged_blind_disabled_eligible_but_not_receiving_cash", }, { - label: "Pregnant Women", - value: "pregnant_women", + label: "Blind or disabled individuals eligible in 1937", + value: "blind_disabled_eligible_1973", }, { - label: "Deemed Newborns", - value: "deemed_newborns", + label: + "Certain individuals needing treatment for breast or cervical cancer", + value: + "individuals_need_treatment_for_breasts_cervical_cancer", }, { - label: "Infants and Children under Age 19", - value: "infants_children_under_19", + label: "Children with non-IV-E adoption assistance", + value: "children_non-IV-E_adoption_assistance", }, { label: - "Children with Title IV-E Adoption Assistance, Foster Care or Guardianship Care", + "Children with Title IV-E adoption assistance, foster care, or guardianship care", value: "children_title_IV-E_adoption_assist_foster_guardianship_care", }, { - label: "Former Foster Care Children", - value: "former_foster_children", + label: "Deemed newborns", + value: "deemed_newborns", }, { - label: "Adult Group", - value: "adult_group", + label: "Disabled adult children", + value: "disabled_adult_children", }, { - label: "SSI Beneficiaries", - value: "ssi_beneficiaries", + label: + "Disabled widows and widowers ineligible for SSI due to early receipt of Social Security", + value: + "disabled_widows_ineligible_SSI_due_to_early_receipt_social_security", }, { label: - "Aged, Blind and Disabled Individuals in 209(b) States", - value: "aged_blind_disabled_individuals_209b_states", + "Disabled widows and widowers ineligible for SSI due to increase in OASDI", + value: + "disabled_widows_ineligible_SSI_due_to_increase_OASDI", }, { label: - "Individuals Receiving Mandatory State Supplements", - value: - "individuals_receiving_mandatory_state_supplements", + "Extended Medicaid due to spousal support collections", + value: "extend_medicaid_spousal_support_collect", }, { - label: "Individuals Who Are Essential Spouses", - value: "essential_spouses", + label: + "Family Opportunity Act children with disabilities", + value: "family_opportunity_act_children_disabilities", }, { - label: "Institutionalized Individuals Eligible in 1973", - value: "institutionalized_eligible_1973", + label: "Former foster care children", + value: "former_foster_children", }, { - label: "Blind or Disabled Individuals Eligible in 1937", - value: "blind_disabled_eligible_1937", + label: "Independent foster care adolescents", + value: "independent_foster_care_adolescents", }, { label: - "Individuals Who Lost Eligibility for SSI/SSP Due to an Increase in OASDI Benefits in 1972", - value: - "lost_eligibility_SSI_SSP_increase_in_OASDI_benefits_1972", + "Individuals eligible for cash except for institutionalization", + value: "eligible_cash_except_for_institutionalization", }, { label: - "Individuals Eligible for SSI/SSP but for OASDI COLA increases since April, 1977", + "Individuals eligible for SSI/SSP but for OASDI COLA increases since April 1977", value: "eligible_SSI_SSP_but_for_OASDI_COLA_increases_April_1977", }, { label: - "Disabled Widows and Widowers Ineligible for SSI due to Increase in OASDI", + "Individuals receiving home and community-based services under institutional rules", value: - "disabled_widows_ineligible_SSI_due_to_increase_OASDI", + "receiving_home_community_services_under_inst_rule", + }, + { + label: "Individuals receiving hospice care", + value: "hospice_care", }, { label: - "Disabled Widows and Widowers Ineligible for SSI due to Early Receipt of Social Security", + "Individuals receiving mandatory state supplements", value: - "disabled_widows_ineligible_SSI_due_to_early_receipt_social_security", + "individuals_receiving_mandatory_state_supplements", }, { - label: "Working Disabled under 1619(b)", - value: "working_disabled_under_1619b", + label: "Individuals who are essential spouses", + value: "essential_spouses", }, { - label: "Disabled Adult Children", - value: "disabled_adult_children", + label: + "Individuals who lost eligibility for SSI/SSP due to an increase in OASDI benefits in 1972", + value: + "lost_eligibility_SSI_SSP_increase_in_OASDI_benefits_1972", }, { - label: - "Optional Coverage of Parents and Other Caretaker Relatives", - value: "opt_coverage_parents_other_caretaker_relatives", + label: "Individuals with tuberculosis", + value: "tuberculosis", }, { - label: - "Reasonable Classifications of Individuals under Age 21", - value: "reasonable_class_under_21", + label: "Infants and children under age 19", + value: "infants_children_under_19", }, { - label: "Children with Non-IV-E Adoption Assistance", - value: "children_Non-IV-E_adoption_assistance", + label: + "Institutionalized individuals continuously eligible since 1973", + value: "institutionalized_eligible_1973", }, { - label: "Independent Foster Care Adolescents", - value: "independent_foster_care_adolescents", + label: + "Institutionalized individuals eligible under a special income level", + value: "inst_eligible_under_special_income_level", }, { - label: "Optional Targeted Low Income Children", - value: "opt_targeted_low_income_children", + label: "Medically needy aged, blind, or disabled", + value: "med_needy_aged_blind_disabled", }, { label: - "Certain Individuals Needing Treatment for Breast or Cervical Cancer", + "Medically needy blind or disabled individuals eligible in 1973", value: - "individuals_need_treatment_for_breasts_cervical_cancer", + "med_needy_aged_blind_disabled_individuals_eligible_in_1973", }, { - label: "Individuals with Tuberculosis", - value: "tuberculosis", + label: "Medically needy children age 18 through 20", + value: "med_needy_age_18_through_20", }, { - label: - "Aged, Blind or Disabled Individuals Eligible for but Not Receiving Cash", - value: - "aged_blind_disabled_eligible_but_not_receiving_cash", + label: "Medically needy children under age 18", + value: "med_needy_children_under_18", }, { - label: - "Individuals Eligible for Cash except for Institutionalization", - value: "eligible_cash_except_for_institutionalization", + label: "Medically needy parents and other caretakers", + value: "med_needy_parents_caretakers", + }, + { + label: "Medically needy pregnant women", + value: "med_needy_pregnant_women", }, { label: - "Individuals Receiving Home and Community Based Services under Institutional Rules", - value: - "receiving_home_community_services_under_inst_rule", + "Optional coverage of parents and other caretaker relatives", + value: "opt_coverage_parents_other_caretaker_relatives", }, { label: - "Optional State Supplement - 1634 States and SSI Criteria States with 1616 Agreements", + "Optional state supplement - 1634 states and SSI criteria states with 1616 agreements", value: "opt_state_supp_1634_states_SSI_criteria_states_1616_agreements", }, { label: - "Optional State Supplement - 209(b) States and SSI Criteria States without 1616 Agreements", + "Optional state supplement - 209(b) states and SSI criteria states without 1616 agreements", value: "opt_state_supp_209b_states_SSI_criteria_states_without_1616_agreements", }, { - label: - "Institutionalized Individuals Eligible under a Special Income Level", - value: "inst_eligible_under_special_income_level", + label: "Optional targeted low-income children", + value: "opt_targ_low_income_children", }, { - label: "Individuals Receiving Hospice Care", - value: "hospice_care", - }, - { - label: "Qualified Disabled Children under Age 19 ", - value: "qualified_disabled_children_under_19", - }, - { - label: "Poverty Level Aged or Disabled", - value: "poverty_level_aged_disabled", + label: "Parents and other caretaker relatives", + value: "parents_caretaker_relatives", }, { - label: "Work Incentives Eligibility Group", - value: "work_incentives_eligibility_group", + label: "Poverty-level aged or disabled", + value: "poverty_level_aged_or_disabled", }, { - label: "Ticket to Work Basic Group", - value: "ticket_work_basic_group", + label: "Pregnant women", + value: "pregnant_women", }, { - label: "Ticket to Work Medical Improvements Group", - value: "ticket_work_medical_imp_group", + label: "Qualified disabled children under age 19", + value: "qualified_disabled_children_under_19", }, { label: - "Family Opportunity Act Children with Disabilities", - value: "family_opportunity_act_children_disabilities", + "Reasonable classifications of individuals under age 21", + value: "reasonable_class_under_21", }, { - label: "Medically Needy Pregnant Women", - value: "med_needy_pregnant_women", + label: "SSI beneficiaries", + value: "ssi_beneficiaries", }, { - label: "Medically Needy Children under Age 18", - value: "med_needy_children_under_18", + label: "Ticket to Work basic", + value: "ticket_work_basic", }, { - label: "Medically Needy Children Age 18 through 20", - value: "med_needy_age_18_through_20", + label: "Ticket to Work medical improvements", + value: "ticket_work_medical_imp_group", }, { - label: "Medically Needy Parents and Other Caretakers", - value: "med_needy_parents_caretakers", + label: "Transitional medical assistance", + value: "transitional_medical_assist", }, { - label: "Medically Needy Aged, Blind or Disabled", - value: "med_needy_aged_blind_disabled", + label: "Work incentives", + value: "work_incentives", }, { - label: - "Medically Needy Blind or Disabled Individuals Eligible in 1973", - value: "med_needy_blind_disabled_eligible_1973", + label: "Working disabled under 1619(b)", + value: "working_disabled_under_1619b", }, ], }, @@ -405,6 +409,8 @@ export const v202402: FormSchema = { rhf: "Input", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -433,6 +439,8 @@ export const v202402: FormSchema = { labelClassName: "font-bold", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -456,6 +464,8 @@ export const v202402: FormSchema = { labelClassName: "font-bold", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -510,20 +520,18 @@ export const v202402: FormSchema = { name: "income-def-specific-state", props: { appendText: - "Add Standard", + "Add standard", }, fields: [ { rhf: "Input", label: "Household size", + name: "house-size", labelClassName: "font-bold", - name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -544,8 +552,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -561,50 +567,57 @@ export const v202402: FormSchema = { }, ], }, - ], - }, - { - slots: [ { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", + }, + ], + }, + }, + { + rhf: "Input", + label: "Incremental amount", + name: "increment-amount", + labelClassName: "font-bold", + props: { + icon: "$", + className: "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "abp1_target-criteria_is-increment-amount", + type: "expectedValue", + expectedValue: "yes", }, ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: "* Required", }, }, ], @@ -621,9 +634,9 @@ export const v202402: FormSchema = { rhf: "FieldGroup", name: "income-def-specific-statewide-group-region", props: { - appendText: "Add Region", + appendText: "Add region", removeText: - "Remove Region", + "Remove region", }, fields: [ { @@ -676,10 +689,8 @@ export const v202402: FormSchema = { "font-bold", name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -701,8 +712,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -719,48 +728,63 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", }, ], }, }, + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", + }, + ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", + }, + }, ], }, ], @@ -780,7 +804,7 @@ export const v202402: FormSchema = { name: "liv-arrange", props: { appendText: - "Add Living Arrangement", + "Add living arrangement", removeText: "Remove living arrangement", }, @@ -836,10 +860,8 @@ export const v202402: FormSchema = { "font-bold", name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -861,8 +883,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -879,46 +899,62 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "incremental_amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", + }, + ], + }, + }, + + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", }, ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", }, }, ], @@ -937,7 +973,7 @@ export const v202402: FormSchema = { slots: [ { rhf: "FieldGroup", - name: "add-some-other-way", + name: "add-other-way", props: { appendText: "Add other way", @@ -991,14 +1027,12 @@ export const v202402: FormSchema = { rhf: "Input", label: "Household size", + name: "house-size", labelClassName: "font-bold", - name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -1020,8 +1054,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -1038,48 +1070,63 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", }, ], }, }, + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", + }, + ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", + }, + }, ], }, ], @@ -1100,8 +1147,7 @@ export const v202402: FormSchema = { }, { value: "health", - label: - "Disease, condition, diagnosis, or disorder (check all that apply)", + label: "Disease, condition, diagnosis, or disorder", slots: [ { rhf: "Checkbox", @@ -1206,7 +1252,7 @@ export const v202402: FormSchema = { ], }, { - title: "Geographic Area", + title: "Geographic area", sectionId: "geo-area", form: [ { @@ -1354,12 +1400,14 @@ export const v202402: FormSchema = { sectionId: "additional-info", form: [ { - description: - "Any other information the state/territory wishes to provide about the population (optional)", + description: "Other information about the population (optional)", slots: [ { name: "description", rhf: "Textarea", + props: { + className: "min-h-[114px]", + }, rules: { pattern: { value: /^\S(.*\S)?$/, diff --git a/src/services/ui/src/components/Inputs/button.tsx b/src/services/ui/src/components/Inputs/button.tsx index 64bab3ce9..c7dc73e74 100644 --- a/src/services/ui/src/components/Inputs/button.tsx +++ b/src/services/ui/src/components/Inputs/button.tsx @@ -6,7 +6,7 @@ import { cn } from "@/utils"; import { Loader2 } from "lucide-react"; const buttonVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center rounded-md text-base font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { diff --git a/src/services/ui/src/components/Inputs/input.tsx b/src/services/ui/src/components/Inputs/input.tsx index 11d97b8ae..dbe043b4f 100644 --- a/src/services/ui/src/components/Inputs/input.tsx +++ b/src/services/ui/src/components/Inputs/input.tsx @@ -3,18 +3,20 @@ import { cn } from "@/utils"; import { InputProps } from "shared-types"; const Input = React.forwardRef( - ({ className, icon, ...props }, ref) => { + ({ className, icon, iconRight, ...props }, ref) => { return ( -
+
{icon && ( - + {icon} )} {(label || styledLabel) && ( @@ -55,7 +58,12 @@ export const RHFSlot = < )} - + {description && !descriptionAbove && ( diff --git a/src/services/ui/src/components/RHF/SlotField.tsx b/src/services/ui/src/components/RHF/SlotField.tsx index 2c82891b1..22c3f0f0b 100644 --- a/src/services/ui/src/components/RHF/SlotField.tsx +++ b/src/services/ui/src/components/RHF/SlotField.tsx @@ -52,6 +52,7 @@ export const SlotField = ({ parentId, fields, name, + horizontalLayout, }: SlotFieldProps) => { switch (rhf) { case "Input": @@ -211,7 +212,7 @@ export const SlotField = ({ {(props as RHFComponentMap["Radio"]).options.map((OPT) => { return ( @@ -275,7 +276,7 @@ export const OptChildren = ({ control={control} name={parentId + SLOT.name} {...(SLOT.rules && { rules: SLOT.rules })} - render={RHFSlot({ ...SLOT, parentId, control })} + render={RHFSlot({ ...SLOT, control, parentId })} />
))} diff --git a/src/services/ui/src/components/RHF/dependencyWrapper.tsx b/src/services/ui/src/components/RHF/dependencyWrapper.tsx index e2234fb87..929017de8 100644 --- a/src/services/ui/src/components/RHF/dependencyWrapper.tsx +++ b/src/services/ui/src/components/RHF/dependencyWrapper.tsx @@ -4,7 +4,7 @@ import { DependencyRule, DependencyWrapperProps } from "shared-types"; const checkTriggeringValue = ( dependentValue: unknown[], - dependency?: DependencyRule + dependency?: DependencyRule, ) => { return !!dependency?.conditions?.every((d, i) => { switch (d.type) { @@ -27,7 +27,7 @@ const checkTriggeringValue = ( }; export const DependencyWrapper = ( - props: PropsWithChildren + props: PropsWithChildren, ) => { // Check for dependencies which won't exist outside of forms if ( @@ -51,7 +51,7 @@ const DependencyWrapperHandler = ({ const { watch, setValue } = useFormContext(); const [wasSetLast, setWasSetLast] = useState(false); const dependentValues = watch( - dependency?.conditions?.map((c) => c.name) ?? [] + dependency?.conditions?.map((c) => c.name) ?? [], ); const isTriggered = dependency && checkTriggeringValue(dependentValues, dependency); diff --git a/src/services/ui/src/features/webforms/WebFormBody.tsx b/src/services/ui/src/features/webforms/WebFormBody.tsx index 6af2337fb..256639725 100644 --- a/src/services/ui/src/features/webforms/WebFormBody.tsx +++ b/src/services/ui/src/features/webforms/WebFormBody.tsx @@ -83,7 +83,7 @@ const ClearDataButton: FC<{ reset: () => void }> = ({ reset }) => { if (clearDataButton) { return ( ); }