@backstage/plugin-home 0.8.0 → 0.8.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/alpha/package.json +1 -1
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js +59 -11
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js.map +1 -1
- package/dist/homePageComponents/StarredEntities/Content.esm.js +19 -10
- package/dist/homePageComponents/StarredEntities/Content.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-home
|
|
2
2
|
|
|
3
|
+
## 0.8.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8b1b2cf: Improve Starred Entities UI to reduce whitespace and provide more context on the entities:
|
|
8
|
+
|
|
9
|
+
- Use the Entity Presentation API (via `<EntityDisplayName>`) to display the entity's name
|
|
10
|
+
- Component's `kind` and `spec.type` are displayed as a secondary text
|
|
11
|
+
- List items are condensed to reduce unnecessary spacing
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/core-components@0.16.0-next.0
|
|
15
|
+
- @backstage/catalog-client@1.8.0-next.0
|
|
16
|
+
- @backstage/catalog-model@1.7.0
|
|
17
|
+
- @backstage/config@1.2.0
|
|
18
|
+
- @backstage/core-app-api@1.15.1
|
|
19
|
+
- @backstage/core-compat-api@0.3.2-next.0
|
|
20
|
+
- @backstage/core-plugin-api@1.10.0
|
|
21
|
+
- @backstage/frontend-plugin-api@0.9.1-next.0
|
|
22
|
+
- @backstage/theme@0.6.0
|
|
23
|
+
- @backstage/plugin-catalog-react@1.14.1-next.0
|
|
24
|
+
- @backstage/plugin-home-react@0.1.19-next.0
|
|
25
|
+
|
|
3
26
|
## 0.8.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/alpha/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { entityRouteRef, entityRouteParams } from '@backstage/plugin-catalog-react';
|
|
1
|
+
import { entityRouteRef, entityRouteParams, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
3
2
|
import ListItem from '@material-ui/core/ListItem';
|
|
4
3
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
5
4
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
@@ -7,21 +6,70 @@ import React from 'react';
|
|
|
7
6
|
import { Link } from 'react-router-dom';
|
|
8
7
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
9
8
|
import { FavoriteToggle } from '@backstage/core-components';
|
|
9
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
10
10
|
|
|
11
|
+
const useStyles = makeStyles((theme) => ({
|
|
12
|
+
listItem: {
|
|
13
|
+
paddingBottom: theme.spacing(0),
|
|
14
|
+
paddingTop: theme.spacing(0)
|
|
15
|
+
},
|
|
16
|
+
secondary: {
|
|
17
|
+
textTransform: "uppercase"
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
11
20
|
const StarredEntityListItem = ({
|
|
12
21
|
entity,
|
|
13
|
-
onToggleStarredEntity
|
|
22
|
+
onToggleStarredEntity,
|
|
23
|
+
showKind
|
|
14
24
|
}) => {
|
|
25
|
+
const classes = useStyles();
|
|
15
26
|
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
let secondaryText = "";
|
|
28
|
+
if (showKind) {
|
|
29
|
+
secondaryText += entity.kind.toLocaleLowerCase("en-US");
|
|
30
|
+
}
|
|
31
|
+
if (entity.spec && "type" in entity.spec) {
|
|
32
|
+
if (showKind) {
|
|
33
|
+
secondaryText += " \u2014 ";
|
|
23
34
|
}
|
|
24
|
-
|
|
35
|
+
secondaryText += entity.spec.type.toLocaleLowerCase(
|
|
36
|
+
"en-US"
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ React.createElement(
|
|
40
|
+
ListItem,
|
|
41
|
+
{
|
|
42
|
+
dense: true,
|
|
43
|
+
className: classes.listItem,
|
|
44
|
+
component: Link,
|
|
45
|
+
button: true,
|
|
46
|
+
to: catalogEntityRoute(entityRouteParams(entity))
|
|
47
|
+
},
|
|
48
|
+
/* @__PURE__ */ React.createElement(
|
|
49
|
+
ListItemIcon,
|
|
50
|
+
{
|
|
51
|
+
onClick: (e) => {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
/* @__PURE__ */ React.createElement(
|
|
56
|
+
FavoriteToggle,
|
|
57
|
+
{
|
|
58
|
+
id: `remove-favorite-${entity.metadata.uid}`,
|
|
59
|
+
title: "Remove entity from favorites",
|
|
60
|
+
isFavorite: true,
|
|
61
|
+
onToggle: () => onToggleStarredEntity(entity)
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ React.createElement(
|
|
66
|
+
ListItemText,
|
|
67
|
+
{
|
|
68
|
+
primary: /* @__PURE__ */ React.createElement(EntityDisplayName, { hideIcon: true, entityRef: entity }),
|
|
69
|
+
secondary: secondaryText
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
);
|
|
25
73
|
};
|
|
26
74
|
|
|
27
75
|
export { StarredEntityListItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarredEntityListItem.esm.js","sources":["../../../src/components/StarredEntityListItem/StarredEntityListItem.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 */\nimport { Entity
|
|
1
|
+
{"version":3,"file":"StarredEntityListItem.esm.js","sources":["../../../src/components/StarredEntityListItem/StarredEntityListItem.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 */\nimport { Entity } from '@backstage/catalog-model';\nimport {\n EntityDisplayName,\n entityRouteParams,\n} from '@backstage/plugin-catalog-react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { FavoriteToggle } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype EntityListItemProps = {\n entity: Entity;\n onToggleStarredEntity: (entity: Entity) => void;\n showKind?: boolean;\n};\n\nconst useStyles = makeStyles(theme => ({\n listItem: {\n paddingBottom: theme.spacing(0),\n paddingTop: theme.spacing(0),\n },\n secondary: {\n textTransform: 'uppercase',\n },\n}));\n\nexport const StarredEntityListItem = ({\n entity,\n onToggleStarredEntity,\n showKind,\n}: EntityListItemProps) => {\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n\n let secondaryText = '';\n if (showKind) {\n secondaryText += entity.kind.toLocaleLowerCase('en-US');\n }\n if (entity.spec && 'type' in entity.spec) {\n if (showKind) {\n secondaryText += ' — ';\n }\n secondaryText += (entity.spec as { type: string }).type.toLocaleLowerCase(\n 'en-US',\n );\n }\n\n return (\n <ListItem\n dense\n className={classes.listItem}\n component={Link}\n button\n to={catalogEntityRoute(entityRouteParams(entity))}\n >\n <ListItemIcon\n // Prevent following the link when clicking on the icon\n onClick={e => {\n e.preventDefault();\n }}\n >\n <FavoriteToggle\n id={`remove-favorite-${entity.metadata.uid}`}\n title=\"Remove entity from favorites\"\n isFavorite\n onToggle={() => onToggleStarredEntity(entity)}\n />\n </ListItemIcon>\n <ListItemText\n primary={<EntityDisplayName hideIcon entityRef={entity} />}\n secondary={secondaryText}\n />\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAoCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,QAAU,EAAA;AAAA,IACR,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC9B,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GAC7B;AAAA,EACA,SAAW,EAAA;AAAA,IACT,aAAe,EAAA,WAAA;AAAA,GACjB;AACF,CAAE,CAAA,CAAA,CAAA;AAEK,MAAM,wBAAwB,CAAC;AAAA,EACpC,MAAA;AAAA,EACA,qBAAA;AAAA,EACA,QAAA;AACF,CAA2B,KAAA;AACzB,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA,CAAA;AAErD,EAAA,IAAI,aAAgB,GAAA,EAAA,CAAA;AACpB,EAAA,IAAI,QAAU,EAAA;AACZ,IAAiB,aAAA,IAAA,MAAA,CAAO,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAA,CAAA;AAAA,GACxD;AACA,EAAA,IAAI,MAAO,CAAA,IAAA,IAAQ,MAAU,IAAA,MAAA,CAAO,IAAM,EAAA;AACxC,IAAA,IAAI,QAAU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|
10
10
|
import useAsync from 'react-use/esm/useAsync';
|
|
11
11
|
import { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem.esm.js';
|
|
12
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
12
13
|
|
|
14
|
+
const useStyles = makeStyles((theme) => ({
|
|
15
|
+
tabs: {
|
|
16
|
+
marginBottom: theme.spacing(1)
|
|
17
|
+
},
|
|
18
|
+
list: {
|
|
19
|
+
paddingTop: 0,
|
|
20
|
+
paddingBottom: 0
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
13
23
|
const Content = ({
|
|
14
24
|
noStarredEntitiesMessage,
|
|
15
25
|
groupByKind
|
|
16
26
|
}) => {
|
|
27
|
+
const classes = useStyles();
|
|
17
28
|
const catalogApi = useApi(catalogApiRef);
|
|
18
29
|
const { starredEntities, toggleStarredEntity } = useStarredEntities();
|
|
19
30
|
const [activeTab, setActiveTab] = React.useState(0);
|
|
@@ -23,12 +34,7 @@ const Content = ({
|
|
|
23
34
|
}
|
|
24
35
|
return (await catalogApi.getEntitiesByRefs({
|
|
25
36
|
entityRefs: [...starredEntities],
|
|
26
|
-
fields: [
|
|
27
|
-
"kind",
|
|
28
|
-
"metadata.namespace",
|
|
29
|
-
"metadata.name",
|
|
30
|
-
"metadata.title"
|
|
31
|
-
]
|
|
37
|
+
fields: ["kind", "metadata.namespace", "metadata.name", "spec.type"]
|
|
32
38
|
})).items.filter((e) => !!e);
|
|
33
39
|
}, [catalogApi, starredEntities]);
|
|
34
40
|
if (starredEntities.size === 0)
|
|
@@ -45,7 +51,7 @@ const Content = ({
|
|
|
45
51
|
groupedEntities[kind].push(entity);
|
|
46
52
|
});
|
|
47
53
|
const groupByKindEntries = Object.entries(groupedEntities);
|
|
48
|
-
return entities.error ? /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error: entities.error }) : /* @__PURE__ */ React.createElement("div", null, !groupByKind && /* @__PURE__ */ React.createElement(List,
|
|
54
|
+
return entities.error ? /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error: entities.error }) : /* @__PURE__ */ React.createElement("div", null, !groupByKind && /* @__PURE__ */ React.createElement(List, { className: classes.list }, entities.value?.sort(
|
|
49
55
|
(a, b) => (a.metadata.title ?? a.metadata.name).localeCompare(
|
|
50
56
|
b.metadata.title ?? b.metadata.name
|
|
51
57
|
)
|
|
@@ -54,11 +60,13 @@ const Content = ({
|
|
|
54
60
|
{
|
|
55
61
|
key: stringifyEntityRef(entity),
|
|
56
62
|
entity,
|
|
57
|
-
onToggleStarredEntity: toggleStarredEntity
|
|
63
|
+
onToggleStarredEntity: toggleStarredEntity,
|
|
64
|
+
showKind: true
|
|
58
65
|
}
|
|
59
66
|
))), groupByKind && /* @__PURE__ */ React.createElement(
|
|
60
67
|
Tabs,
|
|
61
68
|
{
|
|
69
|
+
className: classes.tabs,
|
|
62
70
|
value: activeTab,
|
|
63
71
|
onChange: (_, newValue) => setActiveTab(newValue),
|
|
64
72
|
variant: "scrollable",
|
|
@@ -66,7 +74,7 @@ const Content = ({
|
|
|
66
74
|
"aria-label": "entity-tabs"
|
|
67
75
|
},
|
|
68
76
|
groupByKindEntries.map(([kind]) => /* @__PURE__ */ React.createElement(Tab, { key: kind, label: kind }))
|
|
69
|
-
), groupByKind && groupByKindEntries.map(([kind, entitiesByKind], index) => /* @__PURE__ */ React.createElement("div", { key: kind, hidden: groupByKind && activeTab !== index }, /* @__PURE__ */ React.createElement(List,
|
|
77
|
+
), groupByKind && groupByKindEntries.map(([kind, entitiesByKind], index) => /* @__PURE__ */ React.createElement("div", { key: kind, hidden: groupByKind && activeTab !== index }, /* @__PURE__ */ React.createElement(List, { className: classes.list }, entitiesByKind?.sort(
|
|
70
78
|
(a, b) => (a.metadata.title ?? a.metadata.name).localeCompare(
|
|
71
79
|
b.metadata.title ?? b.metadata.name
|
|
72
80
|
)
|
|
@@ -75,7 +83,8 @@ const Content = ({
|
|
|
75
83
|
{
|
|
76
84
|
key: stringifyEntityRef(entity),
|
|
77
85
|
entity,
|
|
78
|
-
onToggleStarredEntity: toggleStarredEntity
|
|
86
|
+
onToggleStarredEntity: toggleStarredEntity,
|
|
87
|
+
showKind: false
|
|
79
88
|
}
|
|
80
89
|
))))));
|
|
81
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/StarredEntities/Content.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 {\n catalogApiRef,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport Typography from '@material-ui/core/Typography';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem';\n\
|
|
1
|
+
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/StarredEntities/Content.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 {\n catalogApiRef,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport Typography from '@material-ui/core/Typography';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n tabs: {\n marginBottom: theme.spacing(1),\n },\n list: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n}));\n\n/**\n * Props for the StarredEntities component\n *\n * @public\n */\nexport type StarredEntitiesProps = {\n noStarredEntitiesMessage?: React.ReactNode | undefined;\n groupByKind?: boolean;\n};\n\n/**\n * A component to display a list of starred entities for the user.\n *\n * @public\n */\nexport const Content = ({\n noStarredEntitiesMessage,\n groupByKind,\n}: StarredEntitiesProps) => {\n const classes = useStyles();\n const catalogApi = useApi(catalogApiRef);\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n const [activeTab, setActiveTab] = React.useState(0);\n\n // Grab starred entities from catalog to ensure they still exist and also retrieve display titles\n const entities = useAsync(async () => {\n if (!starredEntities.size) {\n return [];\n }\n\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: [...starredEntities],\n fields: ['kind', 'metadata.namespace', 'metadata.name', 'spec.type'],\n })\n ).items.filter((e): e is Entity => !!e);\n }, [catalogApi, starredEntities]);\n\n if (starredEntities.size === 0)\n return (\n <Typography variant=\"body1\">\n {noStarredEntitiesMessage ||\n 'Click the star beside an entity name to add it to this list!'}\n </Typography>\n );\n\n if (entities.loading) {\n return <Progress />;\n }\n\n const groupedEntities: { [kind: string]: Entity[] } = {};\n entities.value?.forEach(entity => {\n const kind = entity.kind;\n if (!groupedEntities[kind]) {\n groupedEntities[kind] = [];\n }\n groupedEntities[kind].push(entity);\n });\n\n const groupByKindEntries = Object.entries(groupedEntities);\n\n return entities.error ? (\n <ResponseErrorPanel error={entities.error} />\n ) : (\n <div>\n {!groupByKind && (\n <List className={classes.list}>\n {entities.value\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEntityRef(entity)}\n entity={entity}\n onToggleStarredEntity={toggleStarredEntity}\n showKind\n />\n ))}\n </List>\n )}\n\n {groupByKind && (\n <Tabs\n className={classes.tabs}\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label=\"entity-tabs\"\n >\n {groupByKindEntries.map(([kind]) => (\n <Tab key={kind} label={kind} />\n ))}\n </Tabs>\n )}\n\n {groupByKind &&\n groupByKindEntries.map(([kind, entitiesByKind], index) => (\n <div key={kind} hidden={groupByKind && activeTab !== index}>\n <List className={classes.list}>\n {entitiesByKind\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEntityRef(entity)}\n entity={entity}\n onToggleStarredEntity={toggleStarredEntity}\n showKind={false}\n />\n ))}\n </List>\n </div>\n ))}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GAC/B;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,CAAA;AAAA,IACZ,aAAe,EAAA,CAAA;AAAA,GACjB;AACF,CAAE,CAAA,CAAA,CAAA;AAiB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,MACR,aAAc,EAAA,MAAA;AAAA,MACd,YAAW,EAAA,aAAA;AAAA,KAAA;AAAA,IAEV,kBAAmB,CAAA,GAAA,CAAI,CAAC,CAAC,IAAI,CAAA,qBAC3B,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,GAAK,EAAA,IAAA,EAAM,KAAO,EAAA,IAAA,EAAM,CAC9B,CAAA;AAAA,GACH,EAGD,eACC,kBAAmB,CAAA,GAAA,CAAI,CAAC,CAAC,IAAA,EAAM,cAAc,CAAA,EAAG,KAC9C,qBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,GAAK,EAAA,IAAA,EAAM,MAAQ,EAAA,WAAA,IAAe,SAAc,KAAA,KAAA,EAAA,sCAClD,IAAK,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAAA,EACtB,cACG,EAAA,IAAA;AAAA,IAAK,CAAC,GAAG,CACR,KAAA,CAAA,CAAA,CAAE,SAAS,KAAS,IAAA,CAAA,CAAE,SAAS,IAAM,EAAA,aAAA;AAAA,MACpC,CAAE,CAAA,QAAA,CAAS,KAAS,IAAA,CAAA,CAAE,QAAS,CAAA,IAAA;AAAA,KACjC;AAAA,GACF,CACC,IAAI,CACH,MAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,GAAA,EAAK,mBAAmB,MAAM,CAAA;AAAA,MAC9B,MAAA;AAAA,MACA,qBAAuB,EAAA,mBAAA;AAAA,MACvB,QAAU,EAAA,KAAA;AAAA,KAAA;AAAA,GAEb,CACL,CACF,CACD,CACL,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-home",
|
|
3
|
-
"version": "0.8.0",
|
|
3
|
+
"version": "0.8.1-next.0",
|
|
4
4
|
"description": "A Backstage plugin that helps you build a home page",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
"test": "backstage-cli package test"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/catalog-client": "
|
|
60
|
-
"@backstage/catalog-model": "
|
|
61
|
-
"@backstage/config": "
|
|
62
|
-
"@backstage/core-app-api": "
|
|
63
|
-
"@backstage/core-compat-api": "
|
|
64
|
-
"@backstage/core-components": "
|
|
65
|
-
"@backstage/core-plugin-api": "
|
|
66
|
-
"@backstage/frontend-plugin-api": "
|
|
67
|
-
"@backstage/plugin-catalog-react": "
|
|
68
|
-
"@backstage/plugin-home-react": "
|
|
69
|
-
"@backstage/theme": "
|
|
59
|
+
"@backstage/catalog-client": "1.8.0-next.0",
|
|
60
|
+
"@backstage/catalog-model": "1.7.0",
|
|
61
|
+
"@backstage/config": "1.2.0",
|
|
62
|
+
"@backstage/core-app-api": "1.15.1",
|
|
63
|
+
"@backstage/core-compat-api": "0.3.2-next.0",
|
|
64
|
+
"@backstage/core-components": "0.16.0-next.0",
|
|
65
|
+
"@backstage/core-plugin-api": "1.10.0",
|
|
66
|
+
"@backstage/frontend-plugin-api": "0.9.1-next.0",
|
|
67
|
+
"@backstage/plugin-catalog-react": "1.14.1-next.0",
|
|
68
|
+
"@backstage/plugin-home-react": "0.1.19-next.0",
|
|
69
|
+
"@backstage/theme": "0.6.0",
|
|
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",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"zod": "^3.22.4"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@backstage/cli": "
|
|
86
|
-
"@backstage/dev-utils": "
|
|
87
|
-
"@backstage/test-utils": "
|
|
85
|
+
"@backstage/cli": "0.29.0-next.0",
|
|
86
|
+
"@backstage/dev-utils": "1.1.3-next.0",
|
|
87
|
+
"@backstage/test-utils": "1.7.0",
|
|
88
88
|
"@testing-library/dom": "^10.0.0",
|
|
89
89
|
"@testing-library/jest-dom": "^6.0.0",
|
|
90
90
|
"@testing-library/react": "^16.0.0",
|