mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
feat(plugin-authentication-administration): CB-2192 display roleId
This commit is contained in:
+13
-7
@@ -11,11 +11,7 @@ import { useRef } from 'react';
|
||||
import styled, { css } from 'reshadow';
|
||||
|
||||
import { PermissionsResource } from '@cloudbeaver/core-administration';
|
||||
import {
|
||||
BASE_CONTAINERS_STYLES, ColoredContainer, FieldCheckbox, Group,
|
||||
GroupTitle,
|
||||
InputField, SubmittingForm, Textarea, useMapResource,
|
||||
} from '@cloudbeaver/core-blocks';
|
||||
import { BASE_CONTAINERS_STYLES, ColoredContainer, FieldCheckbox, Group, GroupTitle, InputField, SubmittingForm, Textarea, useMapResource } from '@cloudbeaver/core-blocks';
|
||||
import { useTranslate } from '@cloudbeaver/core-localization';
|
||||
import { CachedMapAllKey } from '@cloudbeaver/core-sdk';
|
||||
import { useStyles } from '@cloudbeaver/core-theming';
|
||||
@@ -28,6 +24,9 @@ const styles = css`
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
caption {
|
||||
composes: theme-text-text-hint-on-light theme-typography--caption from global;
|
||||
}
|
||||
`;
|
||||
|
||||
export const RoleOptions: TabContainerPanelComponent<IRoleFormProps> = observer(function RoleOptions({
|
||||
@@ -79,7 +78,14 @@ export const RoleOptions: TabContainerPanelComponent<IRoleFormProps> = observer(
|
||||
<Group small gap>
|
||||
<GroupTitle>{translate('administration_roles_role_permissions')}</GroupTitle>
|
||||
{permissionsResource.resource.values.map(permission => {
|
||||
const label = `${permission.label ?? permission.id}`;
|
||||
let label = permission.id;
|
||||
let caption: string | undefined;
|
||||
|
||||
if (permission.label) {
|
||||
label = `${permission.label}`;
|
||||
caption = permission.id;
|
||||
}
|
||||
|
||||
const tooltip = `${label}${permission.description ? '\n' + permission.description : ''}`;
|
||||
return (
|
||||
<FieldCheckbox
|
||||
@@ -92,7 +98,7 @@ export const RoleOptions: TabContainerPanelComponent<IRoleFormProps> = observer(
|
||||
readOnly={state.readonly}
|
||||
disabled={state.disabled}
|
||||
>
|
||||
{label}
|
||||
{label} {caption && <caption>({caption})</caption>}
|
||||
</FieldCheckbox>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user