Skip to content

[Part 1 / Phase 5] PathogenTestForm: Remove bridge methods and update section lifecycle #13857

@roldy

Description

@roldy

Problem Description

Context

Part of Epic: [Epic] PathogenTestForm: Composition + Stable Form Refactor
Blocked by: Phases 3 & 4

Clean up PathogenTestForm now that all sections are self-contained. Remove bridge methods,
instance vars that leaked into sections, and update swapDiseaseSection() to use the
rebuildSectionFieldAllowances() pattern.

Proposed Solution

Tasks

  • Remove bridge methods: addSectionField, addSectionTubeFields, addSectionDrugSusceptibilityField, removeSectionField, getCurrentDisease
  • Delete updateDrugSusceptibilityFieldSpecifications() — logic now lives in sections
  • Remove drugSusceptibilityField and genoTypingCB instance vars
  • Update swapDiseaseSection():
    • Call removeFromAllowedLists(oldIds) before unbind
    • Call rebuildSectionFieldAllowances(newIds) after bind
  • Add rebuildSectionFieldAllowances(Collection<String> fieldIds) private helper
  • Add removeFromAllowedLists(Collection<String> fieldIds) private helper
  • Add section-type guard for IGRA tube setVisibleClear calls in testTypeField listener
  • Replace updateDrugSusceptibilityFieldSpecifications() call with activeSection.onTestTypeChanged(...)
  • Move remaining disease-specific fields (serogroup, serotype, genotype) out of common HTML_LAYOUT

Additional Information

Acceptance Criteria

  • PathogenTestForm has no addSectionField, removeSectionField, getCurrentDisease, or updateDrugSusceptibilityFieldSpecifications methods
  • swapDiseaseSection() compiles with new helpers
  • mvn compile -pl sormas-ui passes

Metadata

Metadata

Labels

refactoringTechnical refactoring of an existing featuretaskSomething to be done that does not directly affect the software

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions