Skip to content

Refactor: Standardize ModalForm with Split Cancel Logic #2844

@pestler

Description

@pestler

Refactor: Standardize ModalForm with Split Cancel Logic

  1. Modify ModalForm.tsx:

    • Update the component's Props type to replace cancel with the new onCancel and onFooterCancel props.
    • Implement a custom footer for the underlying Ant Design Modal component.
    • The onCancel event of the Modal will be wired to our new onCancel prop.
    • The onClick handler of the custom "Cancel" button in the footer will be wired to our new onFooterCancel prop.
  2. Update Component Integrations:

    • Identify all components throughout the codebase that currently use ModalForm.
    • For each component, update its ModalForm instance to use the new props.
    • For components that do not require split-cancel behavior: Pass the same handler function to both props to maintain the original functionality (e.g.,
      <ModalForm onCancel={handleClose} onFooterCancel={handleClose} ... />).
    • For components that require split-cancel behavior (like TaskModal): Provide two different handler functions to implement the desired user
      experience.
  3. Testing & Verification:

    • Thoroughly test all updated modals to confirm that both onCancel and onFooterCancel are triggered correctly.

Metadata

Metadata

Assignees

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions