Clean dead code in FieldArrayForm slice
This commit is contained in:
@@ -1579,13 +1579,10 @@ const RenderFileUpload = (field) => {
|
||||
export const FieldArrayForm = (props) => {
|
||||
const {
|
||||
name,
|
||||
label,
|
||||
validation,
|
||||
form,
|
||||
formProps,
|
||||
parentFieldShowOnValue,
|
||||
parentField,
|
||||
maxFieldLength,
|
||||
maxSubField
|
||||
} = props;
|
||||
|
||||
@@ -1599,18 +1596,12 @@ export const FieldArrayForm = (props) => {
|
||||
formProps[form].values[parentField].toString()
|
||||
) > -1;
|
||||
|
||||
(showIfHasParentShowValue == parentField) != false &&
|
||||
showIfHasParentShowValue;
|
||||
|
||||
useEffect(() => {
|
||||
if (!showIfHasParentShowValue) {
|
||||
dispatch(change("appealForm", name, null));
|
||||
}
|
||||
}, [dispatch, name, showIfHasParentShowValue]);
|
||||
|
||||
parentFieldShowOnValue;
|
||||
const { handleSubmit, pristine, reset, submitting } = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
|
||||
@@ -3499,3 +3499,32 @@ Validation:
|
||||
Follow-ups:
|
||||
|
||||
- Continue avoiding dispatch/state mutations inside render for field visibility toggles.
|
||||
|
||||
---
|
||||
|
||||
### CL-098: 22500 `FieldArrayForm` bounded dead-code cleanup
|
||||
|
||||
date: 2026-04-07
|
||||
author: Cline
|
||||
scope: `components/elements/index.js`
|
||||
type: change
|
||||
rationale: Continue bounded Phase 2 cleanup with a lowest-risk slice by removing unused locals/destructured props in `FieldArrayForm`.
|
||||
impact: No intended behavior change; purely removes unused values left from legacy implementation.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Removed unused destructured props from `FieldArrayForm`: `label`, `validation`, `maxFieldLength`.
|
||||
- Removed no-op/dead lines in `FieldArrayForm`:
|
||||
- redundant boolean expression line
|
||||
- unused `parentFieldShowOnValue;` expression
|
||||
- unused `handleSubmit/pristine/reset/submitting` destructure
|
||||
- Kept visibility logic, effect-driven clearing behavior, and `FieldArray` rendering path unchanged.
|
||||
|
||||
Validation:
|
||||
|
||||
- `npx eslint components/elements/index.js` -> pass
|
||||
|
||||
Follow-ups:
|
||||
|
||||
- Continue Phase 2 with one bounded slice at a time; next low-risk target can be similar dead-code/no-op cleanup in another isolated renderer block.
|
||||
|
||||
Reference in New Issue
Block a user