Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
theme.keycloak.v2.admin.resources.assets.AddIdentityProvider-6057480b.js.map Maven / Gradle / Ivy
Go to download
The user inferface to administrate the Keycloak server.
{"version":3,"file":"AddIdentityProvider-6057480b.js","sources":["../../src/identity-providers/add/AddIdentityProvider.tsx"],"sourcesContent":["import type IdentityProviderRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { useMemo } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { adminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { DynamicComponents } from \"../../components/dynamic/DynamicComponents\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { useServerInfo } from \"../../context/server-info/ServerInfoProvider\";\nimport { toUpperCase } from \"../../util\";\nimport { useParams } from \"../../utils/useParams\";\nimport { toIdentityProvider } from \"../routes/IdentityProvider\";\nimport type { IdentityProviderCreateParams } from \"../routes/IdentityProviderCreate\";\nimport { toIdentityProviders } from \"../routes/IdentityProviders\";\nimport { GeneralSettings } from \"./GeneralSettings\";\n\nexport default function AddIdentityProvider() {\n const { t } = useTranslation(\"identity-providers\");\n const { providerId } = useParams();\n const form = useForm();\n const serverInfo = useServerInfo();\n\n const providerInfo = useMemo(() => {\n const namespaces = [\n \"org.keycloak.broker.social.SocialIdentityProvider\",\n \"org.keycloak.broker.provider.IdentityProvider\",\n ];\n\n for (const namespace of namespaces) {\n const social = serverInfo.componentTypes?.[namespace]?.find(\n ({ id }) => id === providerId\n );\n\n if (social) {\n return social;\n }\n }\n }, [serverInfo, providerId]);\n\n const {\n handleSubmit,\n formState: { isDirty },\n } = form;\n\n const { addAlert, addError } = useAlerts();\n const navigate = useNavigate();\n const { realm } = useRealm();\n\n const onSubmit = async (provider: IdentityProviderRepresentation) => {\n try {\n await adminClient.identityProviders.create({\n ...provider,\n providerId,\n alias: providerId,\n });\n addAlert(t(\"createSuccess\"), AlertVariant.success);\n navigate(\n toIdentityProvider({\n realm,\n providerId,\n alias: providerId,\n tab: \"settings\",\n })\n );\n } catch (error) {\n addError(\"identity-providers:createError\", error);\n }\n };\n\n return (\n <>\n \n \n \n \n \n {providerInfo && (\n \n )}\n \n \n \n {t(\"common:add\")}\n \n (\n \n )}\n >\n {t(\"common:cancel\")}\n \n \n \n \n >\n );\n}\n"],"names":["AddIdentityProvider","t","useTranslation","providerId","useParams","form","useForm","serverInfo","useServerInfo","providerInfo","useMemo","namespaces","namespace","social","id","handleSubmit","isDirty","addAlert","addError","useAlerts","navigate","useNavigate","realm","useRealm","onSubmit","provider","adminClient","AlertVariant","toIdentityProvider","error","jsxs","Fragment","jsx","ViewHeader","toUpperCase","PageSection","FormAccess","FormProvider","GeneralSettings","DynamicComponents","ActionGroup","Button","props","Link","toIdentityProviders"],"mappings":"21DAyBA,SAAwBA,IAAsB,CAC5C,KAAM,CAAE,EAAAC,CAAA,EAAMC,EAAe,oBAAoB,EAC3C,CAAE,WAAAC,GAAeC,IACjBC,EAAOC,IACPC,EAAaC,IAEbC,EAAeC,EAAAA,QAAQ,IAAM,CACjC,MAAMC,EAAa,CACjB,oDACA,+CAAA,EAGF,UAAWC,KAAaD,EAAY,CAClC,MAAME,EAASN,EAAW,iBAAiBK,CAAS,GAAG,KACrD,CAAC,CAAE,GAAAE,KAASA,IAAOX,CAAA,EAGrB,GAAIU,EACK,OAAAA,CAEX,CAAA,EACC,CAACN,EAAYJ,CAAU,CAAC,EAErB,CACJ,aAAAY,EACA,UAAW,CAAE,QAAAC,CAAQ,CACnB,EAAAX,EAEE,CAA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