@backstage/plugin-org 0.6.36-next.0 → 0.6.36-next.1
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,20 @@
|
|
|
1
1
|
# @backstage/plugin-org
|
|
2
2
|
|
|
3
|
+
## 0.6.36-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9cf1260: Added support for `spec.profile.displayName` to be used in the `MyGroupsSidebarItem` component via the `EntityDisplayName` component when you are a member of multiple Groups.
|
|
8
|
+
- 58ec9e7: Removed older versions of React packages as a preparatory step for upgrading to React 19. This commit does not introduce any functional changes, but removes dependencies on previous React versions, allowing for a cleaner upgrade path in subsequent commits.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-components@0.16.4-next.0
|
|
11
|
+
- @backstage/frontend-plugin-api@0.9.5-next.1
|
|
12
|
+
- @backstage/core-compat-api@0.3.6-next.1
|
|
13
|
+
- @backstage/core-plugin-api@1.10.4-next.0
|
|
14
|
+
- @backstage/plugin-catalog-react@1.15.2-next.1
|
|
15
|
+
- @backstage/catalog-model@1.7.3
|
|
16
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
17
|
+
|
|
3
18
|
## 0.6.36-next.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -3,13 +3,14 @@ import { getCompoundEntityRef, DEFAULT_NAMESPACE, stringifyEntityRef } from '@ba
|
|
|
3
3
|
import { SidebarItem, SidebarSubmenu, SidebarSubmenuItem } from '@backstage/core-components';
|
|
4
4
|
import { useApi, identityApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
5
5
|
import useAsync from 'react-use/esm/useAsync';
|
|
6
|
-
import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import { catalogApiRef, entityRouteRef, entityPresentationApiRef } from '@backstage/plugin-catalog-react';
|
|
7
7
|
|
|
8
8
|
const MyGroupsSidebarItem = (props) => {
|
|
9
9
|
const { singularTitle, pluralTitle, icon, filter } = props;
|
|
10
10
|
const identityApi = useApi(identityApiRef);
|
|
11
11
|
const catalogApi = useApi(catalogApiRef);
|
|
12
12
|
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
13
|
+
const entityPresentationApi = useApi(entityPresentationApiRef);
|
|
13
14
|
const { value: groups } = useAsync(async () => {
|
|
14
15
|
const profile = await identityApi.getBackstageIdentity();
|
|
15
16
|
const response = await catalogApi.getEntities({
|
|
@@ -38,11 +39,12 @@ const MyGroupsSidebarItem = (props) => {
|
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
}
|
|
41
|
-
return /* @__PURE__ */ React.createElement(SidebarItem, { icon, text: pluralTitle }, /* @__PURE__ */ React.createElement(SidebarSubmenu, { title: pluralTitle }, groups?.map(
|
|
42
|
+
return /* @__PURE__ */ React.createElement(SidebarItem, { icon, text: pluralTitle }, /* @__PURE__ */ React.createElement(SidebarSubmenu, { title: pluralTitle }, groups?.map((group) => {
|
|
43
|
+
const entityDisplayName = entityPresentationApi.forEntity(group);
|
|
42
44
|
return /* @__PURE__ */ React.createElement(
|
|
43
45
|
SidebarSubmenuItem,
|
|
44
46
|
{
|
|
45
|
-
title:
|
|
47
|
+
title: entityDisplayName.snapshot.primaryTitle,
|
|
46
48
|
subtitle: group.metadata.namespace !== DEFAULT_NAMESPACE ? group.metadata.namespace : void 0,
|
|
47
49
|
to: catalogEntityRoute(getCompoundEntityRef(group)),
|
|
48
50
|
icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyGroupsSidebarItem.esm.js","sources":["../../../src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.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 */\n\nimport React from 'react';\nimport {\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n SidebarItem,\n SidebarSubmenu,\n SidebarSubmenuItem,\n} from '@backstage/core-components';\nimport {\n IconComponent,\n identityApiRef,\n useApi,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n catalogApiRef,\n CatalogApi,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\n/**\n * MyGroupsSidebarItem can be added to your sidebar providing quick access to groups the logged in user is a member of\n *\n * @public\n */\nexport const MyGroupsSidebarItem = (props: {\n singularTitle: string;\n pluralTitle: string;\n icon: IconComponent;\n filter?: Record<string, string | symbol | (string | symbol)[]>;\n}) => {\n const { singularTitle, pluralTitle, icon, filter } = props;\n\n const identityApi = useApi(identityApiRef);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n\n const { value: groups } = useAsync(async () => {\n const profile = await identityApi.getBackstageIdentity();\n\n const response = await catalogApi.getEntities({\n filter: [\n {\n kind: 'group',\n 'relations.hasMember': profile.userEntityRef,\n ...(filter ?? {}),\n },\n ],\n fields: ['metadata', 'kind'],\n });\n
|
|
1
|
+
{"version":3,"file":"MyGroupsSidebarItem.esm.js","sources":["../../../src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.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 */\n\nimport React from 'react';\nimport {\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n SidebarItem,\n SidebarSubmenu,\n SidebarSubmenuItem,\n} from '@backstage/core-components';\nimport {\n IconComponent,\n identityApiRef,\n useApi,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n catalogApiRef,\n CatalogApi,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\nimport { entityPresentationApiRef } from '@backstage/plugin-catalog-react';\n\n/**\n * MyGroupsSidebarItem can be added to your sidebar providing quick access to groups the logged in user is a member of\n *\n * @public\n */\nexport const MyGroupsSidebarItem = (props: {\n singularTitle: string;\n pluralTitle: string;\n icon: IconComponent;\n filter?: Record<string, string | symbol | (string | symbol)[]>;\n}) => {\n const { singularTitle, pluralTitle, icon, filter } = props;\n\n const identityApi = useApi(identityApiRef);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const entityPresentationApi = useApi(entityPresentationApiRef);\n\n const { value: groups } = useAsync(async () => {\n const profile = await identityApi.getBackstageIdentity();\n\n const response = await catalogApi.getEntities({\n filter: [\n {\n kind: 'group',\n 'relations.hasMember': profile.userEntityRef,\n ...(filter ?? {}),\n },\n ],\n fields: ['metadata', 'kind'],\n });\n return response.items;\n }, []);\n\n if (!groups?.length) {\n return null;\n }\n\n // Only member of one group\n if (groups.length === 1) {\n const group = groups[0];\n return (\n <SidebarItem\n text={singularTitle}\n to={catalogEntityRoute(getCompoundEntityRef(group))}\n icon={icon}\n />\n );\n }\n\n // Member of more than one group\n return (\n <SidebarItem icon={icon} text={pluralTitle}>\n <SidebarSubmenu title={pluralTitle}>\n {groups?.map(group => {\n const entityDisplayName = entityPresentationApi.forEntity(group);\n return (\n <SidebarSubmenuItem\n title={entityDisplayName.snapshot.primaryTitle}\n subtitle={\n group.metadata.namespace !== DEFAULT_NAMESPACE\n ? group.metadata.namespace\n : undefined\n }\n to={catalogEntityRoute(getCompoundEntityRef(group))}\n icon={icon}\n key={stringifyEntityRef(group)}\n />\n );\n })}\n </SidebarSubmenu>\n </SidebarItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA+Ca,MAAA,mBAAA,GAAsB,CAAC,KAK9B,KAAA;AACJ,EAAA,MAAM,EAAE,aAAA,EAAe,WAAa,EAAA,IAAA,EAAM,QAAW,GAAA,KAAA;AAErD,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,UAAA,GAAyB,OAAO,aAAa,CAAA;AACnD,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA;AACrD,EAAM,MAAA,qBAAA,GAAwB,OAAO,wBAAwB,CAAA;AAE7D,EAAA,MAAM,EAAE,KAAA,EAAO,MAAO,EAAA,GAAI,SAAS,YAAY;AAC7C,IAAM,MAAA,OAAA,GAAU,MAAM,WAAA,CAAY,oBAAqB,EAAA;AAEvD,IAAM,MAAA,QAAA,GAAW,MAAM,UAAA,CAAW,WAAY,CAAA;AAAA,MAC5C,MAAQ,EAAA;AAAA,QACN;AAAA,UACE,IAAM,EAAA,OAAA;AAAA,UACN,uBAAuB,OAAQ,CAAA,aAAA;AAAA,UAC/B,GAAI,UAAU;AAAC;AACjB,OACF;AAAA,MACA,MAAA,EAAQ,CAAC,UAAA,EAAY,MAAM;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO,QAAS,CAAA,KAAA;AAAA,GAClB,EAAG,EAAE,CAAA;AAEL,EAAI,IAAA,CAAC,QAAQ,MAAQ,EAAA;AACnB,IAAO,OAAA,IAAA;AAAA;AAIT,EAAI,IAAA,MAAA,CAAO,WAAW,CAAG,EAAA;AACvB,IAAM,MAAA,KAAA,GAAQ,OAAO,CAAC,CAAA;AACtB,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,IAAM,EAAA,aAAA;AAAA,QACN,EAAI,EAAA,kBAAA,CAAmB,oBAAqB,CAAA,KAAK,CAAC,CAAA;AAAA,QAClD;AAAA;AAAA,KACF;AAAA;AAKJ,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,EAAA,IAAA,EAAY,IAAM,EAAA,WAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,KAAO,EAAA,WAAA,EAAA,EACpB,MAAQ,EAAA,GAAA,CAAI,CAAS,KAAA,KAAA;AACpB,IAAM,MAAA,iBAAA,GAAoB,qBAAsB,CAAA,SAAA,CAAU,KAAK,CAAA;AAC/D,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,kBAAkB,QAAS,CAAA,YAAA;AAAA,QAClC,UACE,KAAM,CAAA,QAAA,CAAS,cAAc,iBACzB,GAAA,KAAA,CAAM,SAAS,SACf,GAAA,KAAA,CAAA;AAAA,QAEN,EAAI,EAAA,kBAAA,CAAmB,oBAAqB,CAAA,KAAK,CAAC,CAAA;AAAA,QAClD,IAAA;AAAA,QACA,GAAA,EAAK,mBAAmB,KAAK;AAAA;AAAA,KAC/B;AAAA,GAEH,CACH,CACF,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-org",
|
|
3
|
-
"version": "0.6.36-next.
|
|
3
|
+
"version": "0.6.36-next.1",
|
|
4
4
|
"description": "A Backstage plugin that helps you create entity pages for your organization",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@backstage/catalog-model": "1.7.3",
|
|
64
|
-
"@backstage/core-compat-api": "0.3.6-next.
|
|
65
|
-
"@backstage/core-components": "0.16.
|
|
66
|
-
"@backstage/core-plugin-api": "1.10.
|
|
67
|
-
"@backstage/frontend-plugin-api": "0.9.5-next.
|
|
64
|
+
"@backstage/core-compat-api": "0.3.6-next.1",
|
|
65
|
+
"@backstage/core-components": "0.16.4-next.0",
|
|
66
|
+
"@backstage/core-plugin-api": "1.10.4-next.0",
|
|
67
|
+
"@backstage/frontend-plugin-api": "0.9.5-next.1",
|
|
68
68
|
"@backstage/plugin-catalog-common": "1.1.3",
|
|
69
|
-
"@backstage/plugin-catalog-react": "1.15.2-next.
|
|
69
|
+
"@backstage/plugin-catalog-react": "1.15.2-next.1",
|
|
70
70
|
"@material-ui/core": "^4.12.2",
|
|
71
71
|
"@material-ui/icons": "^4.9.1",
|
|
72
72
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@backstage/catalog-client": "1.9.1",
|
|
81
|
-
"@backstage/cli": "0.30.0-next.
|
|
82
|
-
"@backstage/core-app-api": "1.15.
|
|
83
|
-
"@backstage/dev-utils": "1.1.7-next.
|
|
84
|
-
"@backstage/plugin-catalog": "1.26.2-next.
|
|
81
|
+
"@backstage/cli": "0.30.0-next.1",
|
|
82
|
+
"@backstage/core-app-api": "1.15.5-next.0",
|
|
83
|
+
"@backstage/dev-utils": "1.1.7-next.1",
|
|
84
|
+
"@backstage/plugin-catalog": "1.26.2-next.1",
|
|
85
85
|
"@backstage/plugin-permission-common": "0.8.4",
|
|
86
|
-
"@backstage/plugin-permission-react": "0.4.
|
|
87
|
-
"@backstage/test-utils": "1.7.
|
|
86
|
+
"@backstage/plugin-permission-react": "0.4.31-next.0",
|
|
87
|
+
"@backstage/test-utils": "1.7.5-next.0",
|
|
88
88
|
"@backstage/types": "1.2.1",
|
|
89
89
|
"@testing-library/dom": "^10.0.0",
|
|
90
90
|
"@testing-library/jest-dom": "^6.0.0",
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
"react-router-dom": "^6.3.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@types/react": "^
|
|
100
|
-
"react": "^
|
|
101
|
-
"react-dom": "^
|
|
102
|
-
"react-router-dom": "
|
|
99
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
100
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
101
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
102
|
+
"react-router-dom": "^6.3.0"
|
|
103
103
|
},
|
|
104
104
|
"peerDependenciesMeta": {
|
|
105
105
|
"@types/react": {
|