@backstage/plugin-org 0.3.33 → 0.3.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @backstage/plugin-org
2
2
 
3
+ ## 0.3.34
4
+
5
+ ### Patch Changes
6
+
7
+ - 3f08dcd696: For the component `EntityMembersListCard` you can now specify the type of members you have in a group. For example:
8
+
9
+ ```tsx
10
+ <Grid item xs={12}>
11
+ <EntityMembersListCard memberDisplayTitle="Ninja's" />
12
+ </Grid>
13
+ ```
14
+
15
+ If left empty it will by default use 'Members'.
16
+
17
+ - Updated dependencies
18
+ - @backstage/core-components@0.8.4
19
+ - @backstage/core-plugin-api@0.5.0
20
+ - @backstage/plugin-catalog-react@0.6.11
21
+ - @backstage/catalog-model@0.9.9
22
+
3
23
  ## 0.3.33
4
24
 
5
25
  ### Patch Changes
@@ -16,4 +16,4 @@ import '@material-ui/lab/Alert';
16
16
  import '@material-ui/icons/Person';
17
17
  import 'qs';
18
18
  import 'pluralize';
19
- //# sourceMappingURL=index-2edd98a9.esm.js.map
19
+ //# sourceMappingURL=index-7d49332b.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-7d49332b.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ declare const EntityGroupProfileCard: ({ variant, }: {
12
12
  }) => JSX.Element;
13
13
  declare const EntityMembersListCard: (_props: {
14
14
  entity?: _backstage_catalog_model.GroupEntity | undefined;
15
+ memberDisplayTitle?: string | undefined;
15
16
  }) => JSX.Element;
16
17
  declare const EntityOwnershipCard: ({ variant, entityFilterKind, }: {
17
18
  entity?: _backstage_catalog_model.Entity | undefined;
@@ -26,6 +27,7 @@ declare const EntityUserProfileCard: ({ variant, }: {
26
27
  declare const MembersListCard: (_props: {
27
28
  /** @deprecated The entity is now grabbed from context instead */
28
29
  entity?: GroupEntity;
30
+ memberDisplayTitle?: string;
29
31
  }) => JSX.Element;
30
32
 
31
33
  declare const GroupProfileCard: ({ variant, }: {
package/dist/index.esm.js CHANGED
@@ -22,25 +22,25 @@ const orgPlugin = createPlugin({
22
22
  const EntityGroupProfileCard = orgPlugin.provide(createComponentExtension({
23
23
  name: "EntityGroupProfileCard",
24
24
  component: {
25
- lazy: () => import('./esm/index-2edd98a9.esm.js').then((m) => m.GroupProfileCard)
25
+ lazy: () => import('./esm/index-7d49332b.esm.js').then((m) => m.GroupProfileCard)
26
26
  }
27
27
  }));
28
28
  const EntityMembersListCard = orgPlugin.provide(createComponentExtension({
29
29
  name: "EntityMembersListCard",
30
30
  component: {
31
- lazy: () => import('./esm/index-2edd98a9.esm.js').then((m) => m.MembersListCard)
31
+ lazy: () => import('./esm/index-7d49332b.esm.js').then((m) => m.MembersListCard)
32
32
  }
33
33
  }));
34
34
  const EntityOwnershipCard = orgPlugin.provide(createComponentExtension({
35
35
  name: "EntityOwnershipCard",
36
36
  component: {
37
- lazy: () => import('./esm/index-2edd98a9.esm.js').then((m) => m.OwnershipCard)
37
+ lazy: () => import('./esm/index-7d49332b.esm.js').then((m) => m.OwnershipCard)
38
38
  }
39
39
  }));
40
40
  const EntityUserProfileCard = orgPlugin.provide(createComponentExtension({
41
41
  name: "EntityUserProfileCard",
42
42
  component: {
43
- lazy: () => import('./esm/index-2edd98a9.esm.js').then((m) => m.UserProfileCard)
43
+ lazy: () => import('./esm/index-7d49332b.esm.js').then((m) => m.UserProfileCard)
44
44
  }
45
45
  }));
46
46
 
@@ -100,6 +100,7 @@ const MemberComponent = ({ member }) => {
100
100
  const MembersListCard = (_props) => {
101
101
  var _a;
102
102
  const { entity: groupEntity } = useEntity();
103
+ let { memberDisplayTitle } = _props;
103
104
  const {
104
105
  metadata: { name: groupName, namespace: grpNamespace },
105
106
  spec: { profile }
@@ -112,6 +113,7 @@ const MembersListCard = (_props) => {
112
113
  setPage(pageIndex);
113
114
  };
114
115
  const pageSize = 50;
116
+ memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : "Members";
115
117
  const {
116
118
  loading,
117
119
  error,
@@ -145,7 +147,7 @@ const MembersListCard = (_props) => {
145
147
  return /* @__PURE__ */ React.createElement(Grid, {
146
148
  item: true
147
149
  }, /* @__PURE__ */ React.createElement(InfoCard, {
148
- title: `Members (${(members == null ? void 0 : members.length) || 0}${paginationLabel})`,
150
+ title: `${memberDisplayTitle} (${(members == null ? void 0 : members.length) || 0}${paginationLabel})`,
149
151
  subheader: `of ${displayName}`,
150
152
  ...nbPages <= 1 ? {} : { actions: pagination }
151
153
  }, /* @__PURE__ */ React.createElement(Grid, {
@@ -156,7 +158,7 @@ const MembersListCard = (_props) => {
156
158
  key: member.metadata.uid
157
159
  })) : /* @__PURE__ */ React.createElement(Box, {
158
160
  p: 2
159
- }, /* @__PURE__ */ React.createElement(Typography, null, "This group has no members.")))));
161
+ }, /* @__PURE__ */ React.createElement(Typography, null, "This group has no $", memberDisplayTitle.toLocaleLowerCase(), ".")))));
160
162
  };
161
163
 
162
164
  const CardTitle$1 = ({ title }) => /* @__PURE__ */ React.createElement(Box, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/components/Cards/Group/MembersList/MembersListCard.tsx","../src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx","../src/components/Cards/User/UserProfileCard/UserProfileCard.tsx","../src/components/Cards/OwnershipCard/OwnershipCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createPlugin,\n} from '@backstage/core-plugin-api';\n\nexport const orgPlugin = createPlugin({\n id: 'org',\n});\n\nexport const EntityGroupProfileCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityGroupProfileCard',\n component: {\n lazy: () => import('./components').then(m => m.GroupProfileCard),\n },\n }),\n);\nexport const EntityMembersListCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityMembersListCard',\n component: {\n lazy: () => import('./components').then(m => m.MembersListCard),\n },\n }),\n);\nexport const EntityOwnershipCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityOwnershipCard',\n component: {\n lazy: () => import('./components').then(m => m.OwnershipCard),\n },\n }),\n);\nexport const EntityUserProfileCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityUserProfileCard',\n component: {\n lazy: () => import('./components').then(m => m.UserProfileCard),\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ENTITY_DEFAULT_NAMESPACE,\n GroupEntity,\n RELATION_MEMBER_OF,\n UserEntity,\n} from '@backstage/catalog-model';\nimport {\n catalogApiRef,\n entityRouteParams,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n createStyles,\n Grid,\n makeStyles,\n Theme,\n Typography,\n} from '@material-ui/core';\nimport Pagination from '@material-ui/lab/Pagination';\nimport React from 'react';\nimport { generatePath } from 'react-router-dom';\nimport useAsync from 'react-use/lib/useAsync';\n\nimport {\n Avatar,\n InfoCard,\n Progress,\n ResponseErrorPanel,\n Link,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n overflow: 'visible',\n position: 'relative',\n margin: theme.spacing(4, 1, 1),\n flex: '1',\n minWidth: '0px',\n },\n }),\n);\n\nconst MemberComponent = ({ member }: { member: UserEntity }) => {\n const classes = useStyles();\n const {\n metadata: { name: metaName },\n spec: { profile },\n } = member;\n const displayName = profile?.displayName ?? metaName;\n\n return (\n <Grid item container xs={12} sm={6} md={4} xl={2}>\n <Box className={classes.card}>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n m={3}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Avatar\n displayName={displayName}\n picture={profile?.picture}\n customStyles={{\n position: 'absolute',\n top: '-2rem',\n }}\n />\n <Box pt={2} textAlign=\"center\">\n <Typography variant=\"h5\">\n <Link\n to={generatePath(\n `/catalog/:namespace/user/${metaName}`,\n entityRouteParams(member),\n )}\n >\n {displayName}\n </Link>\n </Typography>\n {profile?.email && (\n <Link to={`mailto:${profile.email}`}>{profile.email}</Link>\n )}\n </Box>\n </Box>\n </Box>\n </Grid>\n );\n};\n\nexport const MembersListCard = (_props: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: GroupEntity;\n}) => {\n const { entity: groupEntity } = useEntity<GroupEntity>();\n const {\n metadata: { name: groupName, namespace: grpNamespace },\n spec: { profile },\n } = groupEntity;\n const catalogApi = useApi(catalogApiRef);\n\n const displayName = profile?.displayName ?? groupName;\n\n const groupNamespace = grpNamespace || ENTITY_DEFAULT_NAMESPACE;\n\n const [page, setPage] = React.useState(1);\n const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {\n setPage(pageIndex);\n };\n const pageSize = 50;\n\n const {\n loading,\n error,\n value: members,\n } = useAsync(async () => {\n const membersList = await catalogApi.getEntities({\n filter: { kind: 'User' },\n });\n const groupMembersList = (membersList.items as UserEntity[]).filter(\n member =>\n member?.relations?.some(\n r =>\n r.type === RELATION_MEMBER_OF &&\n r.target.name.toLocaleLowerCase('en-US') ===\n groupName.toLocaleLowerCase('en-US') &&\n r.target.namespace.toLocaleLowerCase('en-US') ===\n groupNamespace.toLocaleLowerCase('en-US'),\n ),\n );\n return groupMembersList;\n }, [catalogApi, groupEntity]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const nbPages = Math.ceil((members?.length || 0) / pageSize);\n const paginationLabel = nbPages < 2 ? '' : `, page ${page} of ${nbPages}`;\n\n const pagination = (\n <Pagination\n count={nbPages}\n page={page}\n onChange={pageChange}\n showFirstButton\n showLastButton\n />\n );\n\n return (\n <Grid item>\n <InfoCard\n title={`Members (${members?.length || 0}${paginationLabel})`}\n subheader={`of ${displayName}`}\n {...(nbPages <= 1 ? {} : { actions: pagination })}\n >\n <Grid container spacing={3}>\n {members && members.length > 0 ? (\n members\n .slice(pageSize * (page - 1), pageSize * page)\n .map(member => (\n <MemberComponent member={member} key={member.metadata.uid} />\n ))\n ) : (\n <Box p={2}>\n <Typography>This group has no members.</Typography>\n </Box>\n )}\n </Grid>\n </InfoCard>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n GroupEntity,\n RELATION_CHILD_OF,\n RELATION_PARENT_OF,\n} from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n getEntityMetadataEditUrl,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Grid,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n IconButton,\n} from '@material-ui/core';\nimport AccountTreeIcon from '@material-ui/icons/AccountTree';\nimport EmailIcon from '@material-ui/icons/Email';\nimport GroupIcon from '@material-ui/icons/Group';\nimport EditIcon from '@material-ui/icons/Edit';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\n\nconst CardTitle = ({ title }: { title: string }) => (\n <Box display=\"flex\" alignItems=\"center\">\n <GroupIcon fontSize=\"inherit\" />\n <Box ml={1}>{title}</Box>\n </Box>\n);\n\nexport const GroupProfileCard = ({\n variant,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: GroupEntity;\n variant?: InfoCardVariants;\n}) => {\n const { entity: group } = useEntity<GroupEntity>();\n if (!group) {\n return <Alert severity=\"error\">Group not found</Alert>;\n }\n\n const {\n metadata: { name, description },\n spec: { profile },\n } = group;\n\n const childRelations = getEntityRelations(group, RELATION_PARENT_OF, {\n kind: 'Group',\n });\n const parentRelations = getEntityRelations(group, RELATION_CHILD_OF, {\n kind: 'group',\n });\n\n const entityMetadataEditUrl = getEntityMetadataEditUrl(group);\n\n const displayName = profile?.displayName ?? name;\n const emailHref = profile?.email ? `mailto:${profile.email}` : '#';\n const infoCardAction = entityMetadataEditUrl ? (\n <IconButton\n aria-label=\"Edit\"\n title=\"Edit Metadata\"\n component={Link}\n to={entityMetadataEditUrl}\n >\n <EditIcon />\n </IconButton>\n ) : (\n <IconButton aria-label=\"Edit\" disabled title=\"Edit Metadata\">\n <EditIcon />\n </IconButton>\n );\n\n return (\n <InfoCard\n title={<CardTitle title={displayName} />}\n subheader={description}\n variant={variant}\n action={infoCardAction}\n >\n <Grid container spacing={3}>\n <Grid item xs={12} sm={2} xl={1}>\n <Avatar displayName={displayName} picture={profile?.picture} />\n </Grid>\n <Grid item md={10} xl={11}>\n <List>\n {profile?.email && (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Email\">\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n {parentRelations.length ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Parent Group\">\n <AccountTreeIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={parentRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n ) : null}\n\n {childRelations.length ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Child Groups\">\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={childRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n ) : null}\n </List>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RELATION_MEMBER_OF, UserEntity } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Grid,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n} from '@material-ui/core';\nimport EmailIcon from '@material-ui/icons/Email';\nimport GroupIcon from '@material-ui/icons/Group';\nimport PersonIcon from '@material-ui/icons/Person';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\n\nconst CardTitle = ({ title }: { title?: string }) =>\n title ? (\n <Box display=\"flex\" alignItems=\"center\">\n <PersonIcon fontSize=\"inherit\" />\n <Box ml={1}>{title}</Box>\n </Box>\n ) : null;\n\nexport const UserProfileCard = ({\n variant,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: UserEntity;\n variant?: InfoCardVariants;\n}) => {\n const { entity: user } = useEntity<UserEntity>();\n if (!user) {\n return <Alert severity=\"error\">User not found</Alert>;\n }\n\n const {\n metadata: { name: metaName },\n spec: { profile },\n } = user;\n const displayName = profile?.displayName ?? metaName;\n const emailHref = profile?.email ? `mailto:${profile.email}` : undefined;\n const memberOfRelations = getEntityRelations(user, RELATION_MEMBER_OF, {\n kind: 'Group',\n });\n\n return (\n <InfoCard title={<CardTitle title={displayName} />} variant={variant}>\n <Grid container spacing={3} alignItems=\"flex-start\">\n <Grid item xs={12} sm={2} xl={1}>\n <Avatar displayName={displayName} picture={profile?.picture} />\n </Grid>\n\n <Grid item md={10} xl={11}>\n <List>\n {profile?.email && (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Email\">\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref ?? ''}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Member of\">\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={memberOfRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n </List>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, UserEntity } from '@backstage/catalog-model';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n catalogRouteRef,\n formatEntityRefTitle,\n isOwnerOf,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport {\n Box,\n createStyles,\n Grid,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport qs from 'qs';\nimport React from 'react';\nimport pluralize from 'pluralize';\nimport useAsync from 'react-use/lib/useAsync';\n\ntype EntityTypeProps = {\n kind: string;\n type: string;\n count: number;\n};\n\nconst useStyles = makeStyles((theme: BackstageTheme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n padding: theme.spacing(2),\n color: '#fff',\n transition: `${theme.transitions.duration.standard}ms`,\n '&:hover': {\n boxShadow: theme.shadows[4],\n },\n },\n bold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n entityTypeBox: {\n background: (props: { type: string }) =>\n theme.getPageTheme({ themeId: props.type }).backgroundImage,\n },\n }),\n);\n\nconst EntityCountTile = ({\n counter,\n type,\n name,\n url,\n}: {\n counter: number;\n type: string;\n name: string;\n url: string;\n}) => {\n const classes = useStyles({ type });\n\n return (\n <Link to={url} variant=\"body2\">\n <Box\n className={`${classes.card} ${classes.entityTypeBox}`}\n display=\"flex\"\n flexDirection=\"column\"\n alignItems=\"center\"\n >\n <Typography className={classes.bold} variant=\"h6\">\n {counter}\n </Typography>\n <Typography className={classes.bold} variant=\"h6\">\n {pluralize(name, counter)}\n </Typography>\n </Box>\n </Link>\n );\n};\n\nconst getQueryParams = (\n owner: Entity,\n selectedEntity: EntityTypeProps,\n): string => {\n const ownerName = formatEntityRefTitle(owner, { defaultKind: 'group' });\n const { kind, type } = selectedEntity;\n const filters = {\n kind,\n type,\n owners: [ownerName],\n user: 'all',\n };\n if (owner.kind === 'User') {\n const user = owner as UserEntity;\n filters.owners = [...filters.owners, ...user.spec.memberOf];\n }\n const queryParams = qs.stringify({\n filters,\n });\n\n return queryParams;\n};\n\nexport const OwnershipCard = ({\n variant,\n entityFilterKind,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: InfoCardVariants;\n entityFilterKind?: string[];\n}) => {\n const { entity } = useEntity();\n const catalogApi = useApi(catalogApiRef);\n const catalogLink = useRouteRef(catalogRouteRef);\n\n const {\n loading,\n error,\n value: componentsWithCounters,\n } = useAsync(async () => {\n const kinds = entityFilterKind ?? ['Component', 'API'];\n const entitiesList = await catalogApi.getEntities({\n filter: {\n kind: kinds,\n },\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'spec.type',\n 'relations',\n ],\n });\n\n const ownedEntitiesList = entitiesList.items.filter(component =>\n isOwnerOf(entity, component),\n );\n\n const counts = ownedEntitiesList.reduce(\n (acc: EntityTypeProps[], ownedEntity) => {\n const match = acc.find(\n x =>\n x.kind === ownedEntity.kind &&\n x.type === (ownedEntity.spec?.type ?? ownedEntity.kind),\n );\n if (match) {\n match.count += 1;\n } else {\n acc.push({\n kind: ownedEntity.kind,\n type: ownedEntity.spec?.type?.toString() ?? ownedEntity.kind,\n count: 1,\n });\n }\n return acc;\n },\n [],\n );\n\n // Return top N (six) entities to be displayed in ownership boxes\n const topN = counts.sort((a, b) => b.count - a.count).slice(0, 6);\n\n return topN.map(topOwnedEntity => ({\n counter: topOwnedEntity.count,\n type: topOwnedEntity.type,\n name: topOwnedEntity.type.toLocaleUpperCase('en-US'),\n queryParams: getQueryParams(entity, topOwnedEntity),\n })) as Array<{\n counter: number;\n type: string;\n name: string;\n queryParams: string;\n }>;\n }, [catalogApi, entity]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <InfoCard title=\"Ownership\" variant={variant}>\n <Grid container>\n {componentsWithCounters?.map(c => (\n <Grid item xs={6} md={6} lg={4} key={c.name}>\n <EntityCountTile\n counter={c.counter}\n type={c.type}\n name={c.name}\n url={`${catalogLink()}/?${c.queryParams}`}\n />\n </Grid>\n ))}\n </Grid>\n </InfoCard>\n );\n};\n"],"names":["useStyles","CardTitle"],"mappings":";;;;;;;;;;;;;;;;;;MAoBa,YAAY,aAAa;AAAA,EACpC,IAAI;AAAA;MAGO,yBAAyB,UAAU,QAC9C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,wBAAwB,UAAU,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,sBAAsB,UAAU,QAC3C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,wBAAwB,UAAU,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;;ACJrD,MAAMA,cAAY,WAAW,CAAC,UAC5B,aAAa;AAAA,EACX,MAAM;AAAA,IACJ,QAAQ,aAAa,MAAM,QAAQ;AAAA,IACnC,WAAW,MAAM,QAAQ;AAAA,IACzB,cAAc;AAAA,IACd,UAAU;AAAA,IACV,UAAU;AAAA,IACV,QAAQ,MAAM,QAAQ,GAAG,GAAG;AAAA,IAC5B,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAKhB,MAAM,kBAAkB,CAAC,EAAE,aAAqC;AA/DhE;AAgEE,QAAM,UAAUA;AAChB,QAAM;AAAA,IACJ,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AAA,UAClB,MAAM,8BAAY,SAAZ,mBAAkB,SAAlB,mBAAwB,eAAxB,YAAsC,YAAY;AAAA,UACxD,OAAO;AAAA;AAAA;AAGX,aAAO;AAAA,OAET;AAIF,UAAM,OAAO,OAAO,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,OAAO,MAAM,GAAG;AAE/D,WAAO,KAAK,IAAI;AAAmB,MACjC,SAAS,eAAe;AAAA,MACxB,MAAM,eAAe;AAAA,MACrB,MAAM,eAAe,KAAK,kBAAkB;AAAA,MAC5C,aAAa,eAAe,QAAQ;AAAA;AAAA,KAOrC,CAAC,YAAY;AAEhB,MAAI,SAAS;AACX,+CAAQ,UAAD;AAAA,aACE,OAAO;AAChB,+CAAQ,oBAAD;AAAA,MAAoB;AAAA;AAAA;AAG7B,6CACG,UAAD;AAAA,IAAU,OAAM;AAAA,IAAY;AAAA,yCACzB,MAAD;AAAA,IAAM,WAAS;AAAA,KACZ,iEAAwB,IAAI,2CAC1B,MAAD;AAAA,IAAM,MAAI;AAAA,IAAC,IAAI;AAAA,IAAG,IAAI;AAAA,IAAG,IAAI;AAAA,IAAG,KAAK,EAAE;AAAA,yCACpC,iBAAD;AAAA,IACE,SAAS,EAAE;AAAA,IACX,MAAM,EAAE;AAAA,IACR,MAAM,EAAE;AAAA,IACR,KAAK,GAAG,kBAAkB,EAAE;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/components/Cards/Group/MembersList/MembersListCard.tsx","../src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx","../src/components/Cards/User/UserProfileCard/UserProfileCard.tsx","../src/components/Cards/OwnershipCard/OwnershipCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createPlugin,\n} from '@backstage/core-plugin-api';\n\nexport const orgPlugin = createPlugin({\n id: 'org',\n});\n\nexport const EntityGroupProfileCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityGroupProfileCard',\n component: {\n lazy: () => import('./components').then(m => m.GroupProfileCard),\n },\n }),\n);\nexport const EntityMembersListCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityMembersListCard',\n component: {\n lazy: () => import('./components').then(m => m.MembersListCard),\n },\n }),\n);\nexport const EntityOwnershipCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityOwnershipCard',\n component: {\n lazy: () => import('./components').then(m => m.OwnershipCard),\n },\n }),\n);\nexport const EntityUserProfileCard = orgPlugin.provide(\n createComponentExtension({\n name: 'EntityUserProfileCard',\n component: {\n lazy: () => import('./components').then(m => m.UserProfileCard),\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ENTITY_DEFAULT_NAMESPACE,\n GroupEntity,\n RELATION_MEMBER_OF,\n UserEntity,\n} from '@backstage/catalog-model';\nimport {\n catalogApiRef,\n entityRouteParams,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n createStyles,\n Grid,\n makeStyles,\n Theme,\n Typography,\n} from '@material-ui/core';\nimport Pagination from '@material-ui/lab/Pagination';\nimport React from 'react';\nimport { generatePath } from 'react-router-dom';\nimport useAsync from 'react-use/lib/useAsync';\n\nimport {\n Avatar,\n InfoCard,\n Progress,\n ResponseErrorPanel,\n Link,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n overflow: 'visible',\n position: 'relative',\n margin: theme.spacing(4, 1, 1),\n flex: '1',\n minWidth: '0px',\n },\n }),\n);\n\nconst MemberComponent = ({ member }: { member: UserEntity }) => {\n const classes = useStyles();\n const {\n metadata: { name: metaName },\n spec: { profile },\n } = member;\n const displayName = profile?.displayName ?? metaName;\n\n return (\n <Grid item container xs={12} sm={6} md={4} xl={2}>\n <Box className={classes.card}>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n m={3}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Avatar\n displayName={displayName}\n picture={profile?.picture}\n customStyles={{\n position: 'absolute',\n top: '-2rem',\n }}\n />\n <Box pt={2} textAlign=\"center\">\n <Typography variant=\"h5\">\n <Link\n to={generatePath(\n `/catalog/:namespace/user/${metaName}`,\n entityRouteParams(member),\n )}\n >\n {displayName}\n </Link>\n </Typography>\n {profile?.email && (\n <Link to={`mailto:${profile.email}`}>{profile.email}</Link>\n )}\n </Box>\n </Box>\n </Box>\n </Grid>\n );\n};\n\nexport const MembersListCard = (_props: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: GroupEntity;\n memberDisplayTitle?: string;\n}) => {\n const { entity: groupEntity } = useEntity<GroupEntity>();\n let { memberDisplayTitle } = _props;\n const {\n metadata: { name: groupName, namespace: grpNamespace },\n spec: { profile },\n } = groupEntity;\n const catalogApi = useApi(catalogApiRef);\n\n const displayName = profile?.displayName ?? groupName;\n\n const groupNamespace = grpNamespace || ENTITY_DEFAULT_NAMESPACE;\n\n const [page, setPage] = React.useState(1);\n const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {\n setPage(pageIndex);\n };\n const pageSize = 50;\n memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : 'Members';\n\n const {\n loading,\n error,\n value: members,\n } = useAsync(async () => {\n const membersList = await catalogApi.getEntities({\n filter: { kind: 'User' },\n });\n const groupMembersList = (membersList.items as UserEntity[]).filter(\n member =>\n member?.relations?.some(\n r =>\n r.type === RELATION_MEMBER_OF &&\n r.target.name.toLocaleLowerCase('en-US') ===\n groupName.toLocaleLowerCase('en-US') &&\n r.target.namespace.toLocaleLowerCase('en-US') ===\n groupNamespace.toLocaleLowerCase('en-US'),\n ),\n );\n return groupMembersList;\n }, [catalogApi, groupEntity]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const nbPages = Math.ceil((members?.length || 0) / pageSize);\n const paginationLabel = nbPages < 2 ? '' : `, page ${page} of ${nbPages}`;\n\n const pagination = (\n <Pagination\n count={nbPages}\n page={page}\n onChange={pageChange}\n showFirstButton\n showLastButton\n />\n );\n\n return (\n <Grid item>\n <InfoCard\n title={`${memberDisplayTitle} (${\n members?.length || 0\n }${paginationLabel})`}\n subheader={`of ${displayName}`}\n {...(nbPages <= 1 ? {} : { actions: pagination })}\n >\n <Grid container spacing={3}>\n {members && members.length > 0 ? (\n members\n .slice(pageSize * (page - 1), pageSize * page)\n .map(member => (\n <MemberComponent member={member} key={member.metadata.uid} />\n ))\n ) : (\n <Box p={2}>\n <Typography>\n This group has no ${memberDisplayTitle.toLocaleLowerCase()}.\n </Typography>\n </Box>\n )}\n </Grid>\n </InfoCard>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n GroupEntity,\n RELATION_CHILD_OF,\n RELATION_PARENT_OF,\n} from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n getEntityMetadataEditUrl,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Grid,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n IconButton,\n} from '@material-ui/core';\nimport AccountTreeIcon from '@material-ui/icons/AccountTree';\nimport EmailIcon from '@material-ui/icons/Email';\nimport GroupIcon from '@material-ui/icons/Group';\nimport EditIcon from '@material-ui/icons/Edit';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\n\nconst CardTitle = ({ title }: { title: string }) => (\n <Box display=\"flex\" alignItems=\"center\">\n <GroupIcon fontSize=\"inherit\" />\n <Box ml={1}>{title}</Box>\n </Box>\n);\n\nexport const GroupProfileCard = ({\n variant,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: GroupEntity;\n variant?: InfoCardVariants;\n}) => {\n const { entity: group } = useEntity<GroupEntity>();\n if (!group) {\n return <Alert severity=\"error\">Group not found</Alert>;\n }\n\n const {\n metadata: { name, description },\n spec: { profile },\n } = group;\n\n const childRelations = getEntityRelations(group, RELATION_PARENT_OF, {\n kind: 'Group',\n });\n const parentRelations = getEntityRelations(group, RELATION_CHILD_OF, {\n kind: 'group',\n });\n\n const entityMetadataEditUrl = getEntityMetadataEditUrl(group);\n\n const displayName = profile?.displayName ?? name;\n const emailHref = profile?.email ? `mailto:${profile.email}` : '#';\n const infoCardAction = entityMetadataEditUrl ? (\n <IconButton\n aria-label=\"Edit\"\n title=\"Edit Metadata\"\n component={Link}\n to={entityMetadataEditUrl}\n >\n <EditIcon />\n </IconButton>\n ) : (\n <IconButton aria-label=\"Edit\" disabled title=\"Edit Metadata\">\n <EditIcon />\n </IconButton>\n );\n\n return (\n <InfoCard\n title={<CardTitle title={displayName} />}\n subheader={description}\n variant={variant}\n action={infoCardAction}\n >\n <Grid container spacing={3}>\n <Grid item xs={12} sm={2} xl={1}>\n <Avatar displayName={displayName} picture={profile?.picture} />\n </Grid>\n <Grid item md={10} xl={11}>\n <List>\n {profile?.email && (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Email\">\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n {parentRelations.length ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Parent Group\">\n <AccountTreeIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={parentRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n ) : null}\n\n {childRelations.length ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Child Groups\">\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={childRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n ) : null}\n </List>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RELATION_MEMBER_OF, UserEntity } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Grid,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n} from '@material-ui/core';\nimport EmailIcon from '@material-ui/icons/Email';\nimport GroupIcon from '@material-ui/icons/Group';\nimport PersonIcon from '@material-ui/icons/Person';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\n\nconst CardTitle = ({ title }: { title?: string }) =>\n title ? (\n <Box display=\"flex\" alignItems=\"center\">\n <PersonIcon fontSize=\"inherit\" />\n <Box ml={1}>{title}</Box>\n </Box>\n ) : null;\n\nexport const UserProfileCard = ({\n variant,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: UserEntity;\n variant?: InfoCardVariants;\n}) => {\n const { entity: user } = useEntity<UserEntity>();\n if (!user) {\n return <Alert severity=\"error\">User not found</Alert>;\n }\n\n const {\n metadata: { name: metaName },\n spec: { profile },\n } = user;\n const displayName = profile?.displayName ?? metaName;\n const emailHref = profile?.email ? `mailto:${profile.email}` : undefined;\n const memberOfRelations = getEntityRelations(user, RELATION_MEMBER_OF, {\n kind: 'Group',\n });\n\n return (\n <InfoCard title={<CardTitle title={displayName} />} variant={variant}>\n <Grid container spacing={3} alignItems=\"flex-start\">\n <Grid item xs={12} sm={2} xl={1}>\n <Avatar displayName={displayName} picture={profile?.picture} />\n </Grid>\n\n <Grid item md={10} xl={11}>\n <List>\n {profile?.email && (\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Email\">\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref ?? ''}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Member of\">\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={memberOfRelations}\n defaultKind=\"Group\"\n />\n </ListItemText>\n </ListItem>\n </List>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, UserEntity } from '@backstage/catalog-model';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n catalogRouteRef,\n formatEntityRefTitle,\n isOwnerOf,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport {\n Box,\n createStyles,\n Grid,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport qs from 'qs';\nimport React from 'react';\nimport pluralize from 'pluralize';\nimport useAsync from 'react-use/lib/useAsync';\n\ntype EntityTypeProps = {\n kind: string;\n type: string;\n count: number;\n};\n\nconst useStyles = makeStyles((theme: BackstageTheme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n padding: theme.spacing(2),\n color: '#fff',\n transition: `${theme.transitions.duration.standard}ms`,\n '&:hover': {\n boxShadow: theme.shadows[4],\n },\n },\n bold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n entityTypeBox: {\n background: (props: { type: string }) =>\n theme.getPageTheme({ themeId: props.type }).backgroundImage,\n },\n }),\n);\n\nconst EntityCountTile = ({\n counter,\n type,\n name,\n url,\n}: {\n counter: number;\n type: string;\n name: string;\n url: string;\n}) => {\n const classes = useStyles({ type });\n\n return (\n <Link to={url} variant=\"body2\">\n <Box\n className={`${classes.card} ${classes.entityTypeBox}`}\n display=\"flex\"\n flexDirection=\"column\"\n alignItems=\"center\"\n >\n <Typography className={classes.bold} variant=\"h6\">\n {counter}\n </Typography>\n <Typography className={classes.bold} variant=\"h6\">\n {pluralize(name, counter)}\n </Typography>\n </Box>\n </Link>\n );\n};\n\nconst getQueryParams = (\n owner: Entity,\n selectedEntity: EntityTypeProps,\n): string => {\n const ownerName = formatEntityRefTitle(owner, { defaultKind: 'group' });\n const { kind, type } = selectedEntity;\n const filters = {\n kind,\n type,\n owners: [ownerName],\n user: 'all',\n };\n if (owner.kind === 'User') {\n const user = owner as UserEntity;\n filters.owners = [...filters.owners, ...user.spec.memberOf];\n }\n const queryParams = qs.stringify({\n filters,\n });\n\n return queryParams;\n};\n\nexport const OwnershipCard = ({\n variant,\n entityFilterKind,\n}: {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: InfoCardVariants;\n entityFilterKind?: string[];\n}) => {\n const { entity } = useEntity();\n const catalogApi = useApi(catalogApiRef);\n const catalogLink = useRouteRef(catalogRouteRef);\n\n const {\n loading,\n error,\n value: componentsWithCounters,\n } = useAsync(async () => {\n const kinds = entityFilterKind ?? ['Component', 'API'];\n const entitiesList = await catalogApi.getEntities({\n filter: {\n kind: kinds,\n },\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'spec.type',\n 'relations',\n ],\n });\n\n const ownedEntitiesList = entitiesList.items.filter(component =>\n isOwnerOf(entity, component),\n );\n\n const counts = ownedEntitiesList.reduce(\n (acc: EntityTypeProps[], ownedEntity) => {\n const match = acc.find(\n x =>\n x.kind === ownedEntity.kind &&\n x.type === (ownedEntity.spec?.type ?? ownedEntity.kind),\n );\n if (match) {\n match.count += 1;\n } else {\n acc.push({\n kind: ownedEntity.kind,\n type: ownedEntity.spec?.type?.toString() ?? ownedEntity.kind,\n count: 1,\n });\n }\n return acc;\n },\n [],\n );\n\n // Return top N (six) entities to be displayed in ownership boxes\n const topN = counts.sort((a, b) => b.count - a.count).slice(0, 6);\n\n return topN.map(topOwnedEntity => ({\n counter: topOwnedEntity.count,\n type: topOwnedEntity.type,\n name: topOwnedEntity.type.toLocaleUpperCase('en-US'),\n queryParams: getQueryParams(entity, topOwnedEntity),\n })) as Array<{\n counter: number;\n type: string;\n name: string;\n queryParams: string;\n }>;\n }, [catalogApi, entity]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <InfoCard title=\"Ownership\" variant={variant}>\n <Grid container>\n {componentsWithCounters?.map(c => (\n <Grid item xs={6} md={6} lg={4} key={c.name}>\n <EntityCountTile\n counter={c.counter}\n type={c.type}\n name={c.name}\n url={`${catalogLink()}/?${c.queryParams}`}\n />\n </Grid>\n ))}\n </Grid>\n </InfoCard>\n );\n};\n"],"names":["useStyles","CardTitle"],"mappings":";;;;;;;;;;;;;;;;;;MAoBa,YAAY,aAAa;AAAA,EACpC,IAAI;AAAA;MAGO,yBAAyB,UAAU,QAC9C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,wBAAwB,UAAU,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,sBAAsB,UAAU,QAC3C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;MAIxC,wBAAwB,UAAU,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAAgB,KAAK,OAAK,EAAE;AAAA;AAAA;;ACJrD,MAAMA,cAAY,WAAW,CAAC,UAC5B,aAAa;AAAA,EACX,MAAM;AAAA,IACJ,QAAQ,aAAa,MAAM,QAAQ;AAAA,IACnC,W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@@
1
1
  {
2
2
  "name": "@backstage/plugin-org",
3
3
  "description": "A Backstage plugin that helps you create entity pages for your organization",
4
- "version": "0.3.33",
4
+ "version": "0.3.34",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -21,10 +21,10 @@
21
21
  "clean": "backstage-cli clean"
22
22
  },
23
23
  "dependencies": {
24
- "@backstage/catalog-model": "^0.9.8",
25
- "@backstage/core-components": "^0.8.3",
26
- "@backstage/core-plugin-api": "^0.4.1",
27
- "@backstage/plugin-catalog-react": "^0.6.10",
24
+ "@backstage/catalog-model": "^0.9.9",
25
+ "@backstage/core-components": "^0.8.4",
26
+ "@backstage/core-plugin-api": "^0.5.0",
27
+ "@backstage/plugin-catalog-react": "^0.6.11",
28
28
  "@backstage/theme": "^0.2.14",
29
29
  "@material-ui/core": "^4.12.2",
30
30
  "@material-ui/icons": "^4.9.1",
@@ -39,11 +39,11 @@
39
39
  "react": "^16.13.1 || ^17.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@backstage/catalog-client": "^0.5.3",
43
- "@backstage/cli": "^0.10.5",
44
- "@backstage/core-app-api": "^0.3.1",
45
- "@backstage/dev-utils": "^0.2.16",
46
- "@backstage/test-utils": "^0.2.1",
42
+ "@backstage/catalog-client": "^0.5.4",
43
+ "@backstage/cli": "^0.11.0",
44
+ "@backstage/core-app-api": "^0.4.0",
45
+ "@backstage/dev-utils": "^0.2.17",
46
+ "@backstage/test-utils": "^0.2.2",
47
47
  "@testing-library/jest-dom": "^5.10.1",
48
48
  "@testing-library/react": "^11.2.5",
49
49
  "@testing-library/user-event": "^13.1.8",
@@ -55,5 +55,5 @@
55
55
  "files": [
56
56
  "dist"
57
57
  ],
58
- "gitHead": "ffdb98aa2973366d48ff1774a7f892bc0c926e7e"
58
+ "gitHead": "da66c61bdd63cdb3f0f0cd2e26dc9e6454d93c7b"
59
59
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-2edd98a9.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}