Auth: Update `disabledMessage` to make better use of info box (#76687)

* refactor: make better use of info box for basic roles

* linting fix
pull/76760/head
Eric Leijonmarck 2 years ago committed by GitHub
parent c99b978857
commit 9ef390a81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      public/app/features/admin/Users/OrgUsersTable.tsx

@ -30,7 +30,7 @@ import { TableWrapper } from './TableWrapper';
type Cell<T extends keyof OrgUser = keyof OrgUser> = CellProps<OrgUser, OrgUser[T]>; type Cell<T extends keyof OrgUser = keyof OrgUser> = CellProps<OrgUser, OrgUser[T]>;
const disabledRoleMessage = `This user's role is not editable because it is synchronized from your auth provider. const disabledRoleMessage = `This user's role is not editable because it is synchronized from your auth provider.
Refer to the Grafana authentication docs for details.`; Refer to the Grafana authentication docs for details.`;
const getBasicRoleDisabled = (user: OrgUser) => { const getBasicRoleDisabled = (user: OrgUser) => {
let basicRoleDisabled = !contextSrv.hasPermissionInMetadata(AccessControlAction.OrgUsersWrite, user); let basicRoleDisabled = !contextSrv.hasPermissionInMetadata(AccessControlAction.OrgUsersWrite, user);
@ -151,7 +151,25 @@ export const OrgUsersTable = ({
return ( return (
basicRoleDisabled && ( basicRoleDisabled && (
<Box display={'flex'} alignItems={'center'} marginLeft={1}> <Box display={'flex'} alignItems={'center'} marginLeft={1}>
<Tooltip content={disabledRoleMessage}> <Tooltip
interactive={true}
content={
<div>
This user&apos;s role is not editable because it is synchronized from your auth provider. Refer to
the&nbsp;
<a
href={
'https://grafana.com/docs/grafana/latest/administration/user-management/manage-org-users/#change-a-users-organization-permissions'
}
rel="noreferrer"
target="_blank"
>
Grafana authentication docs
</a>
&nbsp;for details.
</div>
}
>
<Icon name="question-circle" /> <Icon name="question-circle" />
</Tooltip> </Tooltip>
</Box> </Box>

Loading…
Cancel
Save