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

theme.keycloak.v2.admin.resources.assets.SettingsCache-BECJJhg-.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
{"version":3,"file":"SettingsCache-BECJJhg-.js","sources":["../../src/user-federation/shared/Header.tsx","../../src/components/wizard-section-header/WizardSectionHeader.tsx","../../src/user-federation/shared/SettingsCache.tsx"],"sourcesContent":["import {\n  AlertVariant,\n  ButtonVariant,\n  DropdownItem,\n} from \"@patternfly/react-core\";\nimport { ReactElement } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { useConfirmDialog } from \"../../components/confirm-dialog/ConfirmDialog\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { CustomUserFederationRouteParams } from \"../routes/CustomUserFederation\";\nimport { toUserFederation } from \"../routes/UserFederation\";\n\ntype HeaderProps = {\n  provider: string;\n  save: () => void;\n  dropdownItems?: ReactElement[];\n  noDivider?: boolean;\n};\n\nexport const Header = ({\n  provider,\n  save,\n  noDivider = false,\n  dropdownItems = [],\n}: HeaderProps) => {\n  const { adminClient } = useAdminClient();\n\n  const { t } = useTranslation();\n  const { id } = useParams>();\n  const navigate = useNavigate();\n\n  const { addAlert, addError } = useAlerts();\n  const { realm } = useRealm();\n\n  const { control, setValue } = useFormContext();\n\n  const [toggleDisableDialog, DisableConfirm] = useConfirmDialog({\n    titleKey: \"userFedDisableConfirmTitle\",\n    messageKey: \"userFedDisableConfirm\",\n    continueButtonLabel: \"disable\",\n    onConfirm: () => {\n      setValue(\"config.enabled[0]\", \"false\");\n      save();\n    },\n  });\n\n  const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({\n    titleKey: \"userFedDeleteConfirmTitle\",\n    messageKey: \"userFedDeleteConfirm\",\n    continueButtonLabel: \"delete\",\n    continueButtonVariant: ButtonVariant.danger,\n    onConfirm: async () => {\n      try {\n        await adminClient.components.del({ id: id! });\n        addAlert(t(\"userFedDeletedSuccess\"), AlertVariant.success);\n        navigate(toUserFederation({ realm }), { replace: true });\n      } catch (error) {\n        addError(\"userFedDeleteError\", error);\n      }\n    },\n  });\n\n  return (\n    <>\n      \n      \n      \n          !id ? (\n            \n          ) : (\n             toggleDeleteDialog()}\n                  data-testid=\"delete-cmd\"\n                >\n                  {t(\"deleteProvider\")}\n                ,\n              ]}\n              isEnabled={field.value?.[0] === \"true\" || field.value === \"true\"}\n              onToggle={(value) => {\n                if (!value) {\n                  toggleDisableDialog();\n                } else {\n                  field.onChange([value.toString()]);\n                  save();\n                }\n              }}\n            />\n          )\n        }\n      />\n    \n  );\n};\n","import { Text, TextContent, Title } from \"@patternfly/react-core\";\n\nimport \"./wizard-section-header.css\";\n\nexport type WizardSectionHeaderProps = {\n  title: string;\n  description?: string;\n  showDescription?: boolean;\n};\n\nexport const WizardSectionHeader = ({\n  title,\n  description,\n  showDescription = false,\n}: WizardSectionHeaderProps) => {\n  return (\n    <>\n      \n        {title}\n      \n      {showDescription && (\n        \n          {description}\n        \n      )}\n    \n  );\n};\n","import {\n  HelpItem,\n  KeycloakSelect,\n  SelectControl,\n  SelectVariant,\n} from \"@keycloak/keycloak-ui-shared\";\nimport { FormGroup, NumberInput, SelectOption } from \"@patternfly/react-core\";\nimport { isEqual } from \"lodash-es\";\nimport { Controller, UseFormReturn, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { WizardSectionHeader } from \"../../components/wizard-section-header/WizardSectionHeader\";\nimport useToggle from \"../../utils/useToggle\";\n\nexport type SettingsCacheProps = {\n  form: UseFormReturn;\n  showSectionHeading?: boolean;\n  showSectionDescription?: boolean;\n  unWrap?: boolean;\n};\n\nconst CacheFields = ({ form }: { form: UseFormReturn }) => {\n  const { t } = useTranslation();\n\n  const [isCachePolicyOpen, toggleCachePolicy] = useToggle();\n  const [isEvictionHourOpen, toggleEvictionHour] = useToggle();\n  const [isEvictionMinuteOpen, toggleEvictionMinute] = useToggle();\n\n  const cachePolicyType = useWatch({\n    control: form.control,\n    name: \"config.cachePolicy\",\n  });\n\n  const hourOptions = [\n    \n      {[`00`]}\n    ,\n  ];\n  let hourDisplay = \"\";\n  for (let index = 1; index < 24; index++) {\n    if (index < 10) {\n      hourDisplay = `0${index}`;\n    } else {\n      hourDisplay = `${index}`;\n    }\n    hourOptions.push(\n      \n        {hourDisplay}\n      ,\n    );\n  }\n\n  const minuteOptions = [\n    \n      {[`00`]}\n    ,\n  ];\n  let minuteDisplay = \"\";\n  for (let index = 1; index < 60; index++) {\n    if (index < 10) {\n      minuteDisplay = `0${index}`;\n    } else {\n      minuteDisplay = `${index}`;\n    }\n    minuteOptions.push(\n      \n        {minuteDisplay}\n      ,\n    );\n  }\n\n  return (\n    <>\n      \n        }\n        fieldId=\"kc-cache-policy\"\n      >\n         (\n             {\n                field.onChange(value as string);\n                toggleCachePolicy();\n              }}\n              selections={field.value}\n              variant={SelectVariant.single}\n              data-testid=\"kerberos-cache-policy\"\n              aria-label={t(\"selectCachePolicy\")}\n            >\n              \n                DEFAULT\n              \n              \n                EVICT_DAILY\n              \n              \n                EVICT_WEEKLY\n              \n              \n                MAX_LIFESPAN\n              \n              \n                NO_CACHE\n              \n            \n          )}\n        />\n      \n      {isEqual(cachePolicyType, [\"EVICT_WEEKLY\"]) ? (\n        \n      ) : null}\n      {isEqual(cachePolicyType, [\"EVICT_DAILY\"]) ||\n      isEqual(cachePolicyType, [\"EVICT_WEEKLY\"]) ? (\n        <>\n          \n            }\n            isRequired\n            fieldId=\"kc-eviction-hour\"\n          >\n             (\n                 {\n                    field.onChange(value as string);\n                    toggleEvictionHour();\n                  }}\n                  selections={field.value}\n                  variant={SelectVariant.single}\n                  aria-label={t(\"selectEvictionHour\")}\n                >\n                  {hourOptions}\n                \n              )}\n            />\n          \n          \n            }\n            isRequired\n            fieldId=\"kc-eviction-minute\"\n          >\n             (\n                 {\n                    field.onChange(value as string);\n                    toggleEvictionMinute();\n                  }}\n                  selections={field.value}\n                  variant={SelectVariant.single}\n                  aria-label={t(\"selectEvictionMinute\")}\n                >\n                  {minuteOptions}\n                \n              )}\n            />\n          \n        \n      ) : null}\n      {isEqual(cachePolicyType, [\"MAX_LIFESPAN\"]) ? (\n        \n          }\n          fieldId=\"kc-max-lifespan\"\n        >\n           {\n              const MIN_VALUE = 0;\n              const setValue = (newValue: number) =>\n                field.onChange(Math.max(newValue, MIN_VALUE));\n\n              return (\n                 field.onChange(Number(field.value) + 1)}\n                  onMinus={() => field.onChange(Number(field.value) - 1)}\n                  onChange={(event) => {\n                    const newValue = Number(event.currentTarget.value);\n                    setValue(!isNaN(newValue) ? newValue : 0);\n                  }}\n                />\n              );\n            }}\n          />\n        \n      ) : null}\n    \n  );\n};\n\nexport const SettingsCache = ({\n  form,\n  showSectionHeading = false,\n  showSectionDescription = false,\n  unWrap = false,\n}: SettingsCacheProps) => {\n  const { t } = useTranslation();\n\n  return (\n    <>\n      {showSectionHeading && (\n        \n      )}\n      {unWrap ? (\n        \n      ) : (\n        \n          \n        \n      )}\n    \n  );\n};\n"],"names":["Header","provider","save","noDivider","dropdownItems","adminClient","useAdminClient","t","useTranslation","id","useParams","navigate","useNavigate","addAlert","addError","useAlerts","realm","useRealm","control","setValue","useFormContext","toggleDisableDialog","DisableConfirm","useConfirmDialog","toggleDeleteDialog","DeleteConfirm","ButtonVariant","AlertVariant","toUserFederation","error","jsxs","Fragment","jsx","Controller","field","ViewHeader","DropdownItem","value","WizardSectionHeader","title","description","showDescription","Title","TextContent","Text","CacheFields","form","isCachePolicyOpen","toggleCachePolicy","useToggle","isEvictionHourOpen","toggleEvictionHour","isEvictionMinuteOpen","toggleEvictionMinute","cachePolicyType","useWatch","hourOptions","SelectOption","hourDisplay","index","minuteOptions","minuteDisplay","FormGroup","HelpItem","KeycloakSelect","SelectVariant","isEqual","SelectControl","newValue","NumberInput","event","SettingsCache","showSectionHeading","showSectionDescription","unWrap","FormAccess"],"mappings":"2eAwBO,MAAMA,GAAS,CAAC,CACrB,SAAAC,EACA,KAAAC,EACA,UAAAC,EAAY,GACZ,cAAAC,EAAgB,CAAC,CACnB,IAAmB,CACX,KAAA,CAAE,YAAAC,GAAgBC,IAElB,CAAE,EAAAC,GAAMC,IACR,CAAE,GAAAC,GAAOC,IACTC,EAAWC,IAEX,CAAE,SAAAC,EAAU,SAAAC,CAAS,EAAIC,EAAU,EACnC,CAAE,MAAAC,GAAUC,IAEZ,CAAE,QAAAC,EAAS,SAAAC,CAAS,EAAIC,EAAe,EAEvC,CAACC,EAAqBC,CAAc,EAAIC,EAAiB,CAC7D,SAAU,6BACV,WAAY,wBACZ,oBAAqB,UACrB,UAAW,IAAM,CACfJ,EAAS,oBAAqB,OAAO,EAChCjB,GACP,CAAA,CACD,EAEK,CAACsB,EAAoBC,CAAa,EAAIF,EAAiB,CAC3D,SAAU,4BACV,WAAY,uBACZ,oBAAqB,SACrB,sBAAuBG,EAAc,OACrC,UAAW,SAAY,CACjB,GAAA,CACF,MAAMrB,EAAY,WAAW,IAAI,CAAE,GAAAI,CAAS,CAAA,EAC5CI,EAASN,EAAE,uBAAuB,EAAGoB,EAAa,OAAO,EAChDhB,EAAAiB,EAAiB,CAAE,MAAAZ,CAAM,CAAC,EAAG,CAAE,QAAS,GAAM,QAChDa,EAAO,CACdf,EAAS,qBAAsBe,CAAK,CACtC,CACF,CAAA,CACD,EAED,OAEIC,EAAAC,EAAA,CAAA,SAAA,CAAAC,EAACV,EAAe,EAAA,IACfG,EAAc,EAAA,EACfO,EAACC,EAAA,CACC,KAAK,iBACL,aAAc,CAAC,MAAM,EACrB,QAAAf,EACA,OAAQ,CAAC,CAAE,MAAAgB,KACRzB,EAQCuB,EAACG,EAAA,CACC,QAAS,CAAChC,EACV,SAAUF,EAC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