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

theme.keycloak.v2.admin.resources.assets.NewAttributeSettings-BMpAgcYM.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
{"version":3,"file":"NewAttributeSettings-BMpAgcYM.js","sources":["../../src/realm-settings/user-profile/attribute/AttributeAnnotations.tsx","../../src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx","../../src/realm-settings/user-profile/attribute/AttributePermission.tsx","../../src/realm-settings/user-profile/attribute/ValidatorSelect.tsx","../../src/realm-settings/user-profile/attribute/AddValidatorDialog.tsx","../../src/realm-settings/user-profile/attribute/AttributeValidations.tsx","../../src/realm-settings/NewAttributeSettings.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport { FormGroup, Grid, GridItem } from \"@patternfly/react-core\";\n\nimport { FormAccess } from \"../../../components/form/FormAccess\";\nimport { KeyValueInput } from \"../../../components/key-value-form/KeyValueInput\";\n\nimport \"../../realm-settings-section.css\";\n\nexport const AttributeAnnotations = () => {\n  const { t } = useTranslation();\n\n  return (\n    \n      \n        \n          \n            \n          \n        \n      \n    \n  );\n};\n","import type ClientScopeRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation\";\nimport type { UserProfileConfig } from \"@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata\";\nimport {\n  FormErrorText,\n  HelpItem,\n  KeycloakSelect,\n  SelectControl,\n  SelectVariant,\n} from \"@keycloak/keycloak-ui-shared\";\nimport {\n  Alert,\n  Button,\n  Divider,\n  FormGroup,\n  Grid,\n  GridItem,\n  Radio,\n  SelectOption,\n  Switch,\n  TextInput,\n} from \"@patternfly/react-core\";\nimport { GlobeRouteIcon } from \"@patternfly/react-icons\";\nimport { isEqual } from \"lodash-es\";\nimport { useEffect, useState } from \"react\";\nimport {\n  Controller,\n  FormProvider,\n  useFormContext,\n  useWatch,\n} from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAdminClient } from \"../../../admin-client\";\nimport { FormAccess } from \"../../../components/form/FormAccess\";\nimport { KeycloakSpinner } from \"../../../components/keycloak-spinner/KeycloakSpinner\";\nimport { useRealm } from \"../../../context/realm-context/RealmContext\";\nimport { useFetch } from \"../../../utils/useFetch\";\nimport { useParams } from \"../../../utils/useParams\";\nimport useToggle from \"../../../utils/useToggle\";\nimport { USERNAME_EMAIL } from \"../../NewAttributeSettings\";\nimport { AttributeParams } from \"../../routes/Attribute\";\nimport {\n  AddTranslationsDialog,\n  TranslationsType,\n} from \"./AddTranslationsDialog\";\n\nimport \"../../realm-settings-section.css\";\n\nconst REQUIRED_FOR = [\n  { label: \"requiredForLabel.both\", value: [\"admin\", \"user\"] },\n  { label: \"requiredForLabel.users\", value: [\"user\"] },\n  { label: \"requiredForLabel.admins\", value: [\"admin\"] },\n] as const;\n\ntype TranslationForm = {\n  locale: string;\n  value: string;\n};\n\ntype Translations = {\n  key: string;\n  translations: TranslationForm[];\n};\n\nexport type AttributeGeneralSettingsProps = {\n  onHandlingTranslationData: (data: Translations) => void;\n  onHandlingGeneratedDisplayName: (displayName: string) => void;\n};\n\nexport const AttributeGeneralSettings = ({\n  onHandlingTranslationData,\n  onHandlingGeneratedDisplayName,\n}: AttributeGeneralSettingsProps) => {\n  const { adminClient } = useAdminClient();\n  const { t } = useTranslation();\n  const { realmRepresentation: realm } = useRealm();\n  const form = useFormContext();\n  const [clientScopes, setClientScopes] =\n    useState();\n  const [config, setConfig] = useState();\n  const [selectEnabledWhenOpen, setSelectEnabledWhenOpen] = useState(false);\n  const [selectRequiredForOpen, setSelectRequiredForOpen] = useState(false);\n  const [addTranslationsModalOpen, toggleModal] = useToggle();\n  const { attributeName } = useParams();\n  const editMode = attributeName ? true : false;\n  const [newAttributeName, setNewAttributeName] = useState(\"\");\n  const [generatedDisplayName, setGeneratedDisplayName] = useState(\"\");\n  const [type, setType] = useState();\n  const [translationsData, setTranslationsData] = useState({\n    key: \"\",\n    translations: [],\n  });\n  const displayNameRegex = /\\$\\{([^}]+)\\}/;\n\n  const handleAttributeNameChange = (\n    _event: React.FormEvent,\n    value: string,\n  ) => {\n    setNewAttributeName(value);\n    const newDisplayName =\n      value !== \"\" && realm?.internationalizationEnabled\n        ? \"${profile.attributes.\" + `${value}}`\n        : \"\";\n    setGeneratedDisplayName(newDisplayName);\n  };\n\n  const hasSelector = useWatch({\n    control: form.control,\n    name: \"hasSelector\",\n  });\n\n  const hasRequiredScopes = useWatch({\n    control: form.control,\n    name: \"hasRequiredScopes\",\n  });\n\n  const required = useWatch({\n    control: form.control,\n    name: \"isRequired\",\n    defaultValue: false,\n  });\n\n  const attributeDisplayName = useWatch({\n    control: form.control,\n    name: \"displayName\",\n  });\n\n  const displayNamePatternMatch = displayNameRegex.test(attributeDisplayName);\n\n  useFetch(() => adminClient.clientScopes.find(), setClientScopes, []);\n  useFetch(() => adminClient.users.getProfile(), setConfig, []);\n\n  const handleTranslationsData = (translationsData: Translations) => {\n    onHandlingTranslationData(translationsData);\n  };\n\n  const handleGeneratedDisplayName = (displayName: string) => {\n    onHandlingGeneratedDisplayName(displayName);\n  };\n\n  useEffect(() => {\n    handleTranslationsData(translationsData);\n    handleGeneratedDisplayName(generatedDisplayName);\n  }, [translationsData, generatedDisplayName]);\n\n  if (!clientScopes) {\n    return ;\n  }\n\n  function setHasSelector(hasSelector: boolean) {\n    form.setValue(\"hasSelector\", hasSelector);\n  }\n\n  function setHasRequiredScopes(hasRequiredScopes: boolean) {\n    form.setValue(\"hasRequiredScopes\", hasRequiredScopes);\n  }\n\n  const handleTranslationsAdded = (translationsData: Translations) => {\n    setTranslationsData(translationsData);\n  };\n\n  const handleToggleDialog = () => {\n    toggleModal();\n    handleTranslationsData(translationsData);\n    handleGeneratedDisplayName(generatedDisplayName);\n  };\n\n  const formattedAttributeDisplayName = attributeDisplayName?.substring(\n    2,\n    attributeDisplayName.length - 1,\n  );\n\n  return (\n    <>\n      {addTranslationsModalOpen && (\n         {\n            toggleModal();\n          }}\n        />\n      )}\n      \n        \n          \n            }\n            fieldId=\"kc-attribute-name\"\n            isRequired\n          >\n            \n            {form.formState.errors.name && (\n              \n            )}\n          \n          \n            }\n            fieldId=\"kc-attribute-display-name\"\n          >\n            \n              \n                \n                {generatedDisplayName && (\n                  \n                )}\n              \n              {realm?.internationalizationEnabled && (\n                \n                   {\n                      setType(\"displayName\");\n                      toggleModal();\n                    }}\n                    icon={}\n                  />\n                \n              )}\n            \n          \n           ({\n                key: g.name!,\n                value: g.name!,\n              })) || []),\n            ]}\n          />\n          {!USERNAME_EMAIL.includes(attributeName) && (\n            <>\n              \n              \n                }\n                fieldId=\"enabledWhen\"\n                hasNoPaddingTop\n              >\n                 setHasSelector(false)}\n                  className=\"pf-v5-u-mb-md\"\n                />\n                 setHasSelector(true)}\n                  className=\"pf-v5-u-mb-md\"\n                />\n              \n              {hasSelector && (\n                \n                   (\n                       setSelectEnabledWhenOpen(isOpen)}\n                        selections={field.value}\n                        onSelect={(selectedValue) => {\n                          const option = selectedValue.toString();\n                          let changedValue = [\"\"];\n                          if (field.value) {\n                            changedValue = field.value.includes(option)\n                              ? field.value.filter(\n                                  (item: string) => item !== option,\n                                )\n                              : [...field.value, option];\n                          } else {\n                            changedValue = [option];\n                          }\n\n                          field.onChange(changedValue);\n                        }}\n                        onClear={() => {\n                          field.onChange([]);\n                        }}\n                        isOpen={selectEnabledWhenOpen}\n                        aria-labelledby={\"scope\"}\n                      >\n                        {clientScopes.map((option) => (\n                          \n                            {option.name}\n                          \n                        ))}\n                      \n                    )}\n                  />\n                \n              )}\n            \n          )}\n          {attributeName !== \"username\" && (\n            <>\n              \n              \n                }\n                fieldId=\"kc-required\"\n                hasNoPaddingTop\n              >\n                 (\n                    \n                  )}\n                />\n              \n              {required && (\n                <>\n                  \n                     (\n                        
\n {REQUIRED_FOR.map((option) => (\n {\n field.onChange(option.value);\n }}\n label={t(option.label)}\n className=\"kc-requiredFor-option\"\n />\n ))}\n
\n )}\n />\n \n \n }\n fieldId=\"requiredWhen\"\n hasNoPaddingTop\n >\n setHasRequiredScopes(false)}\n className=\"pf-v5-u-mb-md\"\n />\n setHasRequiredScopes(true)}\n className=\"pf-v5-u-mb-md\"\n />\n \n {hasRequiredScopes && (\n \n (\n \n setSelectRequiredForOpen(isOpen)\n }\n selections={field.value}\n onSelect={(selectedValue) => {\n const option = selectedValue.toString();\n let changedValue = [\"\"];\n if (field.value) {\n changedValue = field.value.includes(option)\n ? field.value.filter(\n (item: string) => item !== option,\n )\n : [...field.value, option];\n } else {\n changedValue = [option];\n }\n field.onChange(changedValue);\n }}\n onClear={() => {\n field.onChange([]);\n }}\n isOpen={selectRequiredForOpen}\n aria-labelledby={\"scope\"}\n >\n {clientScopes.map((option) => (\n \n {option.name}\n \n ))}\n \n )}\n />\n \n )}\n \n )}\n \n )}\n
\n
\n \n );\n};\n","import { Checkbox, FormGroup, Grid, GridItem } from \"@patternfly/react-core\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { FormAccess } from \"../../../components/form/FormAccess\";\nimport { HelpItem } from \"@keycloak/keycloak-ui-shared\";\n\nimport \"../../realm-settings-section.css\";\n\nconst Permissions = ({ name }: { name: string }) => {\n const { t } = useTranslation();\n const { control } = useFormContext();\n\n return (\n \n (\n <>\n \n {\n const option = \"user\";\n const changedValue = field.value.includes(option)\n ? field.value.filter((item: string) => item !== option)\n : [...field.value, option];\n\n field.onChange(changedValue);\n }}\n />\n \n \n {\n const option = \"admin\";\n const changedValue = field.value.includes(option)\n ? field.value.filter((item: string) => item !== option)\n : [...field.value, option];\n\n field.onChange(changedValue);\n }}\n />\n \n \n )}\n />\n \n );\n};\n\nexport const AttributePermission = () => {\n const { t } = useTranslation();\n\n return (\n \n \n }\n fieldId=\"kc-who-can-edit\"\n >\n \n \n \n }\n fieldId=\"kc-who-can-view\"\n >\n \n \n \n );\n};\n","import ComponentTypeRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation\";\nimport { KeycloakSelect } from \"@keycloak/keycloak-ui-shared\";\nimport { FormGroup, SelectOption } from \"@patternfly/react-core\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useServerInfo } from \"../../../context/server-info/ServerInfoProvider\";\nimport useToggle from \"../../../utils/useToggle\";\n\ntype ValidatorSelectProps = {\n selectedValidators: string[];\n onChange: (validator: ComponentTypeRepresentation) => void;\n};\n\nexport const ValidatorSelect = ({\n selectedValidators,\n onChange,\n}: ValidatorSelectProps) => {\n const { t } = useTranslation();\n const allValidator: ComponentTypeRepresentation[] =\n useServerInfo().componentTypes?.[\"org.keycloak.validate.Validator\"] || [];\n const validators = useMemo(\n () => allValidator.filter(({ id }) => !selectedValidators.includes(id)),\n [selectedValidators],\n );\n const [open, toggle] = useToggle();\n const [value, setValue] = useState();\n\n return (\n \n {\n const option = value as ComponentTypeRepresentation;\n onChange(option);\n setValue(option);\n toggle();\n }}\n selections={value?.id}\n variant=\"single\"\n aria-label={t(\"selectOne\")}\n isOpen={open}\n placeholderText={t(\"choose\")}\n menuAppendTo=\"parent\"\n maxHeight={300}\n >\n {validators.map((option) => (\n \n {option.id}\n \n ))}\n \n \n );\n};\n","import ComponentRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/componentRepresentation\";\nimport ComponentTypeRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation\";\nimport { Button, Form, Modal, ModalVariant } from \"@patternfly/react-core\";\nimport { useState } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DynamicComponents } from \"../../../components/dynamic/DynamicComponents\";\nimport { useServerInfo } from \"../../../context/server-info/ServerInfoProvider\";\nimport type { IndexedValidations } from \"../../NewAttributeSettings\";\nimport { ValidatorSelect } from \"./ValidatorSelect\";\n\nexport type AddValidatorDialogProps = {\n selectedValidators: IndexedValidations[];\n toggleDialog: () => void;\n onConfirm: (newValidator: ComponentRepresentation) => void;\n};\n\nexport const AddValidatorDialog = ({\n selectedValidators,\n toggleDialog,\n onConfirm,\n}: AddValidatorDialogProps) => {\n const { t } = useTranslation();\n const [selectedValidator, setSelectedValidator] =\n useState();\n\n const allSelected =\n useServerInfo().componentTypes?.[\"org.keycloak.validate.Validator\"]\n .length === selectedValidators.length;\n const form = useForm();\n const { handleSubmit } = form;\n\n const save = (newValidator: ComponentTypeRepresentation) => {\n onConfirm({ ...newValidator, id: selectedValidator?.id });\n toggleDialog();\n };\n\n return (\n \n {t(\"save\")}\n ,\n \n {t(\"cancel\")}\n ,\n ]}\n >\n {allSelected ? (\n t(\"emptyValidators\")\n ) : (\n
\n validator.key,\n )}\n onChange={setSelectedValidator}\n />\n {selectedValidator && (\n \n \n \n )}\n \n )}\n \n );\n};\n","import {\n Button,\n ButtonVariant,\n Divider,\n Text,\n TextVariants,\n} from \"@patternfly/react-core\";\nimport { PlusCircleIcon } from \"@patternfly/react-icons\";\nimport { Table, Tbody, Td, Th, Thead, Tr } from \"@patternfly/react-table\";\nimport { useEffect, useState } from \"react\";\nimport { useFormContext, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useConfirmDialog } from \"../../../components/confirm-dialog/ConfirmDialog\";\nimport { DefaultValue } from \"../../../components/key-value-form/KeyValueInput\";\nimport useToggle from \"../../../utils/useToggle\";\nimport type { IndexedValidations } from \"../../NewAttributeSettings\";\nimport { AddValidatorDialog } from \"../attribute/AddValidatorDialog\";\n\nimport \"../../realm-settings-section.css\";\n\nexport const AttributeValidations = () => {\n const { t } = useTranslation();\n const [addValidatorModalOpen, toggleModal] = useToggle();\n const [validatorToDelete, setValidatorToDelete] = useState();\n const { setValue, control, register, getValues } = useFormContext();\n\n const validators: IndexedValidations[] = useWatch({\n name: \"validations\",\n control,\n defaultValue: [],\n });\n\n useEffect(() => {\n register(\"validations\");\n }, [register]);\n\n const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({\n titleKey: t(\"deleteValidatorConfirmTitle\"),\n messageKey: t(\"deleteValidatorConfirmMsg\", {\n validatorName: validatorToDelete,\n }),\n continueButtonLabel: \"delete\",\n continueButtonVariant: ButtonVariant.danger,\n onConfirm: async () => {\n const updatedValidators = validators.filter(\n (validator) => validator.key !== validatorToDelete,\n );\n\n setValue(\"validations\", [...updatedValidators]);\n },\n });\n\n return (\n <>\n {addValidatorModalOpen && (\n {\n const annotations: DefaultValue[] = getValues(\"annotations\");\n if (\n newValidator.id === \"options\" &&\n !annotations.find((a) => a.key === \"inputType\")\n ) {\n setValue(\"annotations\", [\n ...annotations,\n { key: \"inputType\", value: \"select\" },\n ]);\n }\n setValue(\"validations\", [\n ...validators,\n { key: newValidator.id, value: newValidator.config },\n ]);\n }}\n toggleDialog={toggleModal}\n />\n )}\n \n
\n toggleModal()}\n variant=\"link\"\n data-testid=\"addValidator\"\n className=\"kc--attributes-validations--add-validation-button\"\n icon={}\n >\n {t(\"addValidator\")}\n \n \n {validators.length !== 0 ? (\n \n \n \n \n \n \n \n \n {validators.map((validator) => (\n \n \n \n \n \n ))}\n \n
{t(\"validatorColNames.colName\")}{t(\"validatorColNames.colConfig\")}\n
\n {validator.key}\n \n {JSON.stringify(validator.value)}\n \n {\n toggleDeleteDialog();\n setValidatorToDelete(validator.key);\n }}\n >\n {t(\"delete\")}\n \n
\n ) : (\n \n {t(\"emptyValidators\")}\n \n )}\n
\n \n );\n};\n","import type {\n UserProfileAttribute,\n UserProfileConfig,\n} from \"@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata\";\nimport { ScrollForm } from \"@keycloak/keycloak-ui-shared\";\nimport {\n AlertVariant,\n Button,\n Form,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { flatten } from \"flat\";\nimport { useState } from \"react\";\nimport { FormProvider, useForm, useFormContext } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../admin-client\";\nimport { useAlerts } from \"../components/alert/Alerts\";\nimport { FixedButtonsGroup } from \"../components/form/FixedButtonGroup\";\nimport { ViewHeader } from \"../components/view-header/ViewHeader\";\nimport { useRealm } from \"../context/realm-context/RealmContext\";\nimport { convertToFormValues } from \"../util\";\nimport { useFetch } from \"../utils/useFetch\";\nimport useLocale from \"../utils/useLocale\";\nimport { useParams } from \"../utils/useParams\";\nimport \"./realm-settings-section.css\";\nimport type { AttributeParams } from \"./routes/Attribute\";\nimport { toUserProfile } from \"./routes/UserProfile\";\nimport { UserProfileProvider } from \"./user-profile/UserProfileContext\";\nimport { AttributeAnnotations } from \"./user-profile/attribute/AttributeAnnotations\";\nimport { AttributeGeneralSettings } from \"./user-profile/attribute/AttributeGeneralSettings\";\nimport { AttributePermission } from \"./user-profile/attribute/AttributePermission\";\nimport { AttributeValidations } from \"./user-profile/attribute/AttributeValidations\";\n\ntype TranslationForm = {\n locale: string;\n value: string;\n};\n\ntype Translations = {\n key: string;\n translations: TranslationForm[];\n};\n\ntype IndexedAnnotations = {\n key: string;\n value?: Record;\n};\n\nexport type IndexedValidations = {\n key: string;\n value?: Record;\n};\n\ntype UserProfileAttributeFormFields = Omit<\n UserProfileAttribute,\n \"validations\" | \"annotations\"\n> &\n Attribute &\n Permission & {\n validations: IndexedValidations[];\n annotations: IndexedAnnotations[];\n hasSelector: boolean;\n hasRequiredScopes: boolean;\n };\n\ntype Attribute = {\n roles: string[];\n scopes: string[];\n isRequired: boolean;\n};\n\ntype Permission = {\n view: PermissionView[];\n edit: PermissionEdit[];\n};\n\ntype PermissionView = [\n {\n adminView: boolean;\n userView: boolean;\n },\n];\n\ntype PermissionEdit = [\n {\n adminEdit: boolean;\n userEdit: boolean;\n },\n];\n\nexport const USERNAME_EMAIL = [\"username\", \"email\"];\n\nconst CreateAttributeFormContent = ({\n onHandlingTranslationsData,\n onHandlingGeneratedDisplayName,\n save,\n}: {\n save: (profileConfig: UserProfileConfig) => void;\n onHandlingTranslationsData: (translationsData: Translations) => void;\n onHandlingGeneratedDisplayName: (generatedDisplayName: string) => void;\n}) => {\n const { t } = useTranslation();\n const form = useFormContext();\n const { realm, attributeName } = useParams();\n const editMode = attributeName ? true : false;\n\n const handleTranslationsData = (translationsData: Translations) => {\n onHandlingTranslationsData(translationsData);\n };\n\n const handleGeneratedDisplayName = (generatedDisplayName: string) => {\n onHandlingGeneratedDisplayName(generatedDisplayName);\n };\n\n return (\n \n \n ),\n },\n { title: t(\"permission\"), panel: },\n { title: t(\"validations\"), panel: },\n { title: t(\"annotations\"), panel: },\n ]}\n />\n
\n \n \n {editMode ? t(\"save\") : t(\"create\")}\n \n \n {t(\"cancel\")}\n \n \n
\n
\n );\n};\n\nexport default function NewAttributeSettings() {\n const { adminClient } = useAdminClient();\n const { realm: realmName, attributeName } = useParams();\n const { realmRepresentation: realm } = useRealm();\n const form = useForm();\n const { t } = useTranslation();\n const combinedLocales = useLocale();\n const navigate = useNavigate();\n const { addAlert, addError } = useAlerts();\n const [config, setConfig] = useState(null);\n const editMode = attributeName ? true : false;\n const [translationsData, setTranslationsData] = useState({\n key: \"\",\n translations: [],\n });\n const [generatedDisplayName, setGeneratedDisplayName] = useState(\"\");\n\n useFetch(\n async () => {\n const translationsToSave: any[] = [];\n await Promise.all(\n combinedLocales.map(async (selectedLocale) => {\n try {\n const translations =\n await adminClient.realms.getRealmLocalizationTexts({\n realm: realmName,\n selectedLocale,\n });\n\n const formData = form.getValues();\n const formattedKey = formData.displayName?.substring(\n 2,\n formData.displayName.length - 1,\n );\n const filteredTranslations: Array<{\n locale: string;\n value: string;\n }> = [];\n const allTranslations = Object.entries(translations).map(\n ([key, value]) => ({\n key,\n value,\n }),\n );\n\n allTranslations.forEach((translation) => {\n if (translation.key === formattedKey) {\n filteredTranslations.push({\n locale: selectedLocale,\n value: translation.value,\n });\n }\n });\n\n const translationToSave: any = {\n key: formattedKey,\n translations: filteredTranslations,\n };\n\n translationsToSave.push(translationToSave);\n } catch (error) {\n console.error(\n `Error fetching translations for ${selectedLocale}:`,\n error,\n );\n }\n }),\n );\n return translationsToSave;\n },\n (translationsToSaveData) => {\n setTranslationsData(() => ({\n key: translationsToSaveData[0].key,\n translations: translationsToSaveData.flatMap(\n (translationData) => translationData.translations,\n ),\n }));\n },\n [combinedLocales],\n );\n\n useFetch(\n () => adminClient.users.getProfile(),\n (config) => {\n setConfig(config);\n const {\n annotations,\n validations,\n permissions,\n selector,\n required,\n multivalued,\n ...values\n } = config.attributes!.find(\n (attribute) => attribute.name === attributeName,\n ) || { permissions: { edit: [\"admin\"] } };\n convertToFormValues(\n {\n ...values,\n hasSelector: typeof selector !== \"undefined\",\n hasRequiredScopes: typeof required?.scopes !== \"undefined\",\n },\n form.setValue,\n );\n Object.entries(\n flatten({ permissions, selector, required }, { safe: true }),\n ).map(([key, value]) => form.setValue(key as any, value));\n form.setValue(\n \"annotations\",\n Object.entries(annotations || {}).map(([key, value]) => ({\n key,\n value: value as Record,\n })),\n );\n form.setValue(\n \"validations\",\n Object.entries(validations || {}).map(([key, value]) => ({\n key,\n value: value as Record,\n })),\n );\n form.setValue(\"isRequired\", required !== undefined);\n form.setValue(\"multivalued\", multivalued === true);\n },\n [],\n );\n\n const saveTranslations = async () => {\n try {\n const nonEmptyTranslations = translationsData.translations.map(\n async (translation) => {\n try {\n await adminClient.realms.addLocalization(\n {\n realm: realmName,\n selectedLocale: translation.locale,\n key: translationsData.key,\n },\n translation.value,\n );\n } catch (error) {\n console.error(`Error saving translation for ${translation.locale}`);\n }\n },\n );\n await Promise.all(nonEmptyTranslations);\n } catch (error) {\n console.error(`Error saving translations: ${error}`);\n }\n };\n\n const save = async ({\n hasSelector,\n hasRequiredScopes,\n ...formFields\n }: UserProfileAttributeFormFields) => {\n if (!hasSelector) {\n delete formFields.selector;\n }\n\n if (!hasRequiredScopes) {\n delete formFields.required?.scopes;\n }\n\n const validations = formFields.validations.reduce(\n (prevValidations, currentValidations) => {\n prevValidations[currentValidations.key] =\n currentValidations.value || {};\n return prevValidations;\n },\n {} as Record,\n );\n\n const annotations = formFields.annotations.reduce(\n (obj, item) => Object.assign(obj, { [item.key]: item.value }),\n {},\n );\n\n const patchAttributes = () =>\n (config?.attributes || []).map((attribute) => {\n if (attribute.name !== attributeName) {\n return attribute;\n }\n\n delete attribute.required;\n return Object.assign(\n {\n ...attribute,\n name: attributeName,\n displayName: formFields.displayName!,\n selector: formFields.selector,\n permissions: formFields.permissions!,\n multivalued: formFields.multivalued,\n annotations,\n validations,\n },\n formFields.isRequired ? { required: formFields.required } : undefined,\n formFields.group ? { group: formFields.group } : { group: null },\n );\n });\n\n const addAttribute = () =>\n (config?.attributes || []).concat([\n Object.assign(\n {\n name: formFields.name,\n displayName: formFields.displayName! || generatedDisplayName,\n required: formFields.isRequired ? formFields.required : undefined,\n selector: formFields.selector,\n permissions: formFields.permissions!,\n multivalued: formFields.multivalued,\n annotations,\n validations,\n },\n formFields.isRequired ? { required: formFields.required } : undefined,\n formFields.group ? { group: formFields.group } : undefined,\n ),\n ] as UserProfileAttribute);\n\n if (realm?.internationalizationEnabled) {\n const hasNonEmptyTranslations = translationsData.translations.some(\n (translation) => translation.value.trim() !== \"\",\n );\n\n if (!hasNonEmptyTranslations) {\n addError(\"createAttributeError\", t(\"translationError\"));\n return;\n }\n }\n\n try {\n const updatedAttributes = editMode ? patchAttributes() : addAttribute();\n\n await adminClient.users.updateProfile({\n ...config,\n attributes: updatedAttributes as UserProfileAttribute[],\n realm: realmName,\n });\n\n await saveTranslations();\n navigate(toUserProfile({ realm: realmName, tab: \"attributes\" }));\n\n addAlert(t(\"createAttributeSuccess\"), AlertVariant.success);\n } catch (error) {\n addError(\"createAttributeError\", error);\n }\n };\n\n return (\n \n \n \n form.handleSubmit(save)()}\n onHandlingTranslationsData={setTranslationsData}\n onHandlingGeneratedDisplayName={setGeneratedDisplayName}\n />\n \n \n );\n}\n"],"names":["AttributeAnnotations","useTranslation","jsx","FormAccess","FormGroup","Grid","GridItem","KeyValueInput","REQUIRED_FOR","AttributeGeneralSettings","onHandlingTranslationData","onHandlingGeneratedDisplayName","adminClient","useAdminClient","t","realm","useRealm","form","useFormContext","clientScopes","setClientScopes","useState","config","setConfig","selectEnabledWhenOpen","setSelectEnabledWhenOpen","selectRequiredForOpen","setSelectRequiredForOpen","addTranslationsModalOpen","toggleModal","useToggle","attributeName","useParams","editMode","newAttributeName","setNewAttributeName","generatedDisplayName","setGeneratedDisplayName","type","setType","translationsData","setTranslationsData","displayNameRegex","handleAttributeNameChange","_event","value","newDisplayName","hasSelector","useWatch","hasRequiredScopes","required","attributeDisplayName","displayNamePatternMatch","useFetch","handleTranslationsData","handleGeneratedDisplayName","displayName","useEffect","KeycloakSpinner","setHasSelector","setHasRequiredScopes","handleTranslationsAdded","handleToggleDialog","formattedAttributeDisplayName","jsxs","Fragment","AddTranslationsDialog","FormProvider","HelpItem","TextInput","FormErrorText","Alert","Button","GlobeRouteIcon","SelectControl","g","USERNAME_EMAIL","Divider","Radio","Controller","field","KeycloakSelect","SelectVariant","isOpen","selectedValue","option","changedValue","item","SelectOption","Switch","isEqual","Permissions","name","control","Checkbox","AttributePermission","ValidatorSelect","selectedValidators","onChange","allValidator","useServerInfo","validators","useMemo","id","open","toggle","setValue","AddValidatorDialog","toggleDialog","onConfirm","selectedValidator","setSelectedValidator","allSelected","useForm","handleSubmit","save","newValidator","Modal","ModalVariant","Form","validator","DynamicComponents","AttributeValidations","addValidatorModalOpen","validatorToDelete","setValidatorToDelete","register","getValues","toggleDeleteDialog","DeleteConfirm","useConfirmDialog","ButtonVariant","updatedValidators","annotations","a","PlusCircleIcon","Table","Thead","Tr","Th","Tbody","Td","Text","TextVariants","CreateAttributeFormContent","onHandlingTranslationsData","UserProfileProvider","ScrollForm","FixedButtonsGroup","Link","toUserProfile","NewAttributeSettings","realmName","combinedLocales","useLocale","navigate","useNavigate","addAlert","addError","useAlerts","translationsToSave","selectedLocale","translations","formData","formattedKey","filteredTranslations","key","translation","translationToSave","error","translationsToSaveData","translationData","validations","permissions","selector","multivalued","values","attribute","convertToFormValues","flatten","saveTranslations","nonEmptyTranslations","formFields","prevValidations","currentValidations","obj","patchAttributes","addAttribute","updatedAttributes","AlertVariant","ViewHeader","PageSection"],"mappings":"kyDAQO,MAAMA,GAAuB,IAAM,CAClC,KAAA,CAAE,GAAMC,IAEd,OACGC,EAAAC,GAAA,CAAW,KAAK,eAAe,aAAY,GAC1C,SAAAD,EAACE,EAAA,CACC,gBAAe,GACf,MAAO,EAAE,aAAa,EACtB,QAAQ,iBACR,UAAU,uBAEV,SAACF,EAAAG,GAAA,CAAK,UAAU,iBACd,WAACC,EACC,CAAA,SAAAJ,EAACK,GAAA,CACC,KAAK,cACL,MAAO,EAAE,aAAa,EACtB,gBAAiB,CACf,CACE,IAAK,YACL,MAAO,EAAE,WAAW,EACpB,OAAQ,CACN,OACA,WACA,SACA,sBACA,cACA,yBACA,cACA,YACA,YACA,eACA,cACA,uBACA,aACA,cACA,aACA,YACF,CACF,EACA,CACE,IAAK,wBACL,MAAO,EAAE,uBAAuB,CAClC,EACA,CACE,IAAK,uBACL,MAAO,EAAE,sBAAsB,CACjC,EACA,CACE,IAAK,8BACL,MAAO,EAAE,6BAA6B,CACxC,EACA,CACE,IAAK,uBACL,MAAO,EAAE,sBAAsB,CACjC,EACA,CACE,IAAK,gBACL,MAAO,EAAE,eAAe,CAC1B,EACA,CACE,IAAK,gBACL,MAAO,EAAE,eAAe,CAC1B,EACA,CACE,IAAK,gBACL,MAAO,EAAE,eAAe,CAC1B,EACA,CACE,IAAK,gBACL,MAAO,EAAE,eAAe,CAC1B,EACA,CACE,IAAK,iBACL,MAAO,EAAE,gBAAgB,CAC3B,EACA,CACE,IAAK,mBACL,MAAO,EAAE,kBAAkB,CAC7B,CACF,CAAA,GAEJ,CACF,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEJ,EC/CMC,GAAe,CACnB,CAAE,MAAO,wBAAyB,MAAO,CAAC,QAAS,MAAM,CAAE,EAC3D,CAAE,MAAO,yBAA0B,MAAO,CAAC,MAAM,CAAE,EACnD,CAAE,MA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