@backstage/plugin-org 0.4.2-next.0 → 0.5.0

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,44 @@
1
1
  # @backstage/plugin-org
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2262fe19c9: **BREAKING**: Removed support for passing in an explicit `entity` prop to entity page extensions, which has been deprecated for a long time. This is only a breaking change at the TypeScript level, as this property was already ignored.
8
+
9
+ ### Patch Changes
10
+
11
+ - cd8c6970ed: Add entity sync button to Group page
12
+ - 919cf2f836: Minor updates to match the new `targetRef` field of relations, and to stop consuming the `target` field
13
+ - Updated dependencies
14
+ - @backstage/core-components@0.8.10
15
+ - @backstage/plugin-catalog-react@0.7.0
16
+ - @backstage/catalog-model@0.11.0
17
+ - @backstage/core-plugin-api@0.7.0
18
+
19
+ ## 0.4.3
20
+
21
+ ### Patch Changes
22
+
23
+ - 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
24
+ - c77c5c7eb6: Added `backstage.role` to `package.json`
25
+ - 538ca90790: Use updated type names from `@backstage/catalog-client`
26
+ - 7aeb491394: Replace use of deprecated `ENTITY_DEFAULT_NAMESPACE` constant with `DEFAULT_NAMESPACE`.
27
+ - Updated dependencies
28
+ - @backstage/core-components@0.8.9
29
+ - @backstage/core-plugin-api@0.6.1
30
+ - @backstage/plugin-catalog-react@0.6.15
31
+ - @backstage/catalog-model@0.10.0
32
+ - @backstage/theme@0.2.15
33
+
34
+ ## 0.4.2
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies
39
+ - @backstage/core-components@0.8.8
40
+ - @backstage/plugin-catalog-react@0.6.14
41
+
3
42
  ## 0.4.2-next.0
4
43
 
5
44
  ### Patch Changes
@@ -12,8 +12,9 @@ import '@material-ui/icons/AccountTree';
12
12
  import '@material-ui/icons/Email';
13
13
  import '@material-ui/icons/Group';
14
14
  import '@material-ui/icons/Edit';
15
+ import '@material-ui/icons/Cached';
15
16
  import '@material-ui/lab/Alert';
16
17
  import '@material-ui/icons/Person';
17
18
  import 'qs';
18
19
  import 'pluralize';
19
- //# sourceMappingURL=index-51e4b009.esm.js.map
20
+ //# sourceMappingURL=index-e7876693.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-e7876693.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,54 +1,40 @@
1
1
  /// <reference types="react" />
2
2
  import * as _backstage_core_components from '@backstage/core-components';
3
3
  import { InfoCardVariants } from '@backstage/core-components';
4
- import * as _backstage_catalog_model from '@backstage/catalog-model';
5
- import { GroupEntity, UserEntity, Entity } from '@backstage/catalog-model';
6
4
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
7
5
 
8
6
  declare const orgPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {
9
7
  catalogIndex: _backstage_core_plugin_api.ExternalRouteRef<undefined, false>;
10
8
  }>;
11
9
  declare const EntityGroupProfileCard: ({ variant, }: {
12
- entity?: _backstage_catalog_model.GroupEntity | undefined;
13
10
  variant?: _backstage_core_components.InfoCardVariants | undefined;
14
11
  }) => JSX.Element;
15
12
  declare const EntityMembersListCard: (_props: {
16
- entity?: _backstage_catalog_model.GroupEntity | undefined;
17
13
  memberDisplayTitle?: string | undefined;
18
14
  pageSize?: number | undefined;
19
15
  }) => JSX.Element;
20
16
  declare const EntityOwnershipCard: ({ variant, entityFilterKind, }: {
21
- entity?: _backstage_catalog_model.Entity | undefined;
22
17
  variant?: _backstage_core_components.InfoCardVariants | undefined;
23
18
  entityFilterKind?: string[] | undefined;
24
19
  }) => JSX.Element;
25
20
  declare const EntityUserProfileCard: ({ variant, }: {
26
- entity?: _backstage_catalog_model.UserEntity | undefined;
27
21
  variant?: _backstage_core_components.InfoCardVariants | undefined;
28
22
  }) => JSX.Element;
29
23
 
