From 13ea35f63162ad5ac901e77fa458aa0669abb93c Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 23 Feb 2024 21:50:46 +0800 Subject: [PATCH] a11y updates on table editor entity items (#21482) a11y updates on entity items. fixed bg-selection issue --- .../TableEditorLayout/EntityListItem.tsx | 278 ++++++++---------- 1 file changed, 130 insertions(+), 148 deletions(-) diff --git a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx index 60eef71bc66..054a596a557 100644 --- a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx +++ b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx @@ -118,161 +118,143 @@ const EntityListItem: ItemRenderer = ({ } return ( -
- - - - {entity.type === ENTITY_TYPE.TABLE ? ( - - ) : entity.type === ENTITY_TYPE.VIEW ? ( - - ) : ( -
- {Object.entries(ENTITY_TYPE) - .find(([, value]) => value === entity.type)?.[0]?.[0] - ?.toUpperCase()} -
- )} -
- - - - {formatTooltipText(entity.type)} - - -
-
- {/* only show tooltips if required, to reduce noise */} - {entity.name.length > 20 ? ( - - - {entity.name} - - - - - {entity.name} - - - + + + {entity.type === ENTITY_TYPE.TABLE ? ( + + ) : entity.type === ENTITY_TYPE.VIEW ? ( + ) : ( - entity.name - )} - - {entity.type === ENTITY_TYPE.TABLE && !entity.rls_enabled && ( -
- +
+ {Object.entries(ENTITY_TYPE) + .find(([, value]) => value === entity.type)?.[0]?.[0] + ?.toUpperCase()}
)} -
- -
- {entity.type === ENTITY_TYPE.TABLE && isActive && !isLocked && ( - - -
- -
-
- - { - e.stopPropagation() - snap.onEditTable() - }} - > - - Edit Table - - { - e.stopPropagation() - snap.onDuplicateTable() - }} - > - - Duplicate Table - - - - - View Policies - - - { - e.stopPropagation() - exportTableAsCSV() - }} - > - - Export as CSV - - - { - e.stopPropagation() - snap.onDeleteTable() - }} - > - - Delete Table - - -
+ + + + + {formatTooltipText(entity.type)} + + + +
+ {/* only show tooltips if required, to reduce noise */} + + {entity.name} + + + {entity.type === ENTITY_TYPE.TABLE && !entity.rls_enabled && ( + )}
-
+ + {entity.type === ENTITY_TYPE.TABLE && isActive && !isLocked && ( + + + + + + { + e.stopPropagation() + snap.onEditTable() + }} + > + + Edit Table + + { + e.stopPropagation() + snap.onDuplicateTable() + }} + > + + Duplicate Table + + + + + View Policies + + + { + e.stopPropagation() + exportTableAsCSV() + }} + > + + Export as CSV + + + { + e.stopPropagation() + snap.onDeleteTable() + }} + > + + Delete Table + + + + )} + ) }