Skip to content

Commit

Permalink
Fix broken ids due to dots in action identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
woodwoerk committed Oct 9, 2023
1 parent 67f5078 commit a8e4cdb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions components/dashboard/ActionTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,29 @@ const ActionTableRow = ({ columns, action, plan, planViewUrl }: Props) => {
columnConfig;
const hasTooltip = !!renderTooltipContent;
const content = renderCell(action, plan, planViewUrl);
const id = `${action.identifier}-${i}`;
const id = `row-${action.id}-${i}`;
const className = `${cellClassName} ${
hasTooltip ? 'has-tooltip' : ''
} ${rowHeader ? 'row-title' : ''}`;
const tooltip = hasTooltip && (
<UncontrolledTooltip container={rowEl ?? undefined} target={id}>
{renderTooltipContent(action, plan)}
</UncontrolledTooltip>
);

if (rowHeader) {
return (
<th key={i} id={id} scope="row" className={className}>
{content}
{tooltip}
</th>
);
}

return (
<td key={i} id={id} className={className}>
{content}

{hasTooltip && (
<UncontrolledTooltip container={rowEl ?? undefined} target={id}>
{renderTooltipContent(action, plan)}
</UncontrolledTooltip>
)}
{tooltip}
</td>
);
})}
Expand Down

0 comments on commit a8e4cdb

Please sign in to comment.