30
24
  declare const MembersListCard: (_props: {
31
- /** @deprecated The entity is now grabbed from context instead */
32
- entity?: GroupEntity;
33
25
  memberDisplayTitle?: string;
34
26
  pageSize?: number;
35
27
  }) => JSX.Element;
36
28
 
37
29
  declare const GroupProfileCard: ({ variant, }: {
38
- /** @deprecated The entity is now grabbed from context instead */
39
- entity?: GroupEntity | undefined;
40
30
  variant?: InfoCardVariants | undefined;
41
31
  }) => JSX.Element;
42
32
 
43
33
  declare const UserProfileCard: ({ variant, }: {
44
- /** @deprecated The entity is now grabbed from context instead */
45
- entity?: UserEntity | undefined;
46
34
  variant?: InfoCardVariants | undefined;
47
35
  }) => JSX.Element;
48
36
 
49
37
  declare const OwnershipCard: ({ variant, entityFilterKind, }: {
50
- /** @deprecated The entity is now grabbed from context instead */
51
- entity?: Entity | undefined;
52
38
  variant?: InfoCardVariants | undefined;
53
39
  entityFilterKind?: string[] | undefined;
54
40
  }) => JSX.Element;
package/dist/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
- import { createExternalRouteRef, createPlugin, createComponentExtension, useApi, useRouteRef } from '@backstage/core-plugin-api';
2
- import { stringifyEntityRef, ENTITY_DEFAULT_NAMESPACE, RELATION_PARENT_OF, RELATION_CHILD_OF, RELATION_MEMBER_OF } from '@backstage/catalog-model';
1
+ import { createExternalRouteRef, createPlugin, createComponentExtension, useApi, alertApiRef, useRouteRef } from '@backstage/core-plugin-api';
2
+ import { stringifyEntityRef, DEFAULT_NAMESPACE, RELATION_PARENT_OF, RELATION_CHILD_OF, ANNOTATION_LOCATION, RELATION_MEMBER_OF } from '@backstage/catalog-model';
3
3
  import { useEntity, catalogApiRef, entityRouteParams, getEntityRelations, getEntityMetadataEditUrl, EntityRefLinks, isOwnerOf, formatEntityRefTitle } from '@backstage/plugin-catalog-react';
4
- import { makeStyles, createStyles, Grid, Box, Typography, List, ListItem, ListItemIcon, Tooltip, ListItemText, IconButton } from '@material-ui/core';
4
+ import { makeStyles, createStyles, Grid, Box, Typography, IconButton, List, ListItem, ListItemIcon, Tooltip, ListItemText } from '@material-ui/core';
5
5
  import Pagination from '@material-ui/lab/Pagination';
6
- import React from 'react';
6
+ import React, { useCallback } from 'react';
7
7
  import { generatePath } from 'react-router-dom';
8
8
  import useAsync from 'react-use/lib/useAsync';
9
9
  import { Progress, ResponseErrorPanel, InfoCard, Avatar, Link } from '@backstage/core-components';
@@ -11,6 +11,7 @@ import AccountTreeIcon from '@material-ui/icons/AccountTree';
11
11
  import EmailIcon from '@material-ui/icons/Email';
12
12
  import GroupIcon from '@material-ui/icons/Group';
13
13
  import EditIcon from '@material-ui/icons/Edit';
14
+ import CachedIcon from '@material-ui/icons/Cached';
14
15
  import Alert from '@material-ui/lab/Alert';
15
16
  import PersonIcon from '@material-ui/icons/Person';
16
17
  import qs from 'qs';
@@ -29,25 +30,25 @@ const orgPlugin = createPlugin({
29
30
  const EntityGroupProfileCard = orgPlugin.provide(createComponentExtension({
30
31
  name: "EntityGroupProfileCard",
31
32
  component: {
32
- lazy: () => import('./esm/index-51e4b009.esm.js').then((m) => m.GroupProfileCard)
33
+ lazy: () => import('./esm/index-e7876693.esm.js').then((m) => m.GroupProfileCard)
33
34
  }
34
35
  }));
35
36
  const EntityMembersListCard = orgPlugin.provide(createComponentExtension({
36
37
  name: "EntityMembersListCard",
37
38
  component: {
38
- lazy: () => import('./esm/index-51e4b009.esm.js').then((m) => m.MembersListCard)
39
+ lazy: () => import('./esm/index-e7876693.esm.js').then((m) => m.MembersListCard)
39
40
  }
40
41
  }));
41
42
  const EntityOwnershipCard = orgPlugin.provide(createComponentExtension({
42
43
  name: "EntityOwnershipCard",
43
44
  component: {
44
- lazy: () => import('./esm/index-51e4b009.esm.js').then((m) => m.OwnershipCard)
45
+ lazy: () => import('./esm/index-e7876693.esm.js').then((m) => m.OwnershipCard)
45
46
  }
46
47
  }));
47
48
  const EntityUserProfileCard = orgPlugin.provide(createComponentExtension({
48
49
  name: "EntityUserProfileCard",
49
50
  component: {
50
- lazy: () => import('./esm/index-51e4b009.esm.js').then((m) => m.UserProfileCard)
51
+ lazy: () => import('./esm/index-e7876693.esm.js').then((m) => m.UserProfileCard)
51
52
  }
52
53
  }));
53
54
 
@@ -114,7 +115,7 @@ const MembersListCard = (_props) => {
114
115
  } = groupEntity;
115
116
  const catalogApi = useApi(catalogApiRef);
116
117
  const displayName = (_a = profile == null ? void 0 : profile.displayName) != null ? _a : groupName;
117
- const groupNamespace = grpNamespace || ENTITY_DEFAULT_NAMESPACE;
118
+ const groupNamespace = grpNamespace || DEFAULT_NAMESPACE;
118
119
  const [page, setPage] = React.useState(1);
119
120
  const pageChange = (_, pageIndex) => {
120
121
  setPage(pageIndex);
@@ -185,14 +186,20 @@ const GroupProfileCard = ({
185
186
  variant
186
187
  }) => {
187
188
  var _a;
189
+ const catalogApi = useApi(catalogApiRef);
190
+ const alertApi = useApi(alertApiRef);
188
191
  const { entity: group } = useEntity();
192
+ const refreshEntity = useCallback(async () => {
193
+ await catalogApi.refreshEntity(stringifyEntityRef(group));
194
+ alertApi.post({ message: "Refresh scheduled", severity: "info" });
195
+ }, [catalogApi, alertApi, group]);
189
196
  if (!group) {
190
197
  return /* @__PURE__ */ React.createElement(Alert, {
191
198
  severity: "error"
192
199
  }, "Group not found");
193
200
  }
194
201
  const {
195
- metadata: { name, description },
202
+ metadata: { name, description, annotations },
196
203
  spec: { profile }
197
204
  } = group;
198
205
  const childRelations = getEntityRelations(group, RELATION_PARENT_OF, {
@@ -201,6 +208,8 @@ const GroupProfileCard = ({
201
208
  const parentRelations = getEntityRelations(group, RELATION_CHILD_OF, {
202
209
  kind: "group"
203
210
  });
211
+ const entityLocation = annotations == null ? void 0 : annotations[ANNOTATION_LOCATION];
212
+ const allowRefresh = (entityLocation == null ? void 0 : entityLocation.startsWith("url:")) || (entityLocation == null ? void 0 : entityLocation.startsWith("file:"));
204
213
  const entityMetadataEditUrl = getEntityMetadataEditUrl(group);
205
214
  const displayName = (_a = profile == null ? void 0 : profile.displayName) != null ? _a : name;
206
215
  const emailHref = (profile == null ? void 0 : profile.email) ? `mailto:${profile.email}` : "#";
@@ -220,7 +229,11 @@ const GroupProfileCard = ({
220
229
  }),
221
230
  subheader: description,
222
231
  variant,
223
- action: infoCardAction
232
+ action: /* @__PURE__ */ React.createElement(React.Fragment, null, allowRefresh && /* @__PURE__ */ React.createElement(IconButton, {
233
+ "aria-label": "Refresh",
234
+ title: "Schedule entity refresh",
235
+ onClick: refreshEntity
236
+ }, /* @__PURE__ */ React.createElement(CachedIcon, null)), infoCardAction)
224
237
  }, /* @__PURE__ */ React.createElement(Grid, {
225
238
  container: true,
226
239
  spacing: 3
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/routes.ts","../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 */\n\nimport { createExternalRouteRef } from '@backstage/core-plugin-api';\n\nexport const catalogIndexRouteRef = createExternalRouteRef({\n id: 'catalog-index',\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 createComponentExtension,\n createPlugin,\n} from '@backstage/core-plugin-api';\nimport { catalogIndexRouteRef } from './routes';\n\nexport const orgPlugin = createPlugin({\n id: 'org',\n externalRoutes: {\n catalogIndex: catalogIndexRouteRef,\n },\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 UserEntity,\n stringifyEntityRef,\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 pageSize?: number;\n}) => {\n const { entity: groupEntity } = useEntity<GroupEntity>();\n let { memberDisplayTitle, pageSize } = _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 pageSize = pageSize ? 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: {\n kind: 'User',\n 'relations.memberof': [\n stringifyEntityRef({\n kind: 'group',\n namespace: groupNamespace.toLocaleLowerCase('en-US'),\n name: groupName.toLocaleLowerCase('en-US'),\n }),\n ],\n },\n });\n\n return membersList.items as UserEntity[];\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, description },\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\n title={<CardTitle title={displayName} />}\n subheader={description}\n variant={variant}\n >\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 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';\nimport { catalogIndexRouteRef } from '../../../routes';\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(catalogIndexRouteRef);\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":";;;;;;;;;;;;;;;;;;MAkBa,uBAAuB,uBAAuB;AAAA,EACzD,IAAI;AAAA;;MCEO,YAAY,aAAa;AAAA,EACpC,IAAI;AAAA,EACJ,gBAAgB;AAAA,IACd,cAAc;AAAA;AAAA;MAIL,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;;ACRrD,MAAMA,cAAY,WAAW,CAAC,UAC5B,aAA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"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/routes.ts","../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 */\n\nimport { createExternalRouteRef } from '@backstage/core-plugin-api';\n\nexport const catalogIndexRouteRef = createExternalRouteRef({\n id: 'catalog-index',\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 createComponentExtension,\n createPlugin,\n} from '@backstage/core-plugin-api';\nimport { catalogIndexRouteRef } from './routes';\n\nexport const orgPlugin = createPlugin({\n id: 'org',\n externalRoutes: {\n catalogIndex: catalogIndexRouteRef,\n },\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 DEFAULT_NAMESPACE,\n GroupEntity,\n UserEntity,\n stringifyEntityRef,\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 memberDisplayTitle?: string;\n pageSize?: number;\n}) => {\n const { entity: groupEntity } = useEntity<GroupEntity>();\n let { memberDisplayTitle, pageSize } = _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 || DEFAULT_NAMESPACE;\n\n const [page, setPage] = React.useState(1);\n const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {\n setPage(pageIndex);\n };\n pageSize = pageSize ? 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: {\n kind: 'User',\n 'relations.memberof': [\n stringifyEntityRef({\n kind: 'group',\n namespace: groupNamespace.toLocaleLowerCase('en-US'),\n name: groupName.toLocaleLowerCase('en-US'),\n }),\n ],\n },\n });\n\n return membersList.items as UserEntity[];\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 ANNOTATION_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n catalogApiRef,\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 CachedIcon from '@material-ui/icons/Cached';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useCallback } from 'react';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\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 variant?: InfoCardVariants;\n}) => {\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const { entity: group } = useEntity<GroupEntity>();\n\n const refreshEntity = useCallback(async () => {\n await catalogApi.refreshEntity(stringifyEntityRef(group));\n alertApi.post({ message: 'Refresh scheduled', severity: 'info' });\n }, [catalogApi, alertApi, group]);\n\n if (!group) {\n return <Alert severity=\"error\">Group not found</Alert>;\n }\n\n const {\n metadata: { name, description, annotations },\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 entityLocation = annotations?.[ANNOTATION_LOCATION];\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\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={\n <>\n {allowRefresh && (\n <IconButton\n aria-label=\"Refresh\"\n title=\"Schedule entity refresh\"\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n {infoCardAction}\n </>\n }\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 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, description },\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\n title={<CardTitle title={displayName} />}\n subheader={description}\n variant={variant}\n >\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 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';\nimport { catalogIndexRouteRef } from '../../../routes';\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 variant?: InfoCardVariants;\n entityFilterKind?: string[];\n}) => {\n const { entity } = useEntity();\n const catalogApi = useApi(catalogApiRef);\n const catalogLink = useRouteRef(catalogIndexRouteRef);\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":";;;;;;;;;;;;;;;;;;;MAkBa,uBAAuB,uBAAuB;AAAA,EACzD,IAAI;AAAA;;MCEO,YAAY,aAAa;AAAA,EACpC,IAAI;AAAA,EACJ,gBAAgB;AAAA,IACd,cAAc;AAAA;AAAA;MAIL,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;;ACRrD,MAAMA,cAAY,WAAW,CAAC,UAC5B,aAAa;AAAA,EACX,MAAM;AAAA,IACJ,QAAQ,aAAa,MAAM,QAAQ;AAAA,IACnC,WAAW,M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AAS;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;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.4.2-next.0",
4
+ "version": "0.5.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -10,22 +10,25 @@
10
10
  "main": "dist/index.esm.js",
11
11
  "types": "dist/index.d.ts"
12
12
  },
13
+ "backstage": {
14
+ "role": "frontend-plugin"
15
+ },
13
16
  "scripts": {
14
- "build": "backstage-cli plugin:build",
15
- "start": "backstage-cli plugin:serve",
16
- "lint": "backstage-cli lint",
17
- "test": "backstage-cli test",
17
+ "build": "backstage-cli package build",
18
+ "start": "backstage-cli package start",
19
+ "lint": "backstage-cli package lint",
20
+ "test": "backstage-cli package test",
18
21
  "diff": "backstage-cli plugin:diff",
19
- "prepack": "backstage-cli prepack",
20
- "postpack": "backstage-cli postpack",
21
- "clean": "backstage-cli clean"
22
+ "prepack": "backstage-cli package prepack",
23
+ "postpack": "backstage-cli package postpack",
24
+ "clean": "backstage-cli package clean"
22
25
  },
23
26
  "dependencies": {
24
- "@backstage/catalog-model": "^0.9.10",
25
- "@backstage/core-components": "^0.8.8-next.0",
26
- "@backstage/core-plugin-api": "^0.6.0",
27
- "@backstage/plugin-catalog-react": "^0.6.14-next.0",
28
- "@backstage/theme": "^0.2.14",
27
+ "@backstage/catalog-model": "^0.11.0",
28
+ "@backstage/core-components": "^0.8.10",
29
+ "@backstage/core-plugin-api": "^0.7.0",
30
+ "@backstage/plugin-catalog-react": "^0.7.0",
31
+ "@backstage/theme": "^0.2.15",
29
32
  "@material-ui/core": "^4.12.2",
30
33
  "@material-ui/icons": "^4.9.1",
31
34
  "@material-ui/lab": "4.0.0-alpha.57",
@@ -39,21 +42,21 @@
39
42
  "react": "^16.13.1 || ^17.0.0"
40
43
  },
41
44
  "devDependencies": {
42
- "@backstage/catalog-client": "^0.5.5",
43
- "@backstage/cli": "^0.13.2-next.0",
44
- "@backstage/core-app-api": "^0.5.2",
45
- "@backstage/dev-utils": "^0.2.21-next.0",
46
- "@backstage/test-utils": "^0.2.4",
45
+ "@backstage/catalog-client": "^0.7.2",
46
+ "@backstage/cli": "^0.14.1",
47
+ "@backstage/core-app-api": "^0.5.4",
48
+ "@backstage/dev-utils": "^0.2.23",
49
+ "@backstage/test-utils": "^0.2.6",
47
50
  "@testing-library/jest-dom": "^5.10.1",
48
51
  "@testing-library/react": "^11.2.5",
49
52
  "@testing-library/user-event": "^13.1.8",
50
53
  "@types/jest": "^26.0.7",
51
54
  "@types/node": "^14.14.32",
52
- "cross-fetch": "^3.0.6",
55
+ "cross-fetch": "^3.1.5",
53
56
  "msw": "^0.35.0"
54
57
  },
55
58
  "files": [
56
59
  "dist"
57
60
  ],
58
- "gitHead": "e6f167225d843beeb974c287c3364d951b587626"
61
+ "gitHead": "a15da6ea1e3e8adc37be98be064071c8b5279b4a"
59
62
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-51e4b009.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}