Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions frontend/src/components/widgets/resource-table/ResourceTable.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@
color: #1890ff;
}

/* Names the action for screen readers without an aria-label, which would
replace the owner text the button's contents already announce. */
.resource-table-sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}

/* Actions column */
.resource-table-actions {
justify-content: flex-end;
Expand Down
33 changes: 14 additions & 19 deletions frontend/src/components/widgets/resource-table/ResourceTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,6 @@ function ResourceTable({
item?.co_owners_count > 1 ? ` +${item.co_owners_count - 1}` : "";
const initials = (email || name).slice(0, 2).toUpperCase();
const swatch = colorForSeed(email || name);
// With co-owners, name only the primary inline (+N); the tooltip lists all
// owners so search hitting a hidden co-owner is still explainable.
const ownerTooltip =
Array.isArray(ownerEmails) && ownerEmails.length > 1
? ownerEmails.join(", ")
: `${name}${extra}`;

const cell = (
<Space size={10} className="resource-table-owner">
Expand All @@ -228,7 +222,7 @@ function ResourceTable({
<div className="resource-table-owner-text">
<Typography.Text
className="resource-table-owner-name"
ellipsis={{ tooltip: ownerTooltip }}
ellipsis={{ tooltip: `${name}${extra}` }}
>
{name}
{extra}
Expand All @@ -250,18 +244,19 @@ function ResourceTable({
return cell;
}
return (
<Tooltip title="Manage Co-Owners">
<button
type="button"
className="resource-table-owner-btn"
onClick={(event) => {
event.stopPropagation();
handleCoOwner(event, item);
}}
>
{cell}
</button>
</Tooltip>
<button
type="button"
className="resource-table-owner-btn"
onClick={(event) => {
event.stopPropagation();
handleCoOwner(event, item);
}}
>
{cell}
<span className="resource-table-sr-only">
Manage co-owners{item?.[titleProp] ? ` for ${item[titleProp]}` : ""}
</span>
</button>
);
};

Expand Down
Loading