Modals & onSuccess
Row action modals and post-success behavior
Router: ./ApiTables/table-modals/ApiTablesModals.tsx + ./ApiTables/table-modals/RowActionsModals.tsx
Modal triggers (row)
| Condition | Modal | State field |
|---|---|---|
onSuccess === "DisplayOnModal" | ViewRowData | clickedRowActionResponse |
need_confirmation | ConfirmationModal | clickedRowAction or bulk selectedBulkAction |
action_type === "custom_control" | Custom control Popup | customControlAction |
| Special API path | AnnouncementSingle | Same response popup |
ViewRowData supports table layout, key/value grid, barcode display, and copy_value fields from response payload.
ConfirmationModal
confirmationFor: "rowAction" | "bulkAction"
On confirm:
- Row →
rowActionsPostHandlerwith row payload - Bulk →
bulkActionsPostHandlerwith{ filters, selected_ids }
onSuccess handlers (row)
Implemented in useUtilsProvider after successful POST:
| onSuccess | Result |
|---|---|
reload | _triggerTableReload() |
deleteRow | Reload + clear clicked action |
refetchData | Replace all rows from response.items |
refetchRow | Patch single row by id |
downloadData | downloadURL |
download_pdf / downloadPdf | PDF download helpers |
generatePdf | generatePDF component flow |
OpenModalForm | Populate customControlAction; user closes popup manually |
DisplayOnModal | Set clickedRowActionResponse for view popup |
Closing modals
ApiTablesModals.handleCloseModal clears:
clickedRowActionResponseselectedBulkActionclickedRowActioncustomControlAction
handleCloseStaticModals clears rowSelectedModal (column datalist/html).
Loading UX
GeneralRowActionElementshows spinner whenclickedRowActionIdmatches rowrowActionPostLoadingavailable for global row POST state