diff --git a/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.test.tsx index 0ddb633cd1f5c..8d0dba194520c 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.test.tsx @@ -120,8 +120,6 @@ describe('SpaceAssignedRolesTable', () => { expect(screen.getByTestId('checkboxSelectAll')).toBeInTheDocument(); }); - // it('will not render the bulk actions context menu when the table is in readOnly mode', () => {}) - it('prevents modification of reserved roles', () => { renderTestComponent({ assignedRoles: spaceAssignedRoles, @@ -134,8 +132,7 @@ describe('SpaceAssignedRolesTable', () => { expect(trisolarisRow).toBeInTheDocument(); - // We expect a length of 2 because EUI also adds a second node for screen readers - expect(within(trisolarisRow).getAllByText('Reserved')).toHaveLength(2); + expect(within(trisolarisRow).getAllByText('Reserved')).toHaveLength(1); expect(within(trisolarisRow).getByTestId('spaceRoleCellActionLocked')).toBeInTheDocument(); expect(within(trisolarisRow).getByTestId('spaceRoleCellActionLocked')).toBeDisabled(); expect( diff --git a/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.tsx b/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.tsx index f59bd00561671..ca58a724df928 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/roles/component/space_assigned_roles_table.tsx @@ -9,6 +9,7 @@ import { EuiBadge, EuiButton, EuiButtonEmpty, + EuiButtonIcon, EuiContextMenu, EuiFlexGroup, EuiFlexItem, @@ -18,6 +19,7 @@ import { EuiPopover, EuiText, EuiTextColor, + EuiToolTip, } from '@elastic/eui'; import type { CriteriaWithPagination, @@ -140,33 +142,43 @@ const getTableColumns = ({ ), actions: [ { - type: 'icon', - icon: 'lock', - href: '#', - target: '_self', - 'data-test-subj': 'spaceRoleCellActionLocked', - name: (role) => - isRoleReserved(role) - ? i18n.translate( - 'xpack.spaces.management.spaceDetails.rolesTable.column.actions.notEditableTitle.isReserved', - { defaultMessage: 'Reserved' } - ) - : i18n.translate( - 'xpack.spaces.management.spaceDetails.rolesTable.column.actions.notEditableTitle.isAssignedToAll', - { defaultMessage: 'Assigned to all spaces' } - ), - description: (role) => - isRoleReserved(role) - ? i18n.translate( - 'xpack.spaces.management.spaceDetails.rolesTable.column.actions.notEditableDescription.isReserved', - { defaultMessage: `You can’t edit the access of reserved roles to this space.` } - ) - : i18n.translate( - 'xpack.spaces.management.spaceDetails.rolesTable.column.actions.notEditableDescription.isAssignedToAll', - { - defaultMessage: `You can't edit the access of a role that is assigned to all spaces.`, + render: (role) => { + return ( + + + + ); + }, showOnHover: true, enabled: () => false, available: (rowRecord) => !isEditableRole(rowRecord),