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

theme.keycloak.v2.admin.resources.assets.Page-CJt-cEyg.js.map Maven / Gradle / Ivy

There is a newer version: 26.1.0
Show newest version
{"version":3,"file":"Page-CJt-cEyg.js","sources":["../../src/page/Page.tsx"],"sourcesContent":["import { ButtonVariant, DropdownItem } from \"@patternfly/react-core\";\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 { useServerInfo } from \"../context/server-info/ServerInfoProvider\";\nimport { PageHandler } from \"./PageHandler\";\nimport { PAGE_PROVIDER } from \"./PageList\";\nimport { PageParams, toPage } from \"./routes\";\n\nexport default function Page() {\n  const { adminClient } = useAdminClient();\n\n  const { t } = useTranslation();\n  const { componentTypes } = useServerInfo();\n  const { realm } = useRealm();\n  const pages = componentTypes?.[PAGE_PROVIDER];\n  const navigate = useNavigate();\n  const { id, providerId } = useParams();\n  const { addAlert, addError } = useAlerts();\n\n  const page = pages?.find((p) => p.id === providerId);\n  if (!page) {\n    throw new Error(t(\"notFound\"));\n  }\n\n  const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({\n    titleKey: \"itemDeleteConfirmTitle\",\n    messageKey: \"itemDeleteConfirm\",\n    continueButtonLabel: \"delete\",\n    continueButtonVariant: ButtonVariant.danger,\n    onConfirm: async () => {\n      try {\n        await adminClient.components.del({\n          id: id!,\n        });\n        addAlert(t(\"itemDeletedSuccess\"));\n        navigate(toPage({ realm, providerId: providerId! }));\n      } catch (error) {\n        addError(\"itemSaveError\", error);\n      }\n    },\n  });\n  return (\n    <>\n      \n       toggleDeleteDialog()}\n                >\n                  {t(\"delete\")}\n                ,\n              ]\n            : undefined\n        }\n      />\n      \n    \n  );\n}\n"],"names":["Page","adminClient","useAdminClient","useTranslation","componentTypes","useServerInfo","realm","useRealm","pages","PAGE_PROVIDER","navigate","useNavigate","id","providerId","useParams","addAlert","addError","useAlerts","page","p","toggleDeleteDialog","DeleteConfirm","useConfirmDialog","ButtonVariant","toPage","error","jsxs","Fragment","jsx","ViewHeader","DropdownItem","PageHandler"],"mappings":"4nCAaA,SAAwBA,IAAO,CACvB,KAAA,CAAE,YAAAC,GAAgBC,IAElB,CAAE,GAAMC,IACR,CAAE,eAAAC,GAAmBC,IACrB,CAAE,MAAAC,GAAUC,IACZC,EAAQJ,IAAiBK,CAAa,EACtCC,EAAWC,IACX,CAAE,GAAAC,EAAI,WAAAC,CAAW,EAAIC,EAAsB,EAC3C,CAAE,SAAAC,EAAU,SAAAC,CAAS,EAAIC,EAAU,EAEnCC,EAAOV,GAAO,KAAMW,GAAMA,EAAE,KAAON,CAAU,EACnD,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,EAAE,UAAU,CAAC,EAG/B,KAAM,CAACE,EAAoBC,CAAa,EAAIC,EAAiB,CAC3D,SAAU,yBACV,WAAY,oBACZ,oBAAqB,SACrB,sBAAuBC,EAAc,OACrC,UAAW,SAAY,CACjB,GAAA,CACI,MAAAtB,EAAY,WAAW,IAAI,CAC/B,GAAAW,CAAA,CACD,EACQG,EAAA,EAAE,oBAAoB,CAAC,EAChCL,EAASc,EAAO,CAAE,MAAAlB,EAAO,WAAAO,CAAA,CAAyB,CAAC,QAC5CY,EAAO,CACdT,EAAS,gBAAiBS,CAAK,CACjC,CACF,CAAA,CACD,EACD,OAEIC,EAAAC,EAAA,CAAA,SAAA,CAAAC,EAACP,EAAc,EAAA,EACfO,EAACC,EAAA,CACC,SAAUjB,GAAM,EAAE,YAAY,EAC9B,cACEA,EACI,CACEgB,EAACE,EAAA,CACC,cAAY,cAEZ,QAAS,IAAMV,EAAmB,EAEjC,WAAE,QAAQ,CAAA,EAHP,QAIN,CAEF,EAAA,MAAA,CAER,EACCQ,EAAAG,EAAA,CAAY,aAActB,EAAe,GAAAG,EAAQ,KAAAM,EAAY,CAChE,CAAA,CAAA,CAEJ"}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy