@backstage/plugin-home 0.4.21-next.1 → 0.4.21

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,39 @@
1
1
  # @backstage/plugin-home
2
2
 
3
+ ## 0.4.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b733d9d39: star icons now have the same yellow color as the other star icons when a entity is favourite
8
+ - 69093c5f91: Display entity titles in `StarredEntities` home page card (if defined) and don't show entities which no longer exist
9
+ - Updated dependencies
10
+ - @backstage/core-components@0.9.4
11
+ - @backstage/core-plugin-api@1.0.2
12
+ - @backstage/plugin-catalog-react@1.1.0
13
+ - @backstage/config@1.0.1
14
+ - @backstage/catalog-model@1.0.2
15
+ - @backstage/plugin-stack-overflow@0.1.1
16
+
17
+ ## 0.4.21-next.3
18
+
19
+ ### Patch Changes
20
+
21
+ - 69093c5f91: Display entity titles in `StarredEntities` home page card (if defined) and don't show entities which no longer exist
22
+ - Updated dependencies
23
+ - @backstage/core-components@0.9.4-next.2
24
+
25
+ ## 0.4.21-next.2
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+ - @backstage/core-components@0.9.4-next.1
31
+ - @backstage/config@1.0.1-next.0
32
+ - @backstage/plugin-catalog-react@1.1.0-next.2
33
+ - @backstage/catalog-model@1.0.2-next.0
34
+ - @backstage/core-plugin-api@1.0.2-next.1
35
+ - @backstage/plugin-stack-overflow@0.1.1-next.2
36
+
3
37
  ## 0.4.21-next.1
4
38
 
5
39
  ### Patch Changes
@@ -81,4 +81,4 @@ const ComponentTab = (props) => {
81
81
  };
82
82
 
83
83
  export { ComponentAccordion, ComponentTab, ComponentTabs };
84
- //# sourceMappingURL=index-3dffa83a.esm.js.map
84
+ //# sourceMappingURL=index-7e7a0983.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-3dffa83a.esm.js","sources":["../../src/componentRenderers/ComponentAccordion.tsx","../../src/componentRenderers/ComponentTabs/ComponentTabs.tsx","../../src/componentRenderers/ComponentTabs/ComponentTab.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 Accordion,\n AccordionDetails,\n AccordionSummary,\n Typography,\n IconButton,\n Theme,\n} from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nimport { SettingsModal } from '../components';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n settingsIconButton: {\n padding: theme.spacing(0, 1, 0, 0),\n },\n contentContainer: {\n width: '100%',\n },\n}));\n\nexport const ComponentAccordion = (props: {\n title: string;\n expanded?: boolean;\n Content: () => JSX.Element;\n Actions?: () => JSX.Element;\n Settings?: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const {\n title,\n expanded = false,\n Content,\n Actions,\n Settings,\n ContextProvider,\n ...childProps\n } = props;\n\n const classes = useStyles();\n const [settingsIsExpanded, setSettingsIsExpanded] = React.useState(false);\n const [isExpanded, setIsExpanded] = React.useState(expanded);\n\n const handleOpenSettings = (e: any) => {\n e.stopPropagation();\n setSettingsIsExpanded(prevState => !prevState);\n };\n\n const innerContent = (\n <>\n {Settings && (\n <SettingsModal\n open={settingsIsExpanded}\n close={() => setSettingsIsExpanded(false)}\n componentName={title}\n >\n <Settings />\n </SettingsModal>\n )}\n <Accordion\n expanded={isExpanded}\n onChange={(_e: any, expandedValue: boolean) =>\n setIsExpanded(expandedValue)\n }\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n {Settings && (\n <IconButton\n onClick={handleOpenSettings}\n className={classes.settingsIconButton}\n >\n <SettingsIcon />\n </IconButton>\n )}\n <Typography>{title}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <div className={classes.contentContainer}>\n <Content />\n {Actions && <Actions />}\n </div>\n </AccordionDetails>\n </Accordion>\n </>\n );\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>{innerContent}</ContextProvider>\n ) : (\n innerContent\n );\n};\n","/*\n * Copyright 2021 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 { Tabs, Tab } from '@material-ui/core';\nimport { InfoCard } from '@backstage/core-components';\n\ntype TabType = {\n label: string;\n Component: () => JSX.Element;\n};\n\nexport const ComponentTabs = (props: { title: string; tabs: TabType[] }) => {\n const { title, tabs } = props;\n\n const [value, setValue] = React.useState(0);\n\n const handleChange = (_event: any, newValue: number) => {\n setValue(newValue);\n };\n\n return (\n <InfoCard title={title}>\n <Tabs value={value} onChange={handleChange}>\n {tabs.map(t => (\n <Tab key={t.label} label={t.label} />\n ))}\n </Tabs>\n {tabs.map(({ Component }, idx) => (\n <div\n key={idx}\n {...(idx !== value ? { style: { display: 'none' } } : {})}\n >\n <Component />\n </div>\n ))}\n </InfoCard>\n );\n};\n","/*\n * Copyright 2021 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';\n\nexport const ComponentTab = (props: {\n title: string;\n Content: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const { title, Content, ContextProvider, ...childProps } = props;\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>\n <Content />\n </ContextProvider>\n ) : (\n <Content />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAYA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,kBAAkB,EAAE;AACtB,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG;AACH,CAAC,CAAC,CAAC,CAAC;AACQ,MAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK;AAC7C,EAAE,MAAM;AACR,IAAI,KAAK;AACT,IAAI,QAAQ,GAAG,KAAK;AACpB,IAAI,OAAO;AACX,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,IAAI,GAAG,UAAU;AACjB,GAAG,GAAG,KAAK,CAAC;AACZ,EAAE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;AAC9B,EAAE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5E,EAAE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/D,EAAE,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK;AACpC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACxB,IAAI,qBA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AAK,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D;;ACpBY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;AACnE,EAAE,OAAO,eAAe,mBAAmB,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE;AAChF,IAAI,GAAG,UAAU;AACjB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC9G;;;;"}
1
+ {"version":3,"file":"index-7e7a0983.esm.js","sources":["../../src/componentRenderers/ComponentAccordion.tsx","../../src/componentRenderers/ComponentTabs/ComponentTabs.tsx","../../src/componentRenderers/ComponentTabs/ComponentTab.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 Accordion,\n AccordionDetails,\n AccordionSummary,\n Typography,\n IconButton,\n Theme,\n} from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nimport { SettingsModal } from '../components';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n settingsIconButton: {\n padding: theme.spacing(0, 1, 0, 0),\n },\n contentContainer: {\n width: '100%',\n },\n}));\n\nexport const ComponentAccordion = (props: {\n title: string;\n expanded?: boolean;\n Content: () => JSX.Element;\n Actions?: () => JSX.Element;\n Settings?: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const {\n title,\n expanded = false,\n Content,\n Actions,\n Settings,\n ContextProvider,\n ...childProps\n } = props;\n\n const classes = useStyles();\n const [settingsIsExpanded, setSettingsIsExpanded] = React.useState(false);\n const [isExpanded, setIsExpanded] = React.useState(expanded);\n\n const handleOpenSettings = (e: any) => {\n e.stopPropagation();\n setSettingsIsExpanded(prevState => !prevState);\n };\n\n const innerContent = (\n <>\n {Settings && (\n <SettingsModal\n open={settingsIsExpanded}\n close={() => setSettingsIsExpanded(false)}\n componentName={title}\n >\n <Settings />\n </SettingsModal>\n )}\n <Accordion\n expanded={isExpanded}\n onChange={(_e: any, expandedValue: boolean) =>\n setIsExpanded(expandedValue)\n }\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n {Settings && (\n <IconButton\n onClick={handleOpenSettings}\n className={classes.settingsIconButton}\n >\n <SettingsIcon />\n </IconButton>\n )}\n <Typography>{title}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <div className={classes.contentContainer}>\n <Content />\n {Actions && <Actions />}\n </div>\n </AccordionDetails>\n </Accordion>\n </>\n );\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>{innerContent}</ContextProvider>\n ) : (\n innerContent\n );\n};\n","/*\n * Copyright 2021 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 { Tabs, Tab } from '@material-ui/core';\nimport { InfoCard } from '@backstage/core-components';\n\ntype TabType = {\n label: string;\n Component: () => JSX.Element;\n};\n\nexport const ComponentTabs = (props: { title: string; tabs: TabType[] }) => {\n const { title, tabs } = props;\n\n const [value, setValue] = React.useState(0);\n\n const handleChange = (_event: any, newValue: number) => {\n setValue(newValue);\n };\n\n return (\n <InfoCard title={title}>\n <Tabs value={value} onChange={handleChange}>\n {tabs.map(t => (\n <Tab key={t.label} label={t.label} />\n ))}\n </Tabs>\n {tabs.map(({ Component }, idx) => (\n <div\n key={idx}\n {...(idx !== value ? { style: { display: 'none' } } : {})}\n >\n <Component />\n </div>\n ))}\n </InfoCard>\n );\n};\n","/*\n * Copyright 2021 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';\n\nexport const ComponentTab = (props: {\n title: string;\n Content: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const { title, Content, ContextProvider, ...childProps } = props;\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>\n <Content />\n </ContextProvider>\n ) : (\n <Content />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAYA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,kBAAkB,EAAE;AACtB,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG;AACH,CAAC,CAAC,CAAC,CAAC;AACQ,MAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK;AAC7C,EAAE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AE;AAC/C,IAAI,KAAK;AACT,IAAI,QAAQ,EAAE,YAAY;AAC1B,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE;AAC9D,IAAI,GAAG,EAAE,CAAC,CAAC,KAAK;AAChB,IAAI,KAAK,EAAE,CAAC,CAAC,KAAK;AAClB,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,qBAAqB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACpF,IAAI,GAAG,EAAE,GAAG;AACZ,IAAI,GAAG,GAAG,KAAK,KAAK,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE;AAC1D,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D;;ACpBY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;AACnE,EAAE,OAAO,eAAe,mBAAmB,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE;AAChF,IAAI,GAAG,UAAU;AACjB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC9G;;;;"}
@@ -0,0 +1,67 @@
1
+ import { catalogApiRef, entityRouteRef, useStarredEntities, entityRouteParams } from '@backstage/plugin-catalog-react';
2
+ import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { useApi, useRouteRef } from '@backstage/core-plugin-api';
4
+ import { Progress, ResponseErrorPanel, Link } from '@backstage/core-components';
5
+ import { Typography, List, ListItem, ListItemText, ListItemSecondaryAction, Tooltip, IconButton } from '@material-ui/core';
6
+ import StarIcon from '@material-ui/icons/Star';
7
+ import React from 'react';
8
+ import useAsync from 'react-use/lib/useAsync';
9
+
10
+ const Content = () => {
11
+ var _a;
12
+ const catalogApi = useApi(catalogApiRef);
13
+ const catalogEntityRoute = useRouteRef(entityRouteRef);
14
+ const { starredEntities, toggleStarredEntity } = useStarredEntities();
15
+ const entities = useAsync(async () => {
16
+ if (!starredEntities.size) {
17
+ return [];
18
+ }
19
+ const filter = [...starredEntities].map((ent) => parseEntityRef(ent)).map((ref) => ({
20
+ kind: ref.kind,
21
+ "metadata.namespace": ref.namespace,
22
+ "metadata.name": ref.name
23
+ }));
24
+ return (await catalogApi.getEntities({
25
+ filter,
26
+ fields: [
27
+ "kind",
28
+ "metadata.namespace",
29
+ "metadata.name",
30
+ "metadata.title"
31
+ ]
32
+ })).items;
33
+ }, [catalogApi, starredEntities]);
34
+ if (starredEntities.size === 0)
35
+ return /* @__PURE__ */ React.createElement(Typography, {
36
+ variant: "body1"
37
+ }, "You do not have any starred entities yet!");
38
+ if (entities.loading) {
39
+ return /* @__PURE__ */ React.createElement(Progress, null);
40
+ }
41
+ return entities.error ? /* @__PURE__ */ React.createElement(ResponseErrorPanel, {
42
+ error: entities.error
43
+ }) : /* @__PURE__ */ React.createElement(List, null, (_a = entities.value) == null ? void 0 : _a.sort((a, b) => {
44
+ var _a2, _b;
45
+ return ((_a2 = a.metadata.title) != null ? _a2 : a.metadata.name).localeCompare((_b = b.metadata.title) != null ? _b : b.metadata.name);
46
+ }).map((entity) => {
47
+ var _a2;
48
+ return /* @__PURE__ */ React.createElement(ListItem, {
49
+ key: stringifyEntityRef(entity)
50
+ }, /* @__PURE__ */ React.createElement(Link, {
51
+ to: catalogEntityRoute(entityRouteParams(entity))
52
+ }, /* @__PURE__ */ React.createElement(ListItemText, {
53
+ primary: (_a2 = entity.metadata.title) != null ? _a2 : entity.metadata.name
54
+ })), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(Tooltip, {
55
+ title: "Remove from starred"
56
+ }, /* @__PURE__ */ React.createElement(IconButton, {
57
+ edge: "end",
58
+ "aria-label": "unstar",
59
+ onClick: () => toggleStarredEntity(entity)
60
+ }, /* @__PURE__ */ React.createElement(StarIcon, {
61
+ style: { color: "#f3ba37" }
62
+ })))));
63
+ }));
64
+ };
65
+
66
+ export { Content };
67
+ //# sourceMappingURL=index-8282634e.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-8282634e.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 entityRouteParams,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { Link, Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport {\n List,\n ListItem,\n ListItemSecondaryAction,\n IconButton,\n ListItemText,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport StarIcon from '@material-ui/icons/Star';\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\n/**\n * A component to display a list of starred entities for the user.\n *\n * @public\n */\nexport const Content = () => {\n const catalogApi = useApi(catalogApiRef);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\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 const filter = [...starredEntities]\n .map(ent => parseEntityRef(ent))\n .map(ref => ({\n kind: ref.kind,\n 'metadata.namespace': ref.namespace,\n 'metadata.name': ref.name,\n }));\n\n return (\n await catalogApi.getEntities({\n filter,\n fields: [\n 'kind',\n 'metadata.namespace',\n 'metadata.name',\n 'metadata.title',\n ],\n })\n ).items;\n }, [catalogApi, starredEntities]);\n\n if (starredEntities.size === 0)\n return (\n <Typography variant=\"body1\">\n You do not have any starred entities yet!\n </Typography>\n );\n\n if (entities.loading) {\n return <Progress />;\n }\n\n return entities.error ? (\n <ResponseErrorPanel error={entities.error} />\n ) : (\n <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 <ListItem key={stringifyEntityRef(entity)}>\n <Link to={catalogEntityRoute(entityRouteParams(entity))}>\n <ListItemText\n primary={entity.metadata.title ?? entity.metadata.name}\n />\n </Link>\n <ListItemSecondaryAction>\n <Tooltip title=\"Remove from starred\">\n <IconButton\n edge=\"end\"\n aria-label=\"unstar\"\n onClick={() => toggleStarredEntity(entity)}\n >\n <StarIcon style={{ color: '#f3ba37' }} />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n ))}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAqBY,MAAC,OAAO,GAAG,MAAM;AAC7B,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM,kBAAkB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AACzD,EAAE,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,kBAAkB,EAAE,CAAC;AACxE,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY;AACxC,IAAI,IAAI,CAAC,eAAe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K,kBAAkB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACrD,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;AACjC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACX,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -14,4 +14,4 @@ const HomepageCompositionRoot = (props) => {
14
14
  };
15
15
 
16
16
  export { HomepageCompositionRoot };
17
- //# sourceMappingURL=index-bcb2bdba.esm.js.map
17
+ //# sourceMappingURL=index-94b4f48a.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-bcb2bdba.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, { ReactNode } from 'react';\nimport { useOutlet } from 'react-router';\n\nexport const HomepageCompositionRoot = (props: {\n title?: string;\n children?: ReactNode;\n}) => {\n const outlet = useOutlet();\n const children = props.children ?? outlet;\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;;AAEY,MAAC,uBAAuB,GAAG,CAAC,KAAK,KAAK;AAClD,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC;AAC/D,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7E;;;;"}
1
+ {"version":3,"file":"index-94b4f48a.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, { ReactNode } from 'react';\nimport { useOutlet } from 'react-router';\n\nexport const HomepageCompositionRoot = (props: {\n title?: string;\n children?: ReactNode;\n}) => {\n const outlet = useOutlet();\n const children = props.children ?? outlet;\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;;AAEY,MAAC,uBAAuB,GAAG,CAAC,KAAK,KAAK;AAClD,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC;AAC/D,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7E;;;;"}
package/dist/index.esm.js CHANGED
@@ -138,25 +138,25 @@ const homePlugin = createPlugin({
138
138
  });
139
139
  const HomepageCompositionRoot = homePlugin.provide(createRoutableExtension({
140
140
  name: "HomepageCompositionRoot",
141
- component: () => import('./esm/index-bcb2bdba.esm.js').then((m) => m.HomepageCompositionRoot),
141
+ component: () => import('./esm/index-94b4f48a.esm.js').then((m) => m.HomepageCompositionRoot),
142
142
  mountPoint: rootRouteRef
143
143
  }));
144
144
  const ComponentAccordion = homePlugin.provide(createComponentExtension({
145
145
  name: "ComponentAccordion",
146
146
  component: {
147
- lazy: () => import('./esm/index-3dffa83a.esm.js').then((m) => m.ComponentAccordion)
147
+ lazy: () => import('./esm/index-7e7a0983.esm.js').then((m) => m.ComponentAccordion)
148
148
  }
149
149
  }));
150
150
  const ComponentTabs = homePlugin.provide(createComponentExtension({
151
151
  name: "ComponentTabs",
152
152
  component: {
153
- lazy: () => import('./esm/index-3dffa83a.esm.js').then((m) => m.ComponentTabs)
153
+ lazy: () => import('./esm/index-7e7a0983.esm.js').then((m) => m.ComponentTabs)
154
154
  }
155
155
  }));
156
156
  const ComponentTab = homePlugin.provide(createComponentExtension({
157
157
  name: "ComponentTab",
158
158
  component: {
159
- lazy: () => import('./esm/index-3dffa83a.esm.js').then((m) => m.ComponentTab)
159
+ lazy: () => import('./esm/index-7e7a0983.esm.js').then((m) => m.ComponentTab)
160
160
  }
161
161
  }));
162
162
  const WelcomeTitle = homePlugin.provide(createComponentExtension({
@@ -184,7 +184,7 @@ const HomePageToolkit = homePlugin.provide(createCardExtension({
184
184
  const HomePageStarredEntities = homePlugin.provide(createCardExtension({
185
185
  name: "HomePageStarredEntities",
186
186
  title: "Your Starred Entities",
187
- components: () => import('./esm/index-aa6e9ce0.esm.js')
187
+ components: () => import('./esm/index-8282634e.esm.js')
188
188
  }));
189
189
 
190
190
  const TemplateBackstageLogo = (props) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-home",
3
3
  "description": "A Backstage plugin that helps you build a home page",
4
- "version": "0.4.21-next.1",
4
+ "version": "0.4.21",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,12 +34,12 @@
34
34
  "clean": "backstage-cli package clean"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/catalog-model": "^1.0.1",
38
- "@backstage/config": "^1.0.0",
39
- "@backstage/core-components": "^0.9.4-next.0",
40
- "@backstage/core-plugin-api": "^1.0.2-next.0",
41
- "@backstage/plugin-catalog-react": "^1.1.0-next.1",
42
- "@backstage/plugin-stack-overflow": "^0.1.1-next.1",
37
+ "@backstage/catalog-model": "^1.0.2",
38
+ "@backstage/config": "^1.0.1",
39
+ "@backstage/core-components": "^0.9.4",
40
+ "@backstage/core-plugin-api": "^1.0.2",
41
+ "@backstage/plugin-catalog-react": "^1.1.0",
42
+ "@backstage/plugin-stack-overflow": "^0.1.1",
43
43
  "@backstage/theme": "^0.2.15",
44
44
  "@material-ui/core": "^4.12.2",
45
45
  "@material-ui/icons": "^4.9.1",
@@ -53,10 +53,10 @@
53
53
  "react": "^16.13.1 || ^17.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@backstage/cli": "^0.17.1-next.1",
57
- "@backstage/core-app-api": "^1.0.2-next.0",
58
- "@backstage/dev-utils": "^1.0.2-next.1",
59
- "@backstage/test-utils": "^1.1.0-next.1",
56
+ "@backstage/cli": "^0.17.1",
57
+ "@backstage/core-app-api": "^1.0.2",
58
+ "@backstage/dev-utils": "^1.0.2",
59
+ "@backstage/test-utils": "^1.1.0",
60
60
  "@testing-library/jest-dom": "^5.10.1",
61
61
  "@testing-library/react": "^12.1.3",
62
62
  "@testing-library/user-event": "^14.0.0",
@@ -68,5 +68,5 @@
68
68
  "files": [
69
69
  "dist"
70
70
  ],
71
- "gitHead": "0b3df66a238c66a5498dab85b1ed85a8607289f1"
71
+ "gitHead": "96323f280ba32ee526c5b151cda42260aee927c9"
72
72
  }
@@ -1,34 +0,0 @@
1
- import { entityRouteRef, useStarredEntities } from '@backstage/plugin-catalog-react';
2
- import { parseEntityRef } from '@backstage/catalog-model';
3
- import { useRouteRef } from '@backstage/core-plugin-api';
4
- import { Link } from '@backstage/core-components';
5
- import { Typography, List, ListItem, ListItemText, ListItemSecondaryAction, Tooltip, IconButton } from '@material-ui/core';
6
- import StarIcon from '@material-ui/icons/Star';
7
- import React from 'react';
8
-
9
- const Content = () => {
10
- const catalogEntityRoute = useRouteRef(entityRouteRef);
11
- const { starredEntities, toggleStarredEntity } = useStarredEntities();
12
- if (starredEntities.size === 0)
13
- return /* @__PURE__ */ React.createElement(Typography, {
14
- variant: "body1"
15
- }, "You do not have any starred entities yet!");
16
- return /* @__PURE__ */ React.createElement(List, null, Array.from(starredEntities).map((entity) => /* @__PURE__ */ React.createElement(ListItem, {
17
- key: entity
18
- }, /* @__PURE__ */ React.createElement(Link, {
19
- to: catalogEntityRoute(parseEntityRef(entity))
20
- }, /* @__PURE__ */ React.createElement(ListItemText, {
21
- primary: parseEntityRef(entity).name
22
- })), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(Tooltip, {
23
- title: "Remove from starred"
24
- }, /* @__PURE__ */ React.createElement(IconButton, {
25
- edge: "end",
26
- "aria-label": "unstar",
27
- onClick: () => toggleStarredEntity(entity)
28
- }, /* @__PURE__ */ React.createElement(StarIcon, {
29
- style: { color: "#f3ba37" }
30
- })))))));
31
- };
32
-
33
- export { Content };
34
- //# sourceMappingURL=index-aa6e9ce0.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-aa6e9ce0.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 useStarredEntities,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\nimport {\n List,\n ListItem,\n ListItemSecondaryAction,\n IconButton,\n ListItemText,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport StarIcon from '@material-ui/icons/Star';\nimport React from 'react';\n\n/**\n * A component to display a list of starred entities for the user.\n *\n * @public\n */\nexport const Content = () => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n\n if (starredEntities.size === 0)\n return (\n <Typography variant=\"body1\">\n You do not have any starred entities yet!\n </Typography>\n );\n\n return (\n <List>\n {Array.from(starredEntities).map(entity => (\n <ListItem key={entity}>\n <Link to={catalogEntityRoute(parseEntityRef(entity))}>\n <ListItemText primary={parseEntityRef(entity).name} />\n </Link>\n <ListItemSecondaryAction>\n <Tooltip title=\"Remove from starred\">\n <IconButton\n edge=\"end\"\n aria-label=\"unstar\"\n onClick={() => toggleStarredEntity(entity)}\n >\n <StarIcon style={{ color: '#f3ba37' }} />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n ))}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAkBY,MAAC,OAAO,GAAG,MAAM;AAC7B,EAAE,MAAM,kBAAkB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AACzD,EAAE,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,kBAAkB,EAAE,CAAC;AACxE,EAAE,IAAI,eAAe,CAAC,IAAI,KAAK,CAAC;AAChC,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AAC3D,MAAM,OAAO,EAAE,OAAO;AACtB,KAAK,EAAE,2CAA2C,CAAC,CAAC;AACpD,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,qBAAqB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACnJ,IAAI,GAAG,EAAE,MAAM;AACf,GAAG,kBAAkB,KAAK,CAAC,aAAa,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