Repository navigation
Refactor/row actions - #380
Conversation
…rd a null row actions
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
The sortable table does not pass the row-disabled flag to RowActionsMenu, leaving Edit/Delete clickable for disabled rows.
1 open issue
What changed in this PR
Consolidates Edit and Delete into a shared row-actions menu across MuiTable, EditableTable, and SortableTable, with support for custom per-row actions.
Changes:
- Replaces separate action columns with an always-visible menu column.
- Adds custom actions, shared disabled-state handling, and a translated menu label.
- Updates table tests to use menu interactions and cover custom actions.
| File | Description |
|---|---|
src/i18n/en.json |
Adds the “More actions” label. |
src/components/mui/tables/sortable-table/index.js |
Integrates the shared menu and custom row actions. |
src/components/mui/tables/mui-table/index.js |
Replaces responsive action collapsing with a single menu column. |
src/components/mui/tables/editable-table/index.js |
Integrates the menu and disables built-in actions on disabled rows. |
src/components/mui/tables/components/row-actions-menu.js |
Adds built-in actions, custom items, and trigger accessibility attributes. |
src/components/mui/__tests__/mui-table.test.js |
Tests menu callbacks, deletion visibility, and disabled states. |
src/components/mui/__tests__/mui-table-sortable.test.js |
Updates action tests and adds custom-action coverage. |
src/components/mui/__tests__/mui-table-editable.test.js |
Updates menu tests, disabled-state checks, and cell expectations. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| onEdit, | ||
| onArchive, | ||
| onDelete, | ||
| getRowActions, |
There was a problem hiding this comment.
this would entail a change in every single instance of MuiTable, touching too many lines in show admin and sponsor services. What is the point of this ? Can we avoid passing it as prop and keep using columns with a flag to mark it as an action ? We need to try to be as little invasive as possible.
There was a problem hiding this comment.
It was an optional way to add items into the row actions 3 dots button. No tables use it yet so I can just remove it. I'll hold off on making the flag until there's a real need to add column buttons into the row actions button.
| {onDelete && <TableCell sx={{ ...ACTION_CELL_SX, ...getIndividualActionSx() }} />} | ||
| {onSelect && <TableCell sx={{ ...ACTION_CELL_SX, ...getIndividualActionSx() }} />} | ||
| {collapseActions && <TableCell sx={{ ...ACTION_CELL_SX, ...menuCellSx }} />} | ||
| {onArchive && <TableCell sx={ACTION_CELL_SX} />} |
There was a problem hiding this comment.
Leaving "Archive" out of the menu is on purpose ? just checking
There was a problem hiding this comment.
I was going to put this in a follow up pr.
There was a problem hiding this comment.
Also, I'm sorry I didn't clarify earlier, but I am closing #377 and splitting up the table action changes into smaller PRs (including this one).
santipalenque
left a comment
There was a problem hiding this comment.
LGTM, just a couple of nit picks if you want to make the code cleaner
| aria-haspopup="true" | ||
| aria-expanded={anchorEl ? "true" : undefined} | ||
| disabled={ | ||
| (!hasBuiltIns || disabled) && actions.every((action) => action.disabled) |
There was a problem hiding this comment.
lets move this to its own const
| open={Boolean(anchorEl)} | ||
| onClose={() => setAnchorEl(null)} | ||
| > | ||
| {onEdit && ( |
There was a problem hiding this comment.
looks like if we merge actions with onEdit, the code gets simpler

ref: https://app.clickup.com/t/9014802374/86bcxj2kh
Summary
Replaces the separate Edit and Delete icon columns in
MuiTable,EditableTableandSortableTablewith a single ⋮ row actions menu.getRowActions(row)prop on all three tables for extra menu items ({ label, onClick, disabled }).options.disableProp): Edit and Delete are greyed out. The ⋮ button stays enabled while any custom action is enabled.EditableTablenow disables them too; before, its Edit and Delete stayed clickable on disabled rows.canDelete(row) === falsehides Delete inMuiTable.MuiTabledrops its responsive "collapse actions into a menu" behaviour, because the menu is now always used.general.more_actions.BulkEditTableandSortableTableV2since they are not in summit admin. I scoped it to summit admin so it is easier to manage.Follow ups
-Move archiving into the row actions button
-Create linkable cells instead of full row clicks. For example, clicking the name of a summit brings you to the corresponding edit page.
Breaking changes (fixes are in fntechgit/summit-admin#1147)
data-testid="action-edit"/"action-delete"and theEditIcon/DeleteIconbuttons are gone. Tests should clickrow-actions-menu-trigger, then select themenuitemby name.onEditandonDeletehave one fewer action column. Extra rows passed as children with fixed column spans (e.g.TotalRowtrailing) need adjusting.options.responsiveis now ignored.Question
-Should table rows be editable/deletable when archived?