theme.keycloak.v2.admin.resources.assets.DeleteScopeDialog-DnPgJmDI.js.map Maven / Gradle / Ivy
{"version":3,"file":"DeleteScopeDialog-DnPgJmDI.js","sources":["../../src/clients/authorization/DeleteScopeDialog.tsx"],"sourcesContent":["import type ScopeRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation\";\nimport { Alert, AlertVariant } from \"@patternfly/react-core\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { ConfirmDialogModal } from \"../../components/confirm-dialog/ConfirmDialog\";\nimport type { PermissionScopeRepresentation } from \"./Scopes\";\n\ntype DeleteScopeDialogProps = {\n clientId: string;\n selectedScope:\n | PermissionScopeRepresentation\n | ScopeRepresentation\n | undefined;\n refresh: () => void;\n open: boolean;\n toggleDialog: () => void;\n};\n\nexport const DeleteScopeDialog = ({\n clientId,\n selectedScope,\n refresh,\n open,\n toggleDialog,\n}: DeleteScopeDialogProps) => {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const { addAlert, addError } = useAlerts();\n\n return (\n {\n try {\n await adminClient.clients.delAuthorizationScope({\n id: clientId,\n scopeId: selectedScope?.id!,\n });\n addAlert(t(\"resourceScopeSuccess\"), AlertVariant.success);\n refresh();\n } catch (error) {\n addError(\"resourceScopeError\", error);\n }\n }}\n >\n {t(\"deleteScopeConfirm\")}\n {selectedScope &&\n \"permissions\" in selectedScope &&\n selectedScope.permissions &&\n selectedScope.permissions.length > 0 && (\n \n \n {selectedScope.permissions.map((permission) => (\n \n {permission.name}\n \n ))}\n
\n \n )}\n \n );\n};\n"],"names":["DeleteScopeDialog","clientId","selectedScope","refresh","open","toggleDialog","adminClient","useAdminClient","t","useTranslation","addAlert","addError","useAlerts","jsxs","ConfirmDialogModal","AlertVariant","error","jsx","Alert","permission"],"mappings":"6JAmBO,MAAMA,EAAoB,CAAC,CAChC,SAAAC,EACA,cAAAC,EACA,QAAAC,EACA,KAAAC,EACA,aAAAC,CACF,IAA8B,CACtB,KAAA,CAAE,YAAAC,GAAgBC,IAElB,CAAE,EAAAC,GAAMC,IACR,CAAE,SAAAC,EAAU,SAAAC,CAAS,EAAIC,EAAU,EAGvC,OAAAC,EAACC,EAAA,CACC,KAAAV,EACA,aAAAC,EACA,SAAS,cACT,oBAAoB,UACpB,UAAW,SAAY,CACjB,GAAA,CACI,MAAAC,EAAY,QAAQ,sBAAsB,CAC9C,GAAIL,EACJ,QAASC,GAAe,EAAA,CACzB,EACDQ,EAASF,EAAE,sBAAsB,EAAGO,EAAa,OAAO,EAChDZ,UACDa,EAAO,CACdL,EAAS,qBAAsBK,CAAK,CACtC,CACF,EAEC,SAAA,CAAAR,EAAE,oBAAoB,EACtBN,GACC,gBAAiBA,GACjBA,EAAc,aACdA,EAAc,YAAY,OAAS,GACjCe,EAACC,EAAA,CACC,QAAQ,UACR,SAAQ,GACR,QAAO,GACP,MAAOV,EAAE,oBAAoB,EAC7B,UAAU,gBAEV,WAAC,IAAE,CAAA,UAAU,gBACV,SAAcN,EAAA,YAAY,IAAKiB,GAC7BF,EAAA,SAAA,CAA2B,UAAU,gBACnC,SAAAE,EAAW,MADDA,EAAW,EAExB,CACD,EACH,CAAA,CACF,CAAA,CAAA,CAAA,CAIV"}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy