@backstage/plugin-org 0.6.41 → 0.6.42-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 +23 -0
- package/dist/components/Cards/OwnershipCard/ComponentsGrid.esm.js +2 -1
- package/dist/components/Cards/OwnershipCard/ComponentsGrid.esm.js.map +1 -1
- package/dist/components/Cards/OwnershipCard/OwnershipCard.esm.js +38 -33
- package/dist/components/Cards/OwnershipCard/OwnershipCard.esm.js.map +1 -1
- package/dist/components/Cards/User/UserProfileCard/UserProfileCard.esm.js +19 -16
- package/dist/components/Cards/User/UserProfileCard/UserProfileCard.esm.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/package.json.esm.js +1 -1
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-org
|
|
2
2
|
|
|
3
|
+
## 0.6.42-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/core-compat-api@0.4.5-next.1
|
|
9
|
+
- @backstage/plugin-catalog-react@1.20.0-next.1
|
|
10
|
+
- @backstage/frontend-plugin-api@0.11.0-next.0
|
|
11
|
+
- @backstage/core-components@0.17.5-next.0
|
|
12
|
+
- @backstage/catalog-model@1.7.5
|
|
13
|
+
- @backstage/core-plugin-api@1.10.9
|
|
14
|
+
- @backstage/plugin-catalog-common@1.1.5
|
|
15
|
+
|
|
16
|
+
## 0.6.42-next.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 43cbb10: Added OwnershipCard, ComponentsGrid and UserProfileCard components to the `overridableComponents`.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/plugin-catalog-react@1.19.2-next.0
|
|
23
|
+
- @backstage/core-compat-api@0.4.5-next.0
|
|
24
|
+
- @backstage/frontend-plugin-api@0.10.4
|
|
25
|
+
|
|
3
26
|
## 0.6.41
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -32,7 +32,8 @@ const useStyles = makeStyles(
|
|
|
32
32
|
background: (props) => theme.getPageTheme({ themeId: props.type }).backgroundImage,
|
|
33
33
|
color: (props) => theme.getPageTheme({ themeId: props.type }).fontColor
|
|
34
34
|
}
|
|
35
|
-
})
|
|
35
|
+
}),
|
|
36
|
+
{ name: "PluginOrgComponentsGrid" }
|
|
36
37
|
);
|
|
37
38
|
const EntityCountTile = ({
|
|
38
39
|
counter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentsGrid.esm.js","sources":["../../../../src/components/Cards/OwnershipCard/ComponentsGrid.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 { Entity } from '@backstage/catalog-model';\nimport {\n Link,\n OverflowTooltip,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport pluralize from 'pluralize';\nimport { catalogIndexRouteRef } from '../../../routes';\nimport { useGetEntities } from './useGetEntities';\nimport { EntityRelationAggregation } from '../types';\n\nconst useStyles = makeStyles(theme =>\n
|
|
1
|
+
{"version":3,"file":"ComponentsGrid.esm.js","sources":["../../../../src/components/Cards/OwnershipCard/ComponentsGrid.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 { Entity } from '@backstage/catalog-model';\nimport {\n Link,\n OverflowTooltip,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport pluralize from 'pluralize';\nimport { catalogIndexRouteRef } from '../../../routes';\nimport { useGetEntities } from './useGetEntities';\nimport { EntityRelationAggregation } from '../types';\n\n/** @public */\nexport type ComponentsGridClassKey =\n | 'card'\n | 'bold'\n | 'smallFont'\n | 'entityTypeBox';\n\nconst useStyles = makeStyles(\n theme =>\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 transition: `${theme.transitions.duration.standard}ms`,\n '&:hover': {\n boxShadow: theme.shadows[4],\n },\n height: '100%',\n },\n bold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n smallFont: {\n fontSize: theme.typography.body2.fontSize,\n },\n entityTypeBox: {\n background: (props: { type: string }) =>\n theme.getPageTheme({ themeId: props.type }).backgroundImage,\n color: (props: { type: string }) =>\n theme.getPageTheme({ themeId: props.type }).fontColor,\n },\n }),\n { name: 'PluginOrgComponentsGrid' },\n);\n\nconst EntityCountTile = ({\n counter,\n type,\n kind,\n url,\n}: {\n counter: number;\n type?: string;\n kind: string;\n url?: string;\n}) => {\n const classes = useStyles({ type: type ?? kind });\n\n const rawTitle = type ?? kind;\n const isLongText = rawTitle.length > 10;\n\n const tile = (\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 <Box sx={{ width: '100%', textAlign: 'center' }}>\n <Typography\n className={`${classes.bold} ${isLongText && classes.smallFont}`}\n variant=\"h6\"\n >\n <OverflowTooltip\n text={pluralize(rawTitle.toLocaleUpperCase('en-US'), counter)}\n />\n </Typography>\n </Box>\n {type && <Typography variant=\"subtitle1\">{kind}</Typography>}\n </Box>\n );\n\n if (url) {\n return (\n <Link to={url} variant=\"body2\">\n {tile}\n </Link>\n );\n }\n return tile;\n};\n\nexport const ComponentsGrid = ({\n className,\n entity,\n relationsType,\n relationAggregation,\n entityFilterKind,\n entityLimit = 6,\n}: {\n className?: string;\n entity: Entity;\n /** @deprecated Please use relationAggregation instead */\n relationsType?: EntityRelationAggregation;\n relationAggregation?: EntityRelationAggregation;\n entityFilterKind?: string[];\n entityLimit?: number;\n}) => {\n const catalogLink = useRouteRef(catalogIndexRouteRef);\n if (!relationsType && !relationAggregation) {\n throw new Error(\n 'The relationAggregation property must be set as an EntityRelationAggregation type.',\n );\n }\n const { componentsWithCounters, loading, error } = useGetEntities(\n entity,\n (relationAggregation ?? relationsType)!, // we can safely use the non-null assertion here because of the run-time check above\n entityFilterKind,\n entityLimit,\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Grid container className={className}>\n {componentsWithCounters?.map(c => (\n <Grid item xs={6} md={6} lg={4} key={c.type ?? c.kind}>\n <EntityCountTile\n counter={c.counter}\n kind={c.kind}\n type={c.type}\n url={catalogLink && `${catalogLink()}/?${c.queryParams}`}\n />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAwCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,WAC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ListItemSecondaryAction';
|
|
|
7
7
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
8
8
|
import Switch from '@material-ui/core/Switch';
|
|
9
9
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
10
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
10
|
+
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
11
11
|
import { useState, useEffect } from 'react';
|
|
12
12
|
import { ComponentsGrid } from './ComponentsGrid.esm.js';
|
|
13
13
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
14
14
|
import { orgTranslationRef } from '../../../translation.esm.js';
|
|
15
15
|
|
|
16
|
-
const useStyles = makeStyles(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const useStyles = makeStyles(
|
|
17
|
+
(theme) => createStyles({
|
|
18
|
+
card: {
|
|
19
|
+
maxHeight: "100%"
|
|
20
|
+
},
|
|
21
|
+
cardContent: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
overflow: "hidden"
|
|
25
|
+
},
|
|
26
|
+
list: {
|
|
27
|
+
[theme.breakpoints.down("xs")]: {
|
|
28
|
+
padding: `0 0 12px`
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
listItemText: {
|
|
32
|
+
[theme.breakpoints.down("xs")]: {
|
|
33
|
+
paddingRight: 0,
|
|
34
|
+
paddingLeft: 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
listItemSecondaryAction: {
|
|
38
|
+
[theme.breakpoints.down("xs")]: {
|
|
39
|
+
width: "100%",
|
|
40
|
+
top: "auto",
|
|
41
|
+
right: "auto",
|
|
42
|
+
position: "relative",
|
|
43
|
+
transform: "unset"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
grid: {
|
|
47
|
+
overflowY: "auto",
|
|
48
|
+
marginTop: 0
|
|
28
49
|
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
paddingRight: 0,
|
|
33
|
-
paddingLeft: 0
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
listItemSecondaryAction: {
|
|
37
|
-
[theme.breakpoints.down("xs")]: {
|
|
38
|
-
width: "100%",
|
|
39
|
-
top: "auto",
|
|
40
|
-
right: "auto",
|
|
41
|
-
position: "relative",
|
|
42
|
-
transform: "unset"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
grid: {
|
|
46
|
-
overflowY: "auto",
|
|
47
|
-
marginTop: 0
|
|
50
|
+
}),
|
|
51
|
+
{
|
|
52
|
+
name: "PluginOrgOwnershipCard"
|
|
48
53
|
}
|
|
49
|
-
|
|
54
|
+
);
|
|
50
55
|
const OwnershipCard = (props) => {
|
|
51
56
|
const {
|
|
52
57
|
variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnershipCard.esm.js","sources":["../../../../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 { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Switch from '@material-ui/core/Switch';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\nimport { ComponentsGrid } from './ComponentsGrid';\nimport { EntityRelationAggregation } from '../types';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { orgTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles(theme
|
|
1
|
+
{"version":3,"file":"OwnershipCard.esm.js","sources":["../../../../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 { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Switch from '@material-ui/core/Switch';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\nimport { ComponentsGrid } from './ComponentsGrid';\nimport { EntityRelationAggregation } from '../types';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { orgTranslationRef } from '../../../translation';\n\n/** @public */\nexport type OwnershipCardClassKey =\n | 'card'\n | 'cardContent'\n | 'list'\n | 'listItemText'\n | 'listItemSecondaryAction'\n | 'grid';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n card: {\n maxHeight: '100%',\n },\n cardContent: {\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n },\n list: {\n [theme.breakpoints.down('xs')]: {\n padding: `0 0 12px`,\n },\n },\n listItemText: {\n [theme.breakpoints.down('xs')]: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n },\n listItemSecondaryAction: {\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n top: 'auto',\n right: 'auto',\n position: 'relative',\n transform: 'unset',\n },\n },\n grid: {\n overflowY: 'auto',\n marginTop: 0,\n },\n }),\n {\n name: 'PluginOrgOwnershipCard',\n },\n);\n\n/** @public */\nexport const OwnershipCard = (props: {\n variant?: InfoCardVariants;\n entityFilterKind?: string[];\n hideRelationsToggle?: boolean;\n /** @deprecated Please use relationAggregation instead */\n relationsType?: EntityRelationAggregation;\n relationAggregation?: EntityRelationAggregation;\n entityLimit?: number;\n}) => {\n const {\n variant,\n entityFilterKind,\n hideRelationsToggle,\n entityLimit = 6,\n } = props;\n const relationAggregation = props.relationAggregation ?? props.relationsType;\n const relationsToggle =\n hideRelationsToggle === undefined ? false : hideRelationsToggle;\n const classes = useStyles();\n const { entity } = useEntity();\n const { t } = useTranslationRef(orgTranslationRef);\n\n const defaultRelationAggregation =\n entity.kind === 'User' ? 'aggregated' : 'direct';\n const [getRelationAggregation, setRelationAggregation] = useState(\n relationAggregation ?? defaultRelationAggregation,\n );\n\n useEffect(() => {\n if (!relationAggregation) {\n setRelationAggregation(defaultRelationAggregation);\n }\n }, [setRelationAggregation, defaultRelationAggregation, relationAggregation]);\n\n return (\n <InfoCard\n title={t('ownershipCard.title')}\n variant={variant}\n className={classes.card}\n cardClassName={classes.cardContent}\n >\n {!relationsToggle && (\n <List dense>\n <ListItem className={classes.list}>\n <ListItemText className={classes.listItemText} />\n <ListItemSecondaryAction\n className={classes.listItemSecondaryAction}\n >\n {t('ownershipCard.aggregateRelationsToggle.directRelations')}\n <Tooltip\n placement=\"top\"\n arrow\n title={\n getRelationAggregation === 'direct'\n ? t(\n 'ownershipCard.aggregateRelationsToggle.directRelations',\n )\n : t(\n 'ownershipCard.aggregateRelationsToggle.aggregatedRelations',\n )\n }\n >\n <Switch\n color=\"primary\"\n checked={getRelationAggregation !== 'direct'}\n onChange={() => {\n const updatedRelationAggregation =\n getRelationAggregation === 'direct'\n ? 'aggregated'\n : 'direct';\n setRelationAggregation(updatedRelationAggregation);\n }}\n name=\"pin\"\n inputProps={{\n 'aria-label': t(\n 'ownershipCard.aggregateRelationsToggle.ariaLabel',\n ),\n }}\n />\n </Tooltip>\n {t('ownershipCard.aggregateRelationsToggle.aggregatedRelations')}\n </ListItemSecondaryAction>\n </ListItem>\n </List>\n )}\n <ComponentsGrid\n className={classes.grid}\n entity={entity}\n entityLimit={entityLimit}\n relationAggregation={getRelationAggregation}\n entityFilterKind={entityFilterKind}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,WACE,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,SAAW,EAAA;AAAA,KACb;AAAA,IACA,WAAa,EAAA;AAAA,MACX,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,CAAC,KAAM,CAAA,WAAA,CAAY,IAAK,CAAA,IAAI,CAAC,GAAG;AAAA,QAC9B,OAAS,EAAA,CAAA,QAAA;AAAA;AACX,KACF;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,CAAC,KAAM,CAAA,WAAA,CAAY,IAAK,CAAA,IAAI,CAAC,GAAG;AAAA,QAC9B,YAAc,EAAA,CAAA;AAAA,QACd,WAAa,EAAA;AAAA;AACf,KACF;AAAA,IACA,uBAAyB,EAAA;AAAA,MACvB,CAAC,KAAM,CAAA,WAAA,CAAY,IAAK,CAAA,IAAI,CAAC,GAAG;AAAA,QAC9B,KAAO,EAAA,MAAA;AAAA,QACP,GAAK,EAAA,MAAA;AAAA,QACL,KAAO,EAAA,MAAA;AAAA,QACP,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AAA,YACC,WAAW,OAAQ,CAAA,IAAA;AAAA,YACnB,MAAA;AAAA,YACA,WAAA;AAAA,YACA,mBAAqB,EAAA,sBAAA;AAAA,YACrB;AAAA;AAAA;AACF;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { ANNOTATION_EDIT_URL, RELATION_MEMBER_OF } from '@backstage/catalog-model';
|
|
3
3
|
import { InfoCard, Link, Avatar } from '@backstage/core-components';
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
5
5
|
import Box from '@material-ui/core/Box';
|
|
6
6
|
import Grid from '@material-ui/core/Grid';
|
|
7
7
|
import BaseButton from '@material-ui/core/ButtonBase';
|
|
@@ -28,21 +28,24 @@ import { useState, useCallback } from 'react';
|
|
|
28
28
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
29
29
|
import { orgTranslationRef } from '../../../../translation.esm.js';
|
|
30
30
|
|
|
31
|
-
const useStyles = makeStyles(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
31
|
+
const useStyles = makeStyles(
|
|
32
|
+
(theme) => createStyles({
|
|
33
|
+
closeButton: {
|
|
34
|
+
position: "absolute",
|
|
35
|
+
right: theme.spacing(1),
|
|
36
|
+
top: theme.spacing(1),
|
|
37
|
+
color: theme.palette.grey[500]
|
|
38
|
+
},
|
|
39
|
+
moreButton: {
|
|
40
|
+
display: "contents",
|
|
41
|
+
color: theme.palette.primary.main
|
|
42
|
+
},
|
|
43
|
+
dialogPaper: {
|
|
44
|
+
minHeight: 400
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
{ name: "PluginOrgUserProfileCard" }
|
|
48
|
+
);
|
|
46
49
|
const CardTitle = (props) => props.title ? /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
|
|
47
50
|
/* @__PURE__ */ jsx(PersonIcon, { fontSize: "inherit" }),
|
|
48
51
|
/* @__PURE__ */ jsx(Box, { ml: 1, children: props.title })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfileCard.esm.js","sources":["../../../../../src/components/Cards/User/UserProfileCard/UserProfileCard.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 RELATION_MEMBER_OF,\n UserEntity,\n} from '@backstage/catalog-model';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport BaseButton from '@material-ui/core/ButtonBase';\nimport IconButton from '@material-ui/core/IconButton';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport CloseIcon from '@material-ui/icons/Close';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport Alert from '@material-ui/lab/Alert';\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 PersonIcon from '@material-ui/icons/Person';\n\nimport { useCallback, useState } from 'react';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { orgTranslationRef } from '../../../../translation';\n\nconst useStyles = makeStyles((theme: any) => ({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n moreButton: {\n display: 'contents',\n color: theme.palette.primary.main,\n },\n dialogPaper: {\n minHeight: 400,\n },\n}));\n\nconst CardTitle = (props: { title?: string }) =>\n props.title ? (\n <Box display=\"flex\" alignItems=\"center\">\n <PersonIcon fontSize=\"inherit\" />\n <Box ml={1}>{props.title}</Box>\n </Box>\n ) : null;\n\n/** @public */\nexport const UserProfileCard = (props: {\n variant?: InfoCardVariants;\n showLinks?: boolean;\n maxRelations?: number;\n hideIcons?: boolean;\n}) => {\n const { maxRelations, hideIcons } = props;\n\n const classes = useStyles();\n const { entity: user } = useEntity<UserEntity>();\n const [isAllGroupsDialogOpen, setIsAllGroupsDialogOpen] = useState(false);\n const { t } = useTranslationRef(orgTranslationRef);\n\n const toggleAllGroupsDialog = useCallback(\n () =>\n setIsAllGroupsDialogOpen(\n prevIsViewAllGroupsDialogOpen => !prevIsViewAllGroupsDialogOpen,\n ),\n [],\n );\n\n if (!user) {\n return <Alert severity=\"error\">{t('userProfileCard.userNotFound')}</Alert>;\n }\n\n const entityMetadataEditUrl =\n user.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n const {\n metadata: { name: metaName, description, links },\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={props.variant}\n action={\n <>\n {entityMetadataEditUrl && (\n <IconButton\n aria-label={t('userProfileCard.editIconButtonTitle')}\n title={t('userProfileCard.editIconButtonTitle')}\n component={Link}\n to={entityMetadataEditUrl}\n >\n <EditIcon />\n </IconButton>\n )}\n </>\n }\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={t('userProfileCard.listItemTitle.email')}>\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref ?? ''}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n {maxRelations === undefined || maxRelations > 0 ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title={t('userProfileCard.listItemTitle.memberOf')}>\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={memberOfRelations.slice(0, maxRelations)}\n defaultKind=\"Group\"\n hideIcons={hideIcons}\n />\n {maxRelations && memberOfRelations.length > maxRelations ? (\n <>\n ,\n <BaseButton\n className={classes.moreButton}\n onClick={toggleAllGroupsDialog}\n disableRipple\n >\n {t('userProfileCard.moreGroupButtonTitle', {\n number: String(\n memberOfRelations.length - maxRelations,\n ),\n })}\n </BaseButton>\n </>\n ) : null}\n </ListItemText>\n </ListItem>\n ) : null}\n {props?.showLinks && <LinksGroup links={links} />}\n </List>\n </Grid>\n </Grid>\n\n <Dialog\n classes={{ paper: classes.dialogPaper }}\n open={isAllGroupsDialogOpen}\n onClose={toggleAllGroupsDialog}\n scroll=\"paper\"\n aria-labelledby=\"view-all-groups-dialog-title\"\n maxWidth=\"md\"\n fullWidth\n >\n <DialogTitle id=\"view-all-groups-dialog-title\">\n {t('userProfileCard.allGroupDialog.title', {\n name: user.metadata.name,\n })}\n <IconButton\n className={classes.closeButton}\n aria-label={t('userProfileCard.allGroupDialog.closeButtonTitle')}\n onClick={toggleAllGroupsDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent dividers>\n <EntityRefLinks entityRefs={memberOfRelations} defaultKind=\"Group\" />\n </DialogContent>\n <DialogActions>\n <Button onClick={toggleAllGroupsDialog}>\n {t('userProfileCard.allGroupDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAgB,MAAA;AAAA,EAC5C,WAAa,EAAA;AAAA,IACX,QAAU,EAAA,UAAA;AAAA,IACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA,GAC/B;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,UAAA;AAAA,IACT,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA;AAAA,GAC/B;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAW,EAAA;AAAA;AAEf,CAAE,CAAA,CAAA;AAEF,MAAM,SAAA,GAAY,CAAC,KAAA,KACjB,KAAM,CAAA,KAAA,wBACH,GAAI,EAAA,EAAA,OAAA,EAAQ,MAAO,EAAA,UAAA,EAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,kBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,UAAS,SAAU,EAAA,CAAA;AAAA,kBAC9B,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA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AEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"UserProfileCard.esm.js","sources":["../../../../../src/components/Cards/User/UserProfileCard/UserProfileCard.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 RELATION_MEMBER_OF,\n UserEntity,\n} from '@backstage/catalog-model';\nimport {\n Avatar,\n InfoCard,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport BaseButton from '@material-ui/core/ButtonBase';\nimport IconButton from '@material-ui/core/IconButton';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport CloseIcon from '@material-ui/icons/Close';\nimport {\n EntityRefLinks,\n getEntityRelations,\n useEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport Alert from '@material-ui/lab/Alert';\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 PersonIcon from '@material-ui/icons/Person';\n\nimport { useCallback, useState } from 'react';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { orgTranslationRef } from '../../../../translation';\n\n/** @public */\nexport type UserProfileCardClassKey =\n | 'closeButton'\n | 'moreButton'\n | 'dialogPaper';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n moreButton: {\n display: 'contents',\n color: theme.palette.primary.main,\n },\n dialogPaper: {\n minHeight: 400,\n },\n }),\n { name: 'PluginOrgUserProfileCard' },\n);\n\nconst CardTitle = (props: { title?: string }) =>\n props.title ? (\n <Box display=\"flex\" alignItems=\"center\">\n <PersonIcon fontSize=\"inherit\" />\n <Box ml={1}>{props.title}</Box>\n </Box>\n ) : null;\n\n/** @public */\nexport const UserProfileCard = (props: {\n variant?: InfoCardVariants;\n showLinks?: boolean;\n maxRelations?: number;\n hideIcons?: boolean;\n}) => {\n const { maxRelations, hideIcons } = props;\n\n const classes = useStyles();\n const { entity: user } = useEntity<UserEntity>();\n const [isAllGroupsDialogOpen, setIsAllGroupsDialogOpen] = useState(false);\n const { t } = useTranslationRef(orgTranslationRef);\n\n const toggleAllGroupsDialog = useCallback(\n () =>\n setIsAllGroupsDialogOpen(\n prevIsViewAllGroupsDialogOpen => !prevIsViewAllGroupsDialogOpen,\n ),\n [],\n );\n\n if (!user) {\n return <Alert severity=\"error\">{t('userProfileCard.userNotFound')}</Alert>;\n }\n\n const entityMetadataEditUrl =\n user.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n const {\n metadata: { name: metaName, description, links },\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={props.variant}\n action={\n <>\n {entityMetadataEditUrl && (\n <IconButton\n aria-label={t('userProfileCard.editIconButtonTitle')}\n title={t('userProfileCard.editIconButtonTitle')}\n component={Link}\n to={entityMetadataEditUrl}\n >\n <EditIcon />\n </IconButton>\n )}\n </>\n }\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={t('userProfileCard.listItemTitle.email')}>\n <EmailIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Link to={emailHref ?? ''}>{profile.email}</Link>\n </ListItemText>\n </ListItem>\n )}\n\n {maxRelations === undefined || maxRelations > 0 ? (\n <ListItem>\n <ListItemIcon>\n <Tooltip title={t('userProfileCard.listItemTitle.memberOf')}>\n <GroupIcon />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <EntityRefLinks\n entityRefs={memberOfRelations.slice(0, maxRelations)}\n defaultKind=\"Group\"\n hideIcons={hideIcons}\n />\n {maxRelations && memberOfRelations.length > maxRelations ? (\n <>\n ,\n <BaseButton\n className={classes.moreButton}\n onClick={toggleAllGroupsDialog}\n disableRipple\n >\n {t('userProfileCard.moreGroupButtonTitle', {\n number: String(\n memberOfRelations.length - maxRelations,\n ),\n })}\n </BaseButton>\n </>\n ) : null}\n </ListItemText>\n </ListItem>\n ) : null}\n {props?.showLinks && <LinksGroup links={links} />}\n </List>\n </Grid>\n </Grid>\n\n <Dialog\n classes={{ paper: classes.dialogPaper }}\n open={isAllGroupsDialogOpen}\n onClose={toggleAllGroupsDialog}\n scroll=\"paper\"\n aria-labelledby=\"view-all-groups-dialog-title\"\n maxWidth=\"md\"\n fullWidth\n >\n <DialogTitle id=\"view-all-groups-dialog-title\">\n {t('userProfileCard.allGroupDialog.title', {\n name: user.metadata.name,\n })}\n <IconButton\n className={classes.closeButton}\n aria-label={t('userProfileCard.allGroupDialog.closeButtonTitle')}\n onClick={toggleAllGroupsDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent dividers>\n <EntityRefLinks entityRefs={memberOfRelations} defaultKind=\"Group\" />\n </DialogContent>\n <DialogActions>\n <Button onClick={toggleAllGroupsDialog}>\n {t('userProfileCard.allGroupDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,WACE,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA,KAC/B;AAAA,IACA,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,UAAA;AAAA,MACT,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA;AAAA,KAC/B;AAAA,IACA,WAAa,EAAA;AAAA,MACX,SAAW,EAAA;AAAA;AACb,GACD,CAAA;AAAA,EACH,EAAE,MAAM,0BAA2B;AACrC,CAAA;AAEA,MAAM,SAAA,GAAY,CAAC,KAAA,KACjB,KAAM,CAAA,KAAA,wBACH,GAAI,EAAA,EAAA,OAAA,EAAQ,MAAO,EAAA,UAAA,EAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,kBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,UAAS,SAAU,EAAA,CAAA;AAAA,kBAC9B,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAI,gBAAM,KAAM,EAAA;AAAA,CAAA,EAC3B,CACE,GAAA,IAAA;AAGO,MAAA,eAAA,GAAkB,CAAC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?: boolean;
|
|
29
29
|
}) => react_jsx_runtime.JSX.Element;
|
|
30
30
|
|
|
31
|
+
/** @public */
|
|
32
|
+
type UserProfileCardClassKey = 'closeButton' | 'moreButton' | 'dialogPaper';
|
|
31
33
|
/** @public */
|
|
32
34
|
declare const UserProfileCard: (props: {
|
|
33
35
|
variant?: InfoCardVariants;
|
|
@@ -36,6 +38,8 @@ declare const UserProfileCard: (props: {
|
|
|
36
38
|
hideIcons?: boolean;
|
|
37
39
|
}) => react_jsx_runtime.JSX.Element;
|
|
38
40
|
|
|
41
|
+
/** @public */
|
|
42
|
+
type OwnershipCardClassKey = 'card' | 'cardContent' | 'list' | 'listItemText' | 'listItemSecondaryAction' | 'grid';
|
|
39
43
|
/** @public */
|
|
40
44
|
declare const OwnershipCard: (props: {
|
|
41
45
|
variant?: InfoCardVariants;
|
|
@@ -47,6 +51,9 @@ declare const OwnershipCard: (props: {
|
|
|
47
51
|
entityLimit?: number;
|
|
48
52
|
}) => react_jsx_runtime.JSX.Element;
|
|
49
53
|
|
|
54
|
+
/** @public */
|
|
55
|
+
type ComponentsGridClassKey = 'card' | 'bold' | 'smallFont' | 'entityTypeBox';
|
|
56
|
+
|
|
50
57
|
/**
|
|
51
58
|
* MyGroupsSidebarItem can be added to your sidebar providing quick access to groups the logged in user is a member of
|
|
52
59
|
*
|
|
@@ -94,4 +101,4 @@ declare const EntityUserProfileCard: (props: {
|
|
|
94
101
|
hideIcons?: boolean;
|
|
95
102
|
}) => react_jsx_runtime.JSX.Element;
|
|
96
103
|
|
|
97
|
-
export { EntityGroupProfileCard, EntityMembersListCard, EntityOwnershipCard, type EntityRelationAggregation, EntityUserProfileCard, GroupProfileCard, type MemberComponentClassKey, MembersListCard, type MembersListCardClassKey, MyGroupsSidebarItem, OwnershipCard, UserProfileCard, orgPlugin, orgPlugin as plugin };
|
|
104
|
+
export { type ComponentsGridClassKey, EntityGroupProfileCard, EntityMembersListCard, EntityOwnershipCard, type EntityRelationAggregation, EntityUserProfileCard, GroupProfileCard, type MemberComponentClassKey, MembersListCard, type MembersListCardClassKey, MyGroupsSidebarItem, OwnershipCard, type OwnershipCardClassKey, UserProfileCard, type UserProfileCardClassKey, orgPlugin, orgPlugin as plugin };
|
package/dist/package.json.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-org",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.42-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",
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"test": "backstage-cli package test"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@backstage/catalog-model": "
|
|
67
|
-
"@backstage/core-compat-api": "
|
|
68
|
-
"@backstage/core-components": "
|
|
69
|
-
"@backstage/core-plugin-api": "
|
|
70
|
-
"@backstage/frontend-plugin-api": "
|
|
71
|
-
"@backstage/plugin-catalog-common": "
|
|
72
|
-
"@backstage/plugin-catalog-react": "
|
|
66
|
+
"@backstage/catalog-model": "1.7.5",
|
|
67
|
+
"@backstage/core-compat-api": "0.4.5-next.1",
|
|
68
|
+
"@backstage/core-components": "0.17.5-next.0",
|
|
69
|
+
"@backstage/core-plugin-api": "1.10.9",
|
|
70
|
+
"@backstage/frontend-plugin-api": "0.11.0-next.0",
|
|
71
|
+
"@backstage/plugin-catalog-common": "1.1.5",
|
|
72
|
+
"@backstage/plugin-catalog-react": "1.20.0-next.1",
|
|
73
73
|
"@material-ui/core": "^4.12.2",
|
|
74
74
|
"@material-ui/icons": "^4.9.1",
|
|
75
75
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
"react-use": "^17.2.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@backstage/catalog-client": "
|
|
84
|
-
"@backstage/cli": "
|
|
85
|
-
"@backstage/core-app-api": "
|
|
86
|
-
"@backstage/dev-utils": "
|
|
87
|
-
"@backstage/plugin-catalog": "
|
|
88
|
-
"@backstage/plugin-permission-common": "
|
|
89
|
-
"@backstage/plugin-permission-react": "
|
|
90
|
-
"@backstage/test-utils": "
|
|
91
|
-
"@backstage/types": "
|
|
83
|
+
"@backstage/catalog-client": "1.11.0-next.0",
|
|
84
|
+
"@backstage/cli": "0.33.2-next.0",
|
|
85
|
+
"@backstage/core-app-api": "1.18.0",
|
|
86
|
+
"@backstage/dev-utils": "1.1.13-next.1",
|
|
87
|
+
"@backstage/plugin-catalog": "1.31.2-next.1",
|
|
88
|
+
"@backstage/plugin-permission-common": "0.9.1",
|
|
89
|
+
"@backstage/plugin-permission-react": "0.4.36",
|
|
90
|
+
"@backstage/test-utils": "1.7.11-next.0",
|
|
91
|
+
"@backstage/types": "1.2.1",
|
|
92
92
|
"@testing-library/dom": "^10.0.0",
|
|
93
93
|
"@testing-library/jest-dom": "^6.0.0",
|
|
94
94
|
"@testing-library/react": "^16.0.0",
|