All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.CreateInitialAccessToken-CGVDEXvq.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
{"version":3,"file":"CreateInitialAccessToken-CGVDEXvq.js","sources":["../../src/clients/initial-access/AccessTokenDialog.tsx","../../src/clients/initial-access/CreateInitialAccessToken.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport {\n  Alert,\n  AlertVariant,\n  ClipboardCopy,\n  Form,\n  FormGroup,\n  Modal,\n  ModalVariant,\n} from \"@patternfly/react-core\";\n\ntype AccessTokenDialogProps = {\n  token: string;\n  toggleDialog: () => void;\n};\n\nexport const AccessTokenDialog = ({\n  token,\n  toggleDialog,\n}: AccessTokenDialogProps) => {\n  const { t } = useTranslation();\n  return (\n    \n      \n      
\n \n \n {token}\n \n \n
\n \n );\n};\n","import type ClientInitialAccessPresentation from \"@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { useState } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { NumberControl } from \"@keycloak/keycloak-ui-shared\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { TimeSelectorControl } from \"../../components/time-selector/TimeSelectorControl\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toClients } from \"../routes/Clients\";\nimport { AccessTokenDialog } from \"./AccessTokenDialog\";\n\nexport default function CreateInitialAccessToken() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const form = useForm({ mode: \"onChange\" });\n const {\n handleSubmit,\n formState: { isValid },\n } = form;\n\n const { realm } = useRealm();\n const { addAlert, addError } = useAlerts();\n\n const navigate = useNavigate();\n const [token, setToken] = useState(\"\");\n\n const save = async (clientToken: ClientInitialAccessPresentation) => {\n try {\n const access = await adminClient.realms.createClientsInitialAccess(\n { realm },\n clientToken,\n );\n setToken(access.token!);\n } catch (error) {\n addError(\"tokenSaveError\", error);\n }\n };\n\n return (\n \n {token && (\n {\n setToken(\"\");\n addAlert(t(\"tokenSaveSuccess\"), AlertVariant.success);\n navigate(toClients({ realm, tab: \"initial-access-token\" }));\n }}\n />\n )}\n \n \n \n \n \n \n \n {t(\"save\")}\n \n (\n \n )}\n >\n {t(\"cancel\")}\n \n \n \n \n \n );\n}\n"],"names":["AccessTokenDialog","token","toggleDialog","useTranslation","jsxs","Modal","ModalVariant","jsx","Alert","AlertVariant","Form","FormGroup","ClipboardCopy","CreateInitialAccessToken","adminClient","useAdminClient","t","form","useForm","handleSubmit","isValid","realm","useRealm","addAlert","addError","useAlerts","navigate","useNavigate","setToken","useState","FormProvider","toClients","ViewHeader","PageSection","FormAccess","clientToken","access","error","TimeSelectorControl","NumberControl","ActionGroup","Button","props","Link"],"mappings":"weAgBO,MAAMA,EAAoB,CAAC,CAChC,MAAAC,EACA,aAAAC,CACF,IAA8B,CACtB,KAAA,CAAE,GAAMC,IAEZ,OAAAC,EAACC,EAAA,CACC,MAAO,EAAE,2BAA2B,EACpC,OAAQ,GACR,QAASH,EACT,QAASI,EAAa,OAEtB,SAAA,CAAAC,EAACC,EAAA,CACC,MAAO,EAAE,wBAAwB,EACjC,UAAU,KACV,SAAQ,GACR,QAASC,EAAa,OAAA,CACxB,EACAF,EAACG,GAAK,UAAU,gBACd,WAACC,EAAU,CAAA,MAAO,EAAE,oBAAoB,EAAG,QAAQ,qBACjD,SAAAJ,EAACK,GAAc,GAAG,qBAAqB,WAAU,GAC9C,SAAAX,EACH,EACF,CACF,CAAA,CAAA,CAAA,CAAA,CAGN,ECtBA,SAAwBY,GAA2B,CAC3C,KAAA,CAAE,YAAAC,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