Skip to content

Commit 049ac62

Browse files
fix: keys and props fixed to avoid console warnings (#145)
1 parent 901173e commit 049ac62

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/authz-module/components/ResourceTooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ const ResourceTooltip = ({ resourceGroup }:ResourceTooltipProps) => (
1717
<p className="small">{resourceGroup.description}</p>
1818
<ul className="small">
1919
{resourceGroup.permissions.map(permission => (
20-
<li><b>{permission.label.trim()}:</b> {permission.description}</li>
20+
<li key={permission.key}><b>{permission.label.trim()}:</b> {permission.description}</li>
2121
))}
2222
</ul>
2323
</Popover.Content>
2424
</Popover>
2525
)}
2626
>
27-
<Icon className="d-inline-block text-gray-300 ml-2 my-auto" size="inline" src={Info} />
27+
<Icon className="d-inline-block text-gray-300 ml-2 my-auto" src={Info} />
2828
</OverlayTrigger>
2929
);
3030

src/authz-module/components/TableCells.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,14 @@ const ScopeCell = ({ row }: CellProps) => {
108108
);
109109
};
110110

111-
const RoleCell = ({ value, cell }: ExtendedCellProps) => (
112-
<span {...cell.getCellProps({ 'data-role': MAP_ROLE_KEY_TO_LABEL[value] || '' })}>
113-
{MAP_ROLE_KEY_TO_LABEL[value] || ''}
114-
</span>
115-
);
111+
const RoleCell = ({ value, cell }: ExtendedCellProps) => {
112+
const { key, ...cellProps } = cell.getCellProps({ 'data-role': MAP_ROLE_KEY_TO_LABEL[value] || '' });
113+
return (
114+
<span key={key} {...cellProps}>
115+
{MAP_ROLE_KEY_TO_LABEL[value] || ''}
116+
</span>
117+
);
118+
};
116119

117120
const PermissionsCell = ({ row }: CellProps) => {
118121
const { formatMessage } = useIntl();

0 commit comments

Comments
 (0)