@backstage/plugin-org 0.6.20-next.1 → 0.6.20-next.3
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 +28 -0
- package/alpha/package.json +7 -0
- package/dist/alpha.d.ts +8 -0
- package/dist/alpha.esm.js +50 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/esm/GroupProfileCard-d9207fd9.esm.js +114 -0
- package/dist/esm/GroupProfileCard-d9207fd9.esm.js.map +1 -0
- package/dist/esm/LinksGroup-9fefd100.esm.js +35 -0
- package/dist/esm/LinksGroup-9fefd100.esm.js.map +1 -0
- package/dist/esm/MembersListCard-cb148b44.esm.js +258 -0
- package/dist/esm/MembersListCard-cb148b44.esm.js.map +1 -0
- package/dist/esm/OwnershipCard-9f8835e6.esm.js +325 -0
- package/dist/esm/OwnershipCard-9f8835e6.esm.js.map +1 -0
- package/dist/esm/UserProfileCard-d467b6e5.esm.js +60 -0
- package/dist/esm/UserProfileCard-d467b6e5.esm.js.map +1 -0
- package/dist/esm/{index-9172d7e6.esm.js → index-ad2d9b29.esm.js} +9 -3
- package/dist/esm/index-ad2d9b29.esm.js.map +1 -0
- package/dist/esm/routes-e3daad75.esm.js +8 -0
- package/dist/esm/routes-e3daad75.esm.js.map +1 -0
- package/dist/index.esm.js +32 -753
- package/dist/index.esm.js.map +1 -1
- package/package.json +31 -17
- package/dist/esm/index-9172d7e6.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage/plugin-org
|
|
2
2
|
|
|
3
|
+
## 0.6.20-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/core-components@0.14.0-next.2
|
|
9
|
+
- @backstage/plugin-catalog-react@1.10.0-next.3
|
|
10
|
+
- @backstage/catalog-model@1.4.4-next.0
|
|
11
|
+
- @backstage/core-compat-api@0.2.0-next.3
|
|
12
|
+
- @backstage/core-plugin-api@1.9.0-next.1
|
|
13
|
+
- @backstage/frontend-plugin-api@0.6.0-next.3
|
|
14
|
+
- @backstage/plugin-catalog-common@1.0.21-next.0
|
|
15
|
+
|
|
16
|
+
## 0.6.20-next.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 8fe56a8: Widen `@types/react` dependency range to include version 18.
|
|
21
|
+
- 6e1bf50: Added basic support for the new frontend system, exported from the `/alpha` subpath.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/core-components@0.14.0-next.1
|
|
24
|
+
- @backstage/core-plugin-api@1.9.0-next.1
|
|
25
|
+
- @backstage/frontend-plugin-api@0.6.0-next.2
|
|
26
|
+
- @backstage/plugin-catalog-react@1.10.0-next.2
|
|
27
|
+
- @backstage/core-compat-api@0.2.0-next.2
|
|
28
|
+
- @backstage/catalog-model@1.4.4-next.0
|
|
29
|
+
- @backstage/plugin-catalog-common@1.0.21-next.0
|
|
30
|
+
|
|
3
31
|
## 0.6.20-next.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/** @alpha */
|
|
4
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<{}, {
|
|
5
|
+
catalogIndex: _backstage_frontend_plugin_api.ExternalRouteRef<undefined, false>;
|
|
6
|
+
}>;
|
|
7
|
+
|
|
8
|
+
export { _default as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { compatWrapper, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
2
|
+
import { createPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { c as catalogIndexRouteRef } from './esm/routes-e3daad75.esm.js';
|
|
5
|
+
import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';
|
|
6
|
+
import '@backstage/core-plugin-api';
|
|
7
|
+
|
|
8
|
+
const EntityGroupProfileCard = createEntityCardExtension({
|
|
9
|
+
name: "group-profile",
|
|
10
|
+
filter: "kind:group",
|
|
11
|
+
loader: async () => import('./esm/GroupProfileCard-d9207fd9.esm.js').then(
|
|
12
|
+
(m) => compatWrapper(/* @__PURE__ */ React.createElement(m.GroupProfileCard, null))
|
|
13
|
+
)
|
|
14
|
+
});
|
|
15
|
+
const EntityMembersListCard = createEntityCardExtension({
|
|
16
|
+
name: "members-list",
|
|
17
|
+
filter: "kind:group",
|
|
18
|
+
loader: async () => import('./esm/MembersListCard-cb148b44.esm.js').then(
|
|
19
|
+
(m) => compatWrapper(/* @__PURE__ */ React.createElement(m.MembersListCard, null))
|
|
20
|
+
)
|
|
21
|
+
});
|
|
22
|
+
const EntityOwnershipCard = createEntityCardExtension({
|
|
23
|
+
name: "ownership",
|
|
24
|
+
filter: "kind:group,user",
|
|
25
|
+
loader: async () => import('./esm/OwnershipCard-9f8835e6.esm.js').then(
|
|
26
|
+
(m) => compatWrapper(/* @__PURE__ */ React.createElement(m.OwnershipCard, null))
|
|
27
|
+
)
|
|
28
|
+
});
|
|
29
|
+
const EntityUserProfileCard = createEntityCardExtension({
|
|
30
|
+
name: "user-profile",
|
|
31
|
+
filter: "kind:user",
|
|
32
|
+
loader: async () => import('./esm/UserProfileCard-d467b6e5.esm.js').then(
|
|
33
|
+
(m) => compatWrapper(/* @__PURE__ */ React.createElement(m.UserProfileCard, null))
|
|
34
|
+
)
|
|
35
|
+
});
|
|
36
|
+
var alpha = createPlugin({
|
|
37
|
+
id: "org",
|
|
38
|
+
extensions: [
|
|
39
|
+
EntityGroupProfileCard,
|
|
40
|
+
EntityMembersListCard,
|
|
41
|
+
EntityOwnershipCard,
|
|
42
|
+
EntityUserProfileCard
|
|
43
|
+
],
|
|
44
|
+
externalRoutes: convertLegacyRouteRefs({
|
|
45
|
+
catalogIndex: catalogIndexRouteRef
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { alpha as default };
|
|
50
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 compatWrapper,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport { createPlugin } from '@backstage/frontend-plugin-api';\nimport React from 'react';\nimport { catalogIndexRouteRef } from './routes';\nimport { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';\n\n/** @alpha */\nconst EntityGroupProfileCard = createEntityCardExtension({\n name: 'group-profile',\n filter: 'kind:group',\n loader: async () =>\n import('./components/Cards/Group/GroupProfile/GroupProfileCard').then(m =>\n compatWrapper(<m.GroupProfileCard />),\n ),\n});\n\n/** @alpha */\nconst EntityMembersListCard = createEntityCardExtension({\n name: 'members-list',\n filter: 'kind:group',\n loader: async () =>\n import('./components/Cards/Group/MembersList/MembersListCard').then(m =>\n compatWrapper(<m.MembersListCard />),\n ),\n});\n\n/** @alpha */\nconst EntityOwnershipCard = createEntityCardExtension({\n name: 'ownership',\n filter: 'kind:group,user',\n loader: async () =>\n import('./components/Cards/OwnershipCard/OwnershipCard').then(m =>\n compatWrapper(<m.OwnershipCard />),\n ),\n});\n\n/** @alpha */\nconst EntityUserProfileCard = createEntityCardExtension({\n name: 'user-profile',\n filter: 'kind:user',\n loader: async () =>\n import('./components/Cards/User/UserProfileCard/UserProfileCard').then(m =>\n compatWrapper(<m.UserProfileCard />),\n ),\n});\n\n/** @alpha */\nexport default createPlugin({\n id: 'org',\n extensions: [\n EntityGroupProfileCard,\n EntityMembersListCard,\n EntityOwnershipCard,\n EntityUserProfileCard,\n ],\n externalRoutes: convertLegacyRouteRefs({\n catalogIndex: catalogIndexRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;AA0BA,MAAM,yBAAyB,yBAA0B,CAAA;AAAA,EACvD,IAAM,EAAA,eAAA;AAAA,EACN,MAAQ,EAAA,YAAA;AAAA,EACR,MAAQ,EAAA,YACN,OAAO,wCAAwD,CAAE,CAAA,IAAA;AAAA,IAAK,OACpE,aAAc,iBAAA,KAAA,CAAA,aAAA,CAAC,CAAE,CAAA,gBAAA,EAAF,IAAmB,CAAE,CAAA;AAAA,GACtC;AACJ,CAAC,CAAA,CAAA;AAGD,MAAM,wBAAwB,yBAA0B,CAAA;AAAA,EACtD,IAAM,EAAA,cAAA;AAAA,EACN,MAAQ,EAAA,YAAA;AAAA,EACR,MAAQ,EAAA,YACN,OAAO,uCAAsD,CAAE,CAAA,IAAA;AAAA,IAAK,OAClE,aAAc,iBAAA,KAAA,CAAA,aAAA,CAAC,CAAE,CAAA,eAAA,EAAF,IAAkB,CAAE,CAAA;AAAA,GACrC;AACJ,CAAC,CAAA,CAAA;AAGD,MAAM,sBAAsB,yBAA0B,CAAA;AAAA,EACpD,IAAM,EAAA,WAAA;AAAA,EACN,MAAQ,EAAA,iBAAA;AAAA,EACR,MAAQ,EAAA,YACN,OAAO,qCAAgD,CAAE,CAAA,IAAA;AAAA,IAAK,OAC5D,aAAc,iBAAA,KAAA,CAAA,aAAA,CAAC,CAAE,CAAA,aAAA,EAAF,IAAgB,CAAE,CAAA;AAAA,GACnC;AACJ,CAAC,CAAA,CAAA;AAGD,MAAM,wBAAwB,yBAA0B,CAAA;AAAA,EACtD,IAAM,EAAA,cAAA;AAAA,EACN,MAAQ,EAAA,WAAA;AAAA,EACR,MAAQ,EAAA,YACN,OAAO,uCAAyD,CAAE,CAAA,IAAA;AAAA,IAAK,OACrE,aAAc,iBAAA,KAAA,CAAA,aAAA,CAAC,CAAE,CAAA,eAAA,EAAF,IAAkB,CAAE,CAAA;AAAA,GACrC;AACJ,CAAC,CAAA,CAAA;AAGD,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,KAAA;AAAA,EACJ,UAAY,EAAA;AAAA,IACV,sBAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,GACF;AAAA,EACA,gBAAgB,sBAAuB,CAAA;AAAA,IACrC,YAAc,EAAA,oBAAA;AAAA,GACf,CAAA;AACH,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { stringifyEntityRef, RELATION_PARENT_OF, RELATION_CHILD_OF, ANNOTATION_LOCATION, ANNOTATION_EDIT_URL } from '@backstage/catalog-model';
|
|
2
|
+
import { InfoCard, Avatar, Link } from '@backstage/core-components';
|
|
3
|
+
import { IconButton, Grid, List, ListItem, ListItemIcon, Tooltip, ListItemText, Box } from '@material-ui/core';
|
|
4
|
+
import { catalogApiRef, useEntity, getEntityRelations, EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
7
|
+
import AccountTreeIcon from '@material-ui/icons/AccountTree';
|
|
8
|
+
import Alert from '@material-ui/lab/Alert';
|
|
9
|
+
import CachedIcon from '@material-ui/icons/Cached';
|
|
10
|
+
import EditIcon from '@material-ui/icons/Edit';
|
|
11
|
+
import EmailIcon from '@material-ui/icons/Email';
|
|
12
|
+
import GroupIcon from '@material-ui/icons/Group';
|
|
13
|
+
import { L as LinksGroup } from './LinksGroup-9fefd100.esm.js';
|
|
14
|
+
import { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';
|
|
15
|
+
import { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';
|
|
16
|
+
import '@material-ui/icons/Language';
|
|
17
|
+
|
|
18
|
+
const CardTitle = (props) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(GroupIcon, { fontSize: "inherit" }), /* @__PURE__ */ React.createElement(Box, { ml: 1 }, props.title));
|
|
19
|
+
const GroupProfileCard = (props) => {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const catalogApi = useApi(catalogApiRef);
|
|
22
|
+
const alertApi = useApi(alertApiRef);
|
|
23
|
+
const { entity: group } = useEntity();
|
|
24
|
+
const { allowed: canRefresh } = useEntityPermission(
|
|
25
|
+
catalogEntityRefreshPermission
|
|
26
|
+
);
|
|
27
|
+
const refreshEntity = useCallback(async () => {
|
|
28
|
+
await catalogApi.refreshEntity(stringifyEntityRef(group));
|
|
29
|
+
alertApi.post({
|
|
30
|
+
message: "Refresh scheduled",
|
|
31
|
+
severity: "info",
|
|
32
|
+
display: "transient"
|
|
33
|
+
});
|
|
34
|
+
}, [catalogApi, alertApi, group]);
|
|
35
|
+
if (!group) {
|
|
36
|
+
return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Group not found");
|
|
37
|
+
}
|
|
38
|
+
const {
|
|
39
|
+
metadata: { name, description, title, annotations, links },
|
|
40
|
+
spec: { profile }
|
|
41
|
+
} = group;
|
|
42
|
+
const childRelations = getEntityRelations(group, RELATION_PARENT_OF, {
|
|
43
|
+
kind: "Group"
|
|
44
|
+
});
|
|
45
|
+
const parentRelations = getEntityRelations(group, RELATION_CHILD_OF, {
|
|
46
|
+
kind: "group"
|
|
47
|
+
});
|
|
48
|
+
const entityLocation = annotations == null ? void 0 : annotations[ANNOTATION_LOCATION];
|
|
49
|
+
const allowRefresh = (entityLocation == null ? void 0 : entityLocation.startsWith("url:")) || (entityLocation == null ? void 0 : entityLocation.startsWith("file:"));
|
|
50
|
+
const entityMetadataEditUrl = (_a = group.metadata.annotations) == null ? void 0 : _a[ANNOTATION_EDIT_URL];
|
|
51
|
+
const displayName = (_c = (_b = profile == null ? void 0 : profile.displayName) != null ? _b : title) != null ? _c : name;
|
|
52
|
+
const emailHref = (profile == null ? void 0 : profile.email) ? `mailto:${profile.email}` : "#";
|
|
53
|
+
const infoCardAction = entityMetadataEditUrl ? /* @__PURE__ */ React.createElement(
|
|
54
|
+
IconButton,
|
|
55
|
+
{
|
|
56
|
+
"aria-label": "Edit",
|
|
57
|
+
title: "Edit Metadata",
|
|
58
|
+
component: Link,
|
|
59
|
+
to: entityMetadataEditUrl
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ React.createElement(EditIcon, null)
|
|
62
|
+
) : /* @__PURE__ */ React.createElement(IconButton, { "aria-label": "Edit", disabled: true, title: "Edit Metadata" }, /* @__PURE__ */ React.createElement(EditIcon, null));
|
|
63
|
+
return /* @__PURE__ */ React.createElement(
|
|
64
|
+
InfoCard,
|
|
65
|
+
{
|
|
66
|
+
title: /* @__PURE__ */ React.createElement(CardTitle, { title: displayName }),
|
|
67
|
+
subheader: description,
|
|
68
|
+
variant: props.variant,
|
|
69
|
+
action: /* @__PURE__ */ React.createElement(React.Fragment, null, allowRefresh && canRefresh && /* @__PURE__ */ React.createElement(
|
|
70
|
+
IconButton,
|
|
71
|
+
{
|
|
72
|
+
"aria-label": "Refresh",
|
|
73
|
+
title: "Schedule entity refresh",
|
|
74
|
+
onClick: refreshEntity
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ React.createElement(CachedIcon, null)
|
|
77
|
+
), infoCardAction)
|
|
78
|
+
},
|
|
79
|
+
/* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, sm: 2, xl: 1 }, /* @__PURE__ */ React.createElement(Avatar, { displayName, picture: profile == null ? void 0 : profile.picture })), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 10, xl: 11 }, /* @__PURE__ */ React.createElement(List, null, (profile == null ? void 0 : profile.email) && /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Tooltip, { title: "Email" }, /* @__PURE__ */ React.createElement(EmailIcon, null))), /* @__PURE__ */ React.createElement(
|
|
80
|
+
ListItemText,
|
|
81
|
+
{
|
|
82
|
+
primary: /* @__PURE__ */ React.createElement(Link, { to: emailHref }, profile.email),
|
|
83
|
+
secondary: "Email"
|
|
84
|
+
}
|
|
85
|
+
)), /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Tooltip, { title: "Parent Group" }, /* @__PURE__ */ React.createElement(AccountTreeIcon, null))), /* @__PURE__ */ React.createElement(
|
|
86
|
+
ListItemText,
|
|
87
|
+
{
|
|
88
|
+
primary: parentRelations.length ? /* @__PURE__ */ React.createElement(
|
|
89
|
+
EntityRefLinks,
|
|
90
|
+
{
|
|
91
|
+
entityRefs: parentRelations,
|
|
92
|
+
defaultKind: "Group"
|
|
93
|
+
}
|
|
94
|
+
) : "N/A",
|
|
95
|
+
secondary: "Parent Group"
|
|
96
|
+
}
|
|
97
|
+
)), /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Tooltip, { title: "Child Groups" }, /* @__PURE__ */ React.createElement(GroupIcon, null))), /* @__PURE__ */ React.createElement(
|
|
98
|
+
ListItemText,
|
|
99
|
+
{
|
|
100
|
+
primary: childRelations.length ? /* @__PURE__ */ React.createElement(
|
|
101
|
+
EntityRefLinks,
|
|
102
|
+
{
|
|
103
|
+
entityRefs: childRelations,
|
|
104
|
+
defaultKind: "Group"
|
|
105
|
+
}
|
|
106
|
+
) : "N/A",
|
|
107
|
+
secondary: "Child Groups"
|
|
108
|
+
}
|
|
109
|
+
)), (props == null ? void 0 : props.showLinks) && /* @__PURE__ */ React.createElement(LinksGroup, { links }))))
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { GroupProfileCard };
|
|
114
|
+
//# sourceMappingURL=GroupProfileCard-d9207fd9.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupProfileCard-d9207fd9.esm.js","sources":["../../src/components/Cards/Group/GroupProfile/GroupProfileCard.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 {\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n GroupEntity,\n RELATION_CHILD_OF,\n RELATION_PARENT_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport {\n Box,\n Grid,\n IconButton,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n} from '@material-ui/core';\nimport {\n EntityRefLinks,\n catalogApiRef,\n getEntityRelations,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport React, { useCallback } from 'react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport AccountTreeIcon from '@material-ui/icons/AccountTree';\nimport Alert from '@material-ui/lab/Alert';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport EditIcon from '@material-ui/icons/Edit';\nimport EmailIcon from '@material-ui/icons/Email';\nimport GroupIcon from '@material-ui/icons/Group';\nimport { LinksGroup } from '../../Meta';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';\n\nconst CardTitle = (props: { title: string }) => (\n <Box display=\"flex\" alignItems=\"center\">\n <GroupIcon fontSize=\"inherit\" />\n <Box ml={1}>{props.title}</Box>\n </Box>\n);\n\n/** @public */\nexport const GroupProfileCard = (props: {\n variant?: InfoCardVariants;\n showLinks?: boolean;\n}) => {\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const { entity: group } = useEntity<GroupEntity>();\n const { allowed: canRefresh } = useEntityPermission(\n catalogEntityRefreshPermission,\n );\n\n const refreshEntity = useCallback(async () => {\n await catalogApi.refreshEntity(stringifyEntityRef(group));\n alertApi.post({\n message: 'Refresh scheduled',\n severity: 'info',\n display: 'transient',\n });\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, title, annotations, links },\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 =\n group.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n const displayName = profile?.displayName ?? title ?? 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={props.variant}\n action={\n <>\n {allowRefresh && canRefresh && (\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 primary={<Link to={emailHref}>{profile.email}</Link>}\n secondary=\"Email\"\n />\n </ListItem>\n )}\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Parent Group\">\n <AccountTreeIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText\n primary={\n parentRelations.length ? (\n <EntityRefLinks\n entityRefs={parentRelations}\n defaultKind=\"Group\"\n />\n ) : (\n 'N/A'\n )\n }\n secondary=\"Parent Group\"\n />\n </ListItem>\n <ListItem>\n <ListItemIcon>\n <Tooltip title=\"Child Groups\">\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText\n primary={\n childRelations.length ? (\n <EntityRefLinks\n entityRefs={childRelations}\n defaultKind=\"Group\"\n />\n ) : (\n 'N/A'\n )\n }\n secondary=\"Child Groups\"\n />\n </ListItem>\n {props?.showLinks && <LinksGroup links={links} />}\n </List>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2DA,MAAM,SAAA,GAAY,CAAC,KACjB,qBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAU,QAAS,EAAA,SAAA,EAAU,mBAC7B,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,IAAI,CAAI,EAAA,EAAA,KAAA,CAAM,KAAM,CAC3B,CAAA,CAAA;AAIW,MAAA,gBAAA,GAAmB,CAAC,KAG3B,KAAA;AAtEN,EAAA,IAAA,EAAA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A,WAAA;AAAA,SAGd,GAAA,KAAA;AAAA,QAGJ,SAAU,EAAA,cAAA;AAAA,OAAA;AAAA,KAEd,IACC,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,SAAA,yCAAc,UAAW,EAAA,EAAA,KAAA,EAAc,CACjD,CACF,CACF,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useApp } from '@backstage/core-plugin-api';
|
|
2
|
+
import LanguageIcon from '@material-ui/icons/Language';
|
|
3
|
+
import { Divider, ListItem, ListItemIcon, ListItemText } from '@material-ui/core';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Link } from '@backstage/core-components';
|
|
6
|
+
|
|
7
|
+
const WebLink = ({
|
|
8
|
+
href,
|
|
9
|
+
Icon,
|
|
10
|
+
text
|
|
11
|
+
}) => /* @__PURE__ */ React.createElement(ListItem, { key: href }, /* @__PURE__ */ React.createElement(ListItemIcon, null, Icon ? /* @__PURE__ */ React.createElement(Icon, null) : /* @__PURE__ */ React.createElement(LanguageIcon, null)), /* @__PURE__ */ React.createElement(ListItemText, null, /* @__PURE__ */ React.createElement(Link, { to: href }, text)));
|
|
12
|
+
const LinksGroup = ({ links }) => {
|
|
13
|
+
const app = useApp();
|
|
14
|
+
const iconResolver = (key) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return key ? (_a = app.getSystemIcon(key)) != null ? _a : LanguageIcon : LanguageIcon;
|
|
17
|
+
};
|
|
18
|
+
if (links === void 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, null), links.map((link) => {
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
WebLink,
|
|
24
|
+
{
|
|
25
|
+
key: link.url,
|
|
26
|
+
href: link.url,
|
|
27
|
+
text: link.title,
|
|
28
|
+
Icon: iconResolver(link.icon)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { LinksGroup as L };
|
|
35
|
+
//# sourceMappingURL=LinksGroup-9fefd100.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinksGroup-9fefd100.esm.js","sources":["../../src/components/Cards/Meta/LinksGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 { EntityLink } from '@backstage/catalog-model';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n Divider,\n} from '@material-ui/core';\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\n\nconst WebLink = ({\n href,\n Icon,\n text,\n}: {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}) => (\n <ListItem key={href}>\n <ListItemIcon>{Icon ? <Icon /> : <LanguageIcon />}</ListItemIcon>\n <ListItemText>\n <Link to={href}>{text}</Link>\n </ListItemText>\n </ListItem>\n);\n\nexport const LinksGroup = ({ links }: { links?: EntityLink[] }) => {\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n if (links === undefined) {\n return null;\n }\n\n return (\n <>\n <Divider />\n {links.map(link => {\n return (\n <WebLink\n key={link.url}\n href={link.url}\n text={link.title}\n Icon={iconResolver(link.icon)}\n />\n );\n })}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;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|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { stringifyEntityRef, DEFAULT_NAMESPACE, RELATION_PARENT_OF } from '@backstage/catalog-model';
|
|
2
|
+
import { getEntityRelations, useEntity, catalogApiRef, EntityRefLink } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { makeStyles, createStyles, Box, Typography, Grid, Switch } from '@material-ui/core';
|
|
4
|
+
import Pagination from '@material-ui/lab/Pagination';
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
7
|
+
import { Progress, ResponseErrorPanel, InfoCard, Avatar, Link, OverflowTooltip } from '@backstage/core-components';
|
|
8
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
9
|
+
|
|
10
|
+
const getMembersFromGroups = async (groups, catalogApi) => {
|
|
11
|
+
const membersList = groups.length === 0 ? { items: [] } : await catalogApi.getEntities({
|
|
12
|
+
filter: {
|
|
13
|
+
kind: "User",
|
|
14
|
+
"relations.memberof": groups.map(
|
|
15
|
+
(group) => stringifyEntityRef({
|
|
16
|
+
kind: "group",
|
|
17
|
+
namespace: group.namespace.toLocaleLowerCase("en-US"),
|
|
18
|
+
name: group.name.toLocaleLowerCase("en-US")
|
|
19
|
+
})
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return membersList.items;
|
|
24
|
+
};
|
|
25
|
+
const getDescendantGroupsFromGroup = async (group, catalogApi) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const alreadyQueuedOrExpandedGroupNames = /* @__PURE__ */ new Map();
|
|
28
|
+
const groupRef = {
|
|
29
|
+
kind: group.kind,
|
|
30
|
+
namespace: (_a = group.metadata.namespace) != null ? _a : DEFAULT_NAMESPACE,
|
|
31
|
+
name: group.metadata.name
|
|
32
|
+
};
|
|
33
|
+
const groupQueue = [groupRef];
|
|
34
|
+
const resultantGroupRefs = [];
|
|
35
|
+
while (groupQueue.length > 0) {
|
|
36
|
+
const activeGroupRef = groupQueue.shift();
|
|
37
|
+
const activeGroup = await catalogApi.getEntityByRef(activeGroupRef);
|
|
38
|
+
alreadyQueuedOrExpandedGroupNames.set(
|
|
39
|
+
stringifyEntityRef(activeGroupRef),
|
|
40
|
+
true
|
|
41
|
+
);
|
|
42
|
+
const childGroups = getEntityRelations(activeGroup, RELATION_PARENT_OF, {
|
|
43
|
+
kind: "Group"
|
|
44
|
+
}).filter(
|
|
45
|
+
(currentGroup) => !alreadyQueuedOrExpandedGroupNames.has(
|
|
46
|
+
stringifyEntityRef(currentGroup)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
childGroups.forEach(
|
|
50
|
+
(childGroup) => alreadyQueuedOrExpandedGroupNames.set(
|
|
51
|
+
stringifyEntityRef(childGroup),
|
|
52
|
+
true
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
groupQueue.push(...childGroups);
|
|
56
|
+
resultantGroupRefs.push(...childGroups);
|
|
57
|
+
}
|
|
58
|
+
return resultantGroupRefs;
|
|
59
|
+
};
|
|
60
|
+
const getAllDesendantMembersForGroupEntity = async (groupEntity, catalogApi) => getMembersFromGroups(
|
|
61
|
+
await getDescendantGroupsFromGroup(groupEntity, catalogApi),
|
|
62
|
+
catalogApi
|
|
63
|
+
);
|
|
64
|
+
const removeDuplicateEntitiesFrom = (entityArray) => {
|
|
65
|
+
const seenEntities = /* @__PURE__ */ new Map();
|
|
66
|
+
return entityArray.filter((entity) => {
|
|
67
|
+
const stringifiedEntity = stringifyEntityRef(entity);
|
|
68
|
+
const isDuplicate = seenEntities.has(stringifiedEntity);
|
|
69
|
+
seenEntities.set(stringifiedEntity, true);
|
|
70
|
+
return !isDuplicate;
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const useStyles = makeStyles(
|
|
75
|
+
(theme) => createStyles({
|
|
76
|
+
card: {
|
|
77
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
78
|
+
boxShadow: theme.shadows[2],
|
|
79
|
+
borderRadius: "4px",
|
|
80
|
+
overflow: "visible",
|
|
81
|
+
position: "relative",
|
|
82
|
+
margin: theme.spacing(4, 1, 1),
|
|
83
|
+
flex: "1",
|
|
84
|
+
minWidth: "0px"
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
const MemberComponent = (props) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const classes = useStyles();
|
|
91
|
+
const {
|
|
92
|
+
metadata: { name: metaName, description },
|
|
93
|
+
spec: { profile }
|
|
94
|
+
} = props.member;
|
|
95
|
+
const displayName = (_a = profile == null ? void 0 : profile.displayName) != null ? _a : metaName;
|
|
96
|
+
return /* @__PURE__ */ React.createElement(Box, { className: classes.card }, /* @__PURE__ */ React.createElement(
|
|
97
|
+
Box,
|
|
98
|
+
{
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexDirection: "column",
|
|
101
|
+
m: 3,
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
justifyContent: "center"
|
|
104
|
+
},
|
|
105
|
+
/* @__PURE__ */ React.createElement(
|
|
106
|
+
Avatar,
|
|
107
|
+
{
|
|
108
|
+
displayName,
|
|
109
|
+
picture: profile == null ? void 0 : profile.picture,
|
|
110
|
+
customStyles: {
|
|
111
|
+
position: "absolute",
|
|
112
|
+
top: "-2rem"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ React.createElement(
|
|
117
|
+
Box,
|
|
118
|
+
{
|
|
119
|
+
pt: 2,
|
|
120
|
+
sx: {
|
|
121
|
+
width: "100%"
|
|
122
|
+
},
|
|
123
|
+
textAlign: "center"
|
|
124
|
+
},
|
|
125
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, /* @__PURE__ */ React.createElement(
|
|
126
|
+
EntityRefLink,
|
|
127
|
+
{
|
|
128
|
+
"data-testid": "user-link",
|
|
129
|
+
entityRef: props.member,
|
|
130
|
+
title: displayName
|
|
131
|
+
}
|
|
132
|
+
)),
|
|
133
|
+
(profile == null ? void 0 : profile.email) && /* @__PURE__ */ React.createElement(Link, { to: `mailto:${profile.email}` }, /* @__PURE__ */ React.createElement(OverflowTooltip, { text: profile.email })),
|
|
134
|
+
description && /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2" }, description)
|
|
135
|
+
)
|
|
136
|
+
));
|
|
137
|
+
};
|
|
138
|
+
const useListStyles = makeStyles((theme) => ({
|
|
139
|
+
root: {
|
|
140
|
+
height: "100%"
|
|
141
|
+
},
|
|
142
|
+
cardContent: {
|
|
143
|
+
overflow: "auto"
|
|
144
|
+
},
|
|
145
|
+
memberList: {
|
|
146
|
+
display: "grid",
|
|
147
|
+
gap: theme.spacing(1.5),
|
|
148
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(auto, ${theme.spacing(
|
|
149
|
+
34
|
|
150
|
+
)}px))`
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
const MembersListCard = (props) => {
|
|
154
|
+
var _a;
|
|
155
|
+
const {
|
|
156
|
+
memberDisplayTitle = "Members",
|
|
157
|
+
pageSize = 50,
|
|
158
|
+
showAggregateMembersToggle
|
|
159
|
+
} = props;
|
|
160
|
+
const classes = useListStyles();
|
|
161
|
+
const { entity: groupEntity } = useEntity();
|
|
162
|
+
const {
|
|
163
|
+
metadata: { name: groupName, namespace: grpNamespace },
|
|
164
|
+
spec: { profile }
|
|
165
|
+
} = groupEntity;
|
|
166
|
+
const catalogApi = useApi(catalogApiRef);
|
|
167
|
+
const displayName = (_a = profile == null ? void 0 : profile.displayName) != null ? _a : groupName;
|
|
168
|
+
const groupNamespace = grpNamespace || DEFAULT_NAMESPACE;
|
|
169
|
+
const [page, setPage] = React.useState(1);
|
|
170
|
+
const pageChange = (_, pageIndex) => {
|
|
171
|
+
setPage(pageIndex);
|
|
172
|
+
};
|
|
173
|
+
const [showAggregateMembers, setShowAggregateMembers] = useState(false);
|
|
174
|
+
const { loading: loadingDescendantMembers, value: descendantMembers } = useAsync(async () => {
|
|
175
|
+
if (!showAggregateMembersToggle) {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
return await getAllDesendantMembersForGroupEntity(
|
|
179
|
+
groupEntity,
|
|
180
|
+
catalogApi
|
|
181
|
+
);
|
|
182
|
+
}, [catalogApi, groupEntity, showAggregateMembersToggle]);
|
|
183
|
+
const {
|
|
184
|
+
loading,
|
|
185
|
+
error,
|
|
186
|
+
value: directMembers
|
|
187
|
+
} = useAsync(async () => {
|
|
188
|
+
const membersList = await catalogApi.getEntities({
|
|
189
|
+
filter: {
|
|
190
|
+
kind: "User",
|
|
191
|
+
"relations.memberof": [
|
|
192
|
+
stringifyEntityRef({
|
|
193
|
+
kind: "group",
|
|
194
|
+
namespace: groupNamespace.toLocaleLowerCase("en-US"),
|
|
195
|
+
name: groupName.toLocaleLowerCase("en-US")
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
return membersList.items;
|
|
201
|
+
}, [catalogApi, groupEntity]);
|
|
202
|
+
const members = removeDuplicateEntitiesFrom(
|
|
203
|
+
[
|
|
204
|
+
...directMembers != null ? directMembers : [],
|
|
205
|
+
...descendantMembers && showAggregateMembers ? descendantMembers : []
|
|
206
|
+
].sort(
|
|
207
|
+
(a, b) => stringifyEntityRef(a).localeCompare(stringifyEntityRef(b))
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
if (loading) {
|
|
211
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
212
|
+
} else if (error) {
|
|
213
|
+
return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
|
|
214
|
+
}
|
|
215
|
+
const nbPages = Math.ceil(((members == null ? void 0 : members.length) || 0) / pageSize);
|
|
216
|
+
const paginationLabel = nbPages < 2 ? "" : `, page ${page} of ${nbPages}`;
|
|
217
|
+
const pagination = /* @__PURE__ */ React.createElement(
|
|
218
|
+
Pagination,
|
|
219
|
+
{
|
|
220
|
+
count: nbPages,
|
|
221
|
+
page,
|
|
222
|
+
onChange: pageChange,
|
|
223
|
+
showFirstButton: true,
|
|
224
|
+
showLastButton: true
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
let memberList;
|
|
228
|
+
if (members && members.length > 0) {
|
|
229
|
+
memberList = /* @__PURE__ */ React.createElement(Box, { className: classes.memberList }, members.slice(pageSize * (page - 1), pageSize * page).map((member) => /* @__PURE__ */ React.createElement(MemberComponent, { member, key: member.metadata.uid })));
|
|
230
|
+
} else {
|
|
231
|
+
memberList = /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Typography, null, "This group has no ", memberDisplayTitle.toLocaleLowerCase(), "."));
|
|
232
|
+
}
|
|
233
|
+
return /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.root }, /* @__PURE__ */ React.createElement(
|
|
234
|
+
InfoCard,
|
|
235
|
+
{
|
|
236
|
+
title: `${memberDisplayTitle} (${(members == null ? void 0 : members.length) || 0}${paginationLabel})`,
|
|
237
|
+
subheader: `of ${displayName}`,
|
|
238
|
+
...nbPages <= 1 ? {} : { actions: pagination },
|
|
239
|
+
className: classes.root,
|
|
240
|
+
cardClassName: classes.cardContent
|
|
241
|
+
},
|
|
242
|
+
showAggregateMembersToggle && /* @__PURE__ */ React.createElement(React.Fragment, null, "Direct Members", /* @__PURE__ */ React.createElement(
|
|
243
|
+
Switch,
|
|
244
|
+
{
|
|
245
|
+
color: "primary",
|
|
246
|
+
checked: showAggregateMembers,
|
|
247
|
+
onChange: () => {
|
|
248
|
+
setShowAggregateMembers(!showAggregateMembers);
|
|
249
|
+
},
|
|
250
|
+
inputProps: { "aria-label": "Users Type Switch" }
|
|
251
|
+
}
|
|
252
|
+
), "Aggregated Members"),
|
|
253
|
+
showAggregateMembers && loadingDescendantMembers ? /* @__PURE__ */ React.createElement(Progress, null) : memberList
|
|
254
|
+
));
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export { MembersListCard };
|
|
258
|
+
//# sourceMappingURL=MembersListCard-cb148b44.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MembersListCard-cb148b44.esm.js","sources":["../../src/helpers/helpers.ts","../../src/components/Cards/Group/MembersList/MembersListCard.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 CompoundEntityRef,\n DEFAULT_NAMESPACE,\n Entity,\n GroupEntity,\n RELATION_PARENT_OF,\n stringifyEntityRef,\n UserEntity,\n} from '@backstage/catalog-model';\nimport {\n CatalogApi,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\n\nexport const getMembersFromGroups = async (\n groups: CompoundEntityRef[],\n catalogApi: CatalogApi,\n) => {\n const membersList =\n groups.length === 0\n ? { items: [] }\n : await catalogApi.getEntities({\n filter: {\n kind: 'User',\n 'relations.memberof': groups.map(group =>\n stringifyEntityRef({\n kind: 'group',\n namespace: group.namespace.toLocaleLowerCase('en-US'),\n name: group.name.toLocaleLowerCase('en-US'),\n }),\n ),\n },\n });\n\n return membersList.items as UserEntity[];\n};\n\nexport const getDescendantGroupsFromGroup = async (\n group: GroupEntity,\n catalogApi: CatalogApi,\n) => {\n const alreadyQueuedOrExpandedGroupNames = new Map<string, boolean>();\n const groupRef: CompoundEntityRef = {\n kind: group.kind,\n namespace: group.metadata.namespace ?? DEFAULT_NAMESPACE,\n name: group.metadata.name,\n };\n\n const groupQueue = [groupRef];\n const resultantGroupRefs: CompoundEntityRef[] = [];\n\n // Continue expanding groups until there are no more\n while (groupQueue.length > 0) {\n const activeGroupRef = groupQueue.shift() as CompoundEntityRef;\n const activeGroup = await catalogApi.getEntityByRef(activeGroupRef);\n alreadyQueuedOrExpandedGroupNames.set(\n stringifyEntityRef(activeGroupRef),\n true,\n );\n\n const childGroups = getEntityRelations(activeGroup, RELATION_PARENT_OF, {\n kind: 'Group',\n }).filter(\n currentGroup =>\n !alreadyQueuedOrExpandedGroupNames.has(\n stringifyEntityRef(currentGroup),\n ),\n );\n childGroups.forEach(childGroup =>\n alreadyQueuedOrExpandedGroupNames.set(\n stringifyEntityRef(childGroup),\n true,\n ),\n );\n\n groupQueue.push(...childGroups);\n resultantGroupRefs.push(...childGroups);\n }\n\n return resultantGroupRefs;\n};\n\nexport const getAllDesendantMembersForGroupEntity = async (\n groupEntity: GroupEntity,\n catalogApi: CatalogApi,\n) =>\n getMembersFromGroups(\n await getDescendantGroupsFromGroup(groupEntity, catalogApi),\n catalogApi,\n );\n\nexport const removeDuplicateEntitiesFrom = (entityArray: Entity[]) => {\n const seenEntities = new Map<string, boolean>();\n\n return entityArray.filter(entity => {\n const stringifiedEntity = stringifyEntityRef(entity);\n const isDuplicate = seenEntities.has(stringifiedEntity);\n\n seenEntities.set(stringifiedEntity, true);\n return !isDuplicate;\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 DEFAULT_NAMESPACE,\n GroupEntity,\n UserEntity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { catalogApiRef, useEntity } from '@backstage/plugin-catalog-react';\nimport {\n Box,\n createStyles,\n Grid,\n makeStyles,\n Switch,\n Theme,\n Typography,\n} from '@material-ui/core';\nimport Pagination from '@material-ui/lab/Pagination';\nimport React, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nimport {\n Avatar,\n InfoCard,\n Progress,\n ResponseErrorPanel,\n Link,\n OverflowTooltip,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n getAllDesendantMembersForGroupEntity,\n removeDuplicateEntitiesFrom,\n} from '../../../../helpers/helpers';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\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 = (props: { member: UserEntity }) => {\n const classes = useStyles();\n const {\n metadata: { name: metaName, description },\n spec: { profile },\n } = props.member;\n const displayName = profile?.displayName ?? metaName;\n\n return (\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\n pt={2}\n sx={{\n width: '100%',\n }}\n textAlign=\"center\"\n >\n <Typography variant=\"h6\">\n <EntityRefLink\n data-testid=\"user-link\"\n entityRef={props.member}\n title={displayName}\n />\n </Typography>\n {profile?.email && (\n <Link to={`mailto:${profile.email}`}>\n <OverflowTooltip text={profile.email} />\n </Link>\n )}\n {description && (\n <Typography variant=\"subtitle2\">{description}</Typography>\n )}\n </Box>\n </Box>\n </Box>\n );\n};\n\nconst useListStyles = makeStyles(theme => ({\n root: {\n height: '100%',\n },\n cardContent: {\n overflow: 'auto',\n },\n memberList: {\n display: 'grid',\n gap: theme.spacing(1.5),\n gridTemplateColumns: `repeat(auto-fit, minmax(auto, ${theme.spacing(\n 34,\n )}px))`,\n },\n}));\n\n/** @public */\nexport const MembersListCard = (props: {\n memberDisplayTitle?: string;\n pageSize?: number;\n showAggregateMembersToggle?: boolean;\n}) => {\n const {\n memberDisplayTitle = 'Members',\n pageSize = 50,\n showAggregateMembersToggle,\n } = props;\n const classes = useListStyles();\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 || DEFAULT_NAMESPACE;\n\n const [page, setPage] = React.useState(1);\n const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {\n setPage(pageIndex);\n };\n\n const [showAggregateMembers, setShowAggregateMembers] = useState(false);\n\n const { loading: loadingDescendantMembers, value: descendantMembers } =\n useAsync(async () => {\n if (!showAggregateMembersToggle) {\n return [] as UserEntity[];\n }\n\n return await getAllDesendantMembersForGroupEntity(\n groupEntity,\n catalogApi,\n );\n }, [catalogApi, groupEntity, showAggregateMembersToggle]);\n const {\n loading,\n error,\n value: directMembers,\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 const members = removeDuplicateEntitiesFrom(\n [\n ...(directMembers ?? []),\n ...(descendantMembers && showAggregateMembers ? descendantMembers : []),\n ].sort((a, b) =>\n stringifyEntityRef(a).localeCompare(stringifyEntityRef(b)),\n ),\n ) as UserEntity[];\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 let memberList: React.JSX.Element;\n if (members && members.length > 0) {\n memberList = (\n <Box className={classes.memberList}>\n {members.slice(pageSize * (page - 1), pageSize * page).map(member => (\n <MemberComponent member={member} key={member.metadata.uid} />\n ))}\n </Box>\n );\n } else {\n memberList = (\n <Box p={2}>\n <Typography>\n This group has no {memberDisplayTitle.toLocaleLowerCase()}.\n </Typography>\n </Box>\n );\n }\n\n return (\n <Grid item className={classes.root}>\n <InfoCard\n title={`${memberDisplayTitle} (${\n members?.length || 0\n }${paginationLabel})`}\n subheader={`of ${displayName}`}\n {...(nbPages <= 1 ? {} : { actions: pagination })}\n className={classes.root}\n cardClassName={classes.cardContent}\n >\n {showAggregateMembersToggle && (\n <>\n Direct Members\n <Switch\n color=\"primary\"\n checked={showAggregateMembers}\n onChange={() => {\n setShowAggregateMembers(!showAggregateMembers);\n }}\n inputProps={{ 'aria-label': 'Users Type Switch' }}\n />\n Aggregated Members\n </>\n )}\n {showAggregateMembers && loadingDescendantMembers ? (\n <Progress />\n ) : (\n memberList\n )}\n </InfoCard>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8Ba,MAAA,oBAAA,GAAuB,OAClC,MAAA,EACA,UACG,KAAA;AACH,EAAM,MAAA,WAAA,GACJ,MAAO,CAAA,MAAA,KAAW,CACd,GAAA,EAAE,KAAO,EAAA,EAAG,EAAA,GACZ,MAAM,UAAA,CAAW,WAAY,CAAA;AAAA,IAC3B,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,MAAA;AAAA,MACN,sBAAsB,MAAO,CAAA,GAAA;AAAA,QAAI,WAC/B,kBAAmB,CAAA;AAAA,UACjB,IAAM,EAAA,OAAA;AAAA,UACN,SAAW,EAAA,KAAA,CAAM,SAAU,CAAA,iBAAA,CAAkB,OAAO,CAAA;AAAA,UACpD,IAAM,EAAA,KAAA,CAAM,IAAK,CAAA,iBAAA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