Add 'copy to clipboard' button for user id (#33491)
Closes #33496 Signed-off-by: Tim Koch <me@timkoch.dev>
This commit is contained in:
parent
1ef845b31d
commit
ff44d8dd98
5 changed files with 22 additions and 9 deletions
|
@ -17,7 +17,7 @@ import { useAlerts } from "@keycloak/keycloak-ui-shared";
|
|||
import { useConfirmDialog } from "../../components/confirm-dialog/ConfirmDialog";
|
||||
import { useAccess } from "../../context/access/Access";
|
||||
import useFormatDate from "../../utils/useFormatDate";
|
||||
import { CopyToClipboardButton } from "../scopes/CopyToClipboardButton";
|
||||
import { CopyToClipboardButton } from "../../components/copy-to-clipboard-button/CopyToClipboardButton";
|
||||
|
||||
export type ClientSecretProps = {
|
||||
client: ClientRepresentation;
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
TextArea,
|
||||
} from "@patternfly/react-core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { CopyToClipboardButton } from "./CopyToClipboardButton";
|
||||
import { CopyToClipboardButton } from "../../components/copy-to-clipboard-button/CopyToClipboardButton";
|
||||
|
||||
type GeneratedCodeTabProps = {
|
||||
user?: UserRepresentation;
|
||||
|
|
|
@ -56,7 +56,7 @@ export * as DetailProvider from "./clients/registration/DetailProvider";
|
|||
export * as CreateClientRole from "./clients/roles/CreateClientRole";
|
||||
export { AddScopeDialog } from "./clients/scopes/AddScopeDialog";
|
||||
export { ClientScopes } from "./clients/scopes/ClientScopes";
|
||||
export { CopyToClipboardButton } from "./clients/scopes/CopyToClipboardButton";
|
||||
export { CopyToClipboardButton } from "./components/copy-to-clipboard-button/CopyToClipboardButton";
|
||||
export { DedicatedScope } from "./clients/scopes/DedicatedScope";
|
||||
export * as DedicatedScopes from "./clients/scopes/DedicatedScopes";
|
||||
export { EvaluateScopes } from "./clients/scopes/EvaluateScopes";
|
||||
|
|
|
@ -39,6 +39,7 @@ import { toUsers } from "./routes/Users";
|
|||
import { FixedButtonsGroup } from "../components/form/FixedButtonGroup";
|
||||
import { RequiredActionMultiSelect } from "./user-credentials/RequiredActionMultiSelect";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { CopyToClipboardButton } from "../components/copy-to-clipboard-button/CopyToClipboardButton";
|
||||
|
||||
export type BruteForced = {
|
||||
isBruteForceProtected?: boolean;
|
||||
|
@ -183,12 +184,24 @@ export const UserForm = ({
|
|||
{user?.id && (
|
||||
<>
|
||||
<FormGroup label={t("id")} fieldId="kc-id" isRequired>
|
||||
<TextInput
|
||||
id={user.id}
|
||||
aria-label={t("userID")}
|
||||
value={user.id}
|
||||
readOnly
|
||||
/>
|
||||
<InputGroup>
|
||||
<InputGroupItem isFill>
|
||||
<TextInput
|
||||
id={user.id}
|
||||
aria-label={t("userID")}
|
||||
value={user.id}
|
||||
readOnly
|
||||
/>
|
||||
</InputGroupItem>
|
||||
<InputGroupItem>
|
||||
<CopyToClipboardButton
|
||||
id={`user-${user.id}`}
|
||||
text={user.id}
|
||||
label={t("userID")}
|
||||
variant="control"
|
||||
/>
|
||||
</InputGroupItem>
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
<FormGroup
|
||||
label={t("createdAt")}
|
||||
|
|
Loading…
Reference in a new issue