Refactor: Standardize ModalForm with Split Cancel Logic
-
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.
-
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.
-
Testing & Verification:
- Thoroughly test all updated modals to confirm that both onCancel and onFooterCancel are triggered correctly.
Refactor: Standardize ModalForm with Split Cancel Logic
Modify
ModalForm.tsx:Update Component Integrations:
<ModalForm onCancel={handleClose} onFooterCancel={handleClose} ... />).
TaskModal): Provide two different handler functions to implement the desired userexperience.
Testing & Verification: