theme.keycloak.v2.admin.resources.assets.OrganizationsSection-CuGpkAlM.js.map Maven / Gradle / Ivy
{"version":3,"file":"OrganizationsSection-CuGpkAlM.js","sources":["../../src/organizations/OrganizationsSection.tsx"],"sourcesContent":["import OrganizationRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/organizationRepresentation\";\nimport {\n Badge,\n Button,\n ButtonVariant,\n Chip,\n ChipGroup,\n PageSection,\n ToolbarItem,\n} from \"@patternfly/react-core\";\nimport { TableText } from \"@patternfly/react-table\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../admin-client\";\nimport { useAlerts } from \"../components/alert/Alerts\";\nimport { useConfirmDialog } from \"../components/confirm-dialog/ConfirmDialog\";\nimport { ListEmptyState } from \"../components/list-empty-state/ListEmptyState\";\nimport { KeycloakDataTable } from \"../components/table-toolbar/KeycloakDataTable\";\nimport { ViewHeader } from \"../components/view-header/ViewHeader\";\nimport { useRealm } from \"../context/realm-context/RealmContext\";\nimport { toAddOrganization } from \"./routes/AddOrganization\";\nimport { toEditOrganization } from \"./routes/EditOrganization\";\n\nconst OrgDetailLink = (organization: any) => {\n const { t } = useTranslation();\n const { realm } = useRealm();\n return (\n \n \n {organization.name}\n {!organization.enabled && (\n \n {t(\"disabled\")}\n \n )}\n \n \n );\n};\n\nconst Domains = (org: OrganizationRepresentation) => {\n const { t } = useTranslation();\n return (\n \n {org.domains?.map((dn) => (\n \n {dn.name}\n \n ))}\n \n );\n};\n\nexport default function OrganizationSection() {\n const { adminClient } = useAdminClient();\n const { realm } = useRealm();\n const { t } = useTranslation();\n const { addAlert, addError } = useAlerts();\n const navigate = useNavigate();\n\n const [key, setKey] = useState(0);\n const refresh = () => setKey(key + 1);\n\n const [selectedOrg, setSelectedOrg] = useState();\n\n async function loader(first?: number, max?: number, search?: string) {\n return await adminClient.organizations.find({ first, max, search });\n }\n\n const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({\n titleKey: \"organizationDelete\",\n messageKey: \"organizationDeleteConfirm\",\n continueButtonLabel: \"delete\",\n continueButtonVariant: ButtonVariant.danger,\n onConfirm: async () => {\n try {\n await adminClient.organizations.delById({\n id: selectedOrg!.id!,\n });\n addAlert(t(\"organizationDeletedSuccess\"));\n refresh();\n } catch (error) {\n addError(\"organizationDeleteError\", error);\n }\n },\n });\n\n return (\n <>\n \n \n \n \n \n \n }\n actions={[\n {\n title: t(\"delete\"),\n onRowClick: (org) => {\n setSelectedOrg(org);\n toggleDeleteDialog();\n },\n },\n ]}\n columns={[\n {\n name: \"name\",\n displayKey: \"name\",\n cellRenderer: OrgDetailLink,\n },\n {\n name: \"domains\",\n displayKey: \"domains\",\n cellRenderer: Domains,\n },\n {\n name: \"description\",\n displayKey: \"description\",\n },\n ]}\n emptyState={\n navigate(toAddOrganization({ realm }))}\n />\n }\n />\n \n >\n );\n}\n"],"names":["OrgDetailLink","organization","t","useTranslation","realm","useRealm","jsx","TableText","jsxs","Link","toEditOrganization","Badge","Domains","org","ChipGroup","dn","Chip","OrganizationSection","adminClient","useAdminClient","addAlert","addError","useAlerts","navigate","useNavigate","key","setKey","useState","refresh","selectedOrg","setSelectedOrg","loader","first","max","search","toggleDeleteDialog","DeleteConfirm","useConfirmDialog","ButtonVariant","error","Fragment","ViewHeader","PageSection","KeycloakDataTable","ToolbarItem","Button","props","toAddOrganization","ListEmptyState"],"mappings":"8oBAwBA,MAAMA,EAAiBC,GAAsB,CACrC,KAAA,CAAE,EAAAC,GAAMC,IACR,CAAE,MAAAC,GAAUC,IAEhB,OAAAC,EAACC,EAAU,CAAA,aAAa,WACtB,SAAAC,EAACC,EAAA,CAEC,GAAIC,EAAmB,CACrB,MAAAN,EACA,GAAIH,EAAa,GACjB,IAAK,UAAA,CACN,EAEA,SAAA,CAAaA,EAAA,KACb,CAACA,EAAa,SACbK,EAACK,EAAA,CAEC,OAAM,GACN,UAAU,gBAET,WAAE,UAAU,CAAA,EAJR,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