@backstage/plugin-home 0.4.28-next.3 → 0.4.28

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,35 @@
1
1
  # @backstage/plugin-home
2
2
 
3
+ ## 0.4.28
4
+
5
+ ### Patch Changes
6
+
7
+ - 2e701b3796: Internal refactor to use `react-router-dom` rather than `react-router`.
8
+ - edf2404e9f: Adjusted the description's empty state on the starred entities table,
9
+ - 3280711113: Updated dependency `msw` to `^0.49.0`.
10
+ - Updated dependencies
11
+ - @backstage/core-plugin-api@1.2.0
12
+ - @backstage/core-components@0.12.1
13
+ - @backstage/plugin-catalog-react@1.2.2
14
+ - @backstage/plugin-stack-overflow@0.1.8
15
+ - @backstage/catalog-model@1.1.4
16
+ - @backstage/config@1.0.5
17
+ - @backstage/theme@0.2.16
18
+
19
+ ## 0.4.28-next.4
20
+
21
+ ### Patch Changes
22
+
23
+ - 2e701b3796: Internal refactor to use `react-router-dom` rather than `react-router`.
24
+ - Updated dependencies
25
+ - @backstage/core-components@0.12.1-next.4
26
+ - @backstage/plugin-catalog-react@1.2.2-next.4
27
+ - @backstage/plugin-stack-overflow@0.1.8-next.4
28
+ - @backstage/catalog-model@1.1.4-next.1
29
+ - @backstage/config@1.0.5-next.1
30
+ - @backstage/core-plugin-api@1.2.0-next.2
31
+ - @backstage/theme@0.2.16
32
+
3
33
  ## 0.4.28-next.3
4
34
 
5
35
  ### Patch Changes
@@ -3,7 +3,7 @@ import { Accordion, AccordionSummary, IconButton, Typography, AccordionDetails,
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
5
5
  import SettingsIcon from '@material-ui/icons/Settings';
6
- import 'react-router';
6
+ import 'react-router-dom';
7
7
  import { SettingsModal } from '../index.esm.js';
8
8
  import { InfoCard } from '@backstage/core-components';
9
9
  import '@backstage/core-plugin-api';
@@ -82,4 +82,4 @@ const ComponentTab = (props) => {
82
82
  };
83
83
 
84
84
  export { ComponentAccordion, ComponentTab, ComponentTabs };
85
- //# sourceMappingURL=index-f9c2c511.esm.js.map
85
+ //# sourceMappingURL=index-301c38cb.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-f9c2c511.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":";;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,kBAAoB,EAAA;AAAA,IAClB,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,GACnC;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA,MAAA;AAAA,GACT;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,kBAAA,GAAqB,CAAC,KAO7B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAW,GAAA,KAAA;AAAA,IACX,OAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACG,GAAA,UAAA;AAAA,GACD,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,CAAC,kBAAoB,EAAA,qBAAqB,CAAI,GAAA,KAAA,CAAM,SAAS,KAAK,CAAA,C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A,IAAA,CAAA;AAAA,GAEd,CACH,CAAA,CAAA;AAEJ;;ACjCa,MAAA,YAAA,GAAe,CAAC,KAIvB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,eAAA,EAAA,GAAoB,YAAe,GAAA,KAAA,CAAA;AAE3D,EAAO,OAAA,eAAA,mBACJ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAiB,GAAG,UAAA,EAAA,sCAClB,OAAQ,EAAA,IAAA,CACX,CAEA,mBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,IAAA,CAAA,CAAA;AAEb;;;;"}
1
+ {"version":3,"file":"index-301c38cb.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":";;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,kBAAoB,EAAA;AAAA,IAClB,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,GACnC;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA,MAAA;AAAA,GACT;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,kBAAA,GAAqB,CAAC,KAO7B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAW,GAAA,KAAA;AAAA,IACX,OAAA;AAAA,I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BAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAK,EAAA,GAAA;AAAA,MACJ,GAAI,GAAQ,KAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,EAAE,OAAS,EAAA,MAAA,EAAS,EAAA,GAAI,EAAC;AAAA,KAAA;AAAA,wCAEtD,SAAU,EAAA,IAAA,CAAA;AAAA,GAEd,CACH,CAAA,CAAA;AAEJ;;ACjCa,MAAA,YAAA,GAAe,CAAC,KAIvB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,eAAA,EAAA,GAAoB,YAAe,GAAA,KAAA,CAAA;AAE3D,EAAO,OAAA,eAAA,mBACJ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAiB,GAAG,UAAA,EAAA,sCAClB,OAAQ,EAAA,IAAA,CACX,CAEA,mBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,IAAA,CAAA,CAAA;AAEb;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useOutlet } from 'react-router';
2
+ import { useOutlet } from 'react-router-dom';
3
3
  export { SettingsModal } from '../index.esm.js';
4
4
  import '@backstage/core-plugin-api';
5
5
  import '@material-ui/core';
@@ -14,4 +14,4 @@ const HomepageCompositionRoot = (props) => {
14
14
  };
15
15
 
16
16
  export { HomepageCompositionRoot };
17
- //# sourceMappingURL=index-c5a3c510.esm.js.map
17
+ //# sourceMappingURL=index-7dc252d5.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-c5a3c510.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":";;;;;;;;AAmBa,MAAA,uBAAA,GAA0B,CAAC,KAGlC,KAAA;AAtBN,EAAA,IAAA,EAAA,CAAA;AAuBE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAA,CAAW,EAAM,GAAA,KAAA,CAAA,QAAA,KAAN,IAAkB,GAAA,EAAA,GAAA,MAAA,CAAA;AACnC,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB;;;;"}
1
+ {"version":3,"file":"index-7dc252d5.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-dom';\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":";;;;;;;;AAmBa,MAAA,uBAAA,GAA0B,CAAC,KAGlC,KAAA;AAtBN,EAAA,IAAA,EAAA,CAAA;AAuBE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAA,CAAW,EAAM,GAAA,KAAA,CAAA,QAAA,KAAN,IAAkB,GAAA,EAAA,GAAA,MAAA,CAAA;AACnC,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB;;;;"}
@@ -7,7 +7,7 @@ import StarIcon from '@material-ui/icons/Star';
7
7
  import React from 'react';
8
8
  import useAsync from 'react-use/lib/useAsync';
9
9
 
10
- const Content = () => {
10
+ const Content = (props) => {
11
11
  var _a;
12
12
  const catalogApi = useApi(catalogApiRef);
13
13
  const catalogEntityRoute = useRouteRef(entityRouteRef);
@@ -32,7 +32,7 @@ const Content = () => {
32
32
  })).items;
33
33
  }, [catalogApi, starredEntities]);
34
34
  if (starredEntities.size === 0)
35
- return /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "You do not have any starred entities yet!");
35
+ return /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, props.noStarredEntitiesMessage || "Click the star beside an entity name to add it to this list!");
36
36
  if (entities.loading) {
37
37
  return /* @__PURE__ */ React.createElement(Progress, null);
38
38
  }
@@ -63,4 +63,4 @@ const Content = () => {
63
63
  };
64
64
 
65
65
  export { Content };
66
- //# sourceMappingURL=index-d929e87c.esm.js.map
66
+ //# sourceMappingURL=index-f5981b27.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-f5981b27.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 */\n\nexport const Content = (props: {\n noStarredEntitiesMessage?: React.ReactNode | undefined;\n}) => {\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 {props.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 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":["_a"],"mappings":";;;;;;;;;AA4Ca,MAAA,OAAA,GAAU,CAAC,KAElB,KAAA;AA9CN,EAAA,IAAA,EAAA,CAAA;AA+CE,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA,CAAA;AACvC,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA,CAAA;AACrD,EAAA,MAAM,EAAE,eAAA,EAAiB,mBAAoB,EAAA,GAAI,kBAAmB,EAAA,CAAA;AAGpE,EAAM,MAAA,QAAA,GAAW,SAAS,YAAY;AACpC,IAAI,IAAA,CAAC,gBAAgB,IAAM,EAAA;AACzB,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAEA,IAAA,MAAM,MAAS,GAAA,CAAC,GAAG,eAAe,CAC/B,CAAA,GAAA,CAAI,CAAO,GAAA,KAAA,cAAA,CAAe,GAAG,CAAC,CAC9B,CAAA,GAAA,CAAI,CAAQ,GAAA,MAAA;AAAA,MACX,MAAM,GAAI,CAAA,IAAA;AAAA,MACV,sBAAsB,GAAI,CAAA,SAAA;AAAA,MAC1B,iBAAiB,GAAI,CAAA,IAAA;AAAA,KACrB,CAAA,CAAA,CAAA;AAEJ,IACE,OAAA,CAAA,MAAM,WAAW,WAAY,CAAA;AAAA,MAC3B,MAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,MAAA;AAAA,QACA,oBAAA;AAAA,QACA,eAAA;AAAA,QACA,gBAAA;AAAA,OACF;AAAA,KACD,CACD,EAAA,KAAA,CAAA;AAAA,GACD,EAAA,CAAC,UAAY,EAAA,eAAe,CAAC,CAAA,CAAA;AAEhC,EAAA,IAAI,gBAAgB,IAAS,KAAA,CAAA;AAC3B,IAAA,2CACG,UAAW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AAhB,IAAAA,GAAAA,GAAAA,GAAyB,OAAO,QAAS,CAAA,IAAA;AAAA,OAAA;AAAA,KAEtD,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,+CACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAM,qBACb,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,KAAA;AAAA,QACL,YAAW,EAAA,QAAA;AAAA,QACX,OAAA,EAAS,MAAM,mBAAA,CAAoB,MAAM,CAAA;AAAA,OAAA;AAAA,0CAExC,QAAS,EAAA,EAAA,KAAA,EAAO,EAAE,KAAA,EAAO,WAAa,EAAA,CAAA;AAAA,KAE3C,CACF,CACF,CAAA,CAAA;AAAA,GAEN,CAAA,CAAA,CAAA;AAEJ;;;;"}
package/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import React, { Suspense } from 'react';
3
3
  import { Dialog, DialogTitle, DialogContent, DialogActions, Button, IconButton, makeStyles } from '@material-ui/core';
4
4
  import SettingsIcon from '@material-ui/icons/Settings';
5
5
  import { InfoCard } from '@backstage/core-components';
6
- import 'react-router';
6
+ import 'react-router-dom';
7
7
 
8
8
  const SettingsModal = (props) => {
9
9
  const { open, close, componentName, children } = props;
@@ -75,7 +75,7 @@ const homePlugin = createPlugin({
75
75
  const HomepageCompositionRoot = homePlugin.provide(
76
76
  createRoutableExtension({
77
77
  name: "HomepageCompositionRoot",
78
- component: () => import('./esm/index-c5a3c510.esm.js').then((m) => m.HomepageCompositionRoot),
78
+ component: () => import('./esm/index-7dc252d5.esm.js').then((m) => m.HomepageCompositionRoot),
79
79
  mountPoint: rootRouteRef
80
80
  })
81
81
  );
@@ -83,7 +83,7 @@ const ComponentAccordion = homePlugin.provide(
83
83
  createComponentExtension({
84
84
  name: "ComponentAccordion",
85
85
  component: {
86
- lazy: () => import('./esm/index-f9c2c511.esm.js').then((m) => m.ComponentAccordion)
86
+ lazy: () => import('./esm/index-301c38cb.esm.js').then((m) => m.ComponentAccordion)
87
87
  }
88
88
  })
89
89
  );
@@ -91,7 +91,7 @@ const ComponentTabs = homePlugin.provide(
91
91
  createComponentExtension({
92
92
  name: "ComponentTabs",
93
93
  component: {
94
- lazy: () => import('./esm/index-f9c2c511.esm.js').then((m) => m.ComponentTabs)
94
+ lazy: () => import('./esm/index-301c38cb.esm.js').then((m) => m.ComponentTabs)
95
95
  }
96
96
  })
97
97
  );
@@ -99,7 +99,7 @@ const ComponentTab = homePlugin.provide(
99
99
  createComponentExtension({
100
100
  name: "ComponentTab",
101
101
  component: {
102
- lazy: () => import('./esm/index-f9c2c511.esm.js').then((m) => m.ComponentTab)
102
+ lazy: () => import('./esm/index-301c38cb.esm.js').then((m) => m.ComponentTab)
103
103
  }
104
104
  })
105
105
  );
@@ -137,7 +137,7 @@ const HomePageStarredEntities = homePlugin.provide(
137
137
  createCardExtension({
138
138
  name: "HomePageStarredEntities",
139
139
  title: "Your Starred Entities",
140
- components: () => import('./esm/index-d929e87c.esm.js')
140
+ components: () => import('./esm/index-f5981b27.esm.js')
141
141
  })
142
142
  );
143
143
  const HeaderWorldClock = homePlugin.provide(
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.28-next.3",
4
+ "version": "0.4.28",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -33,12 +33,12 @@
33
33
  "clean": "backstage-cli package clean"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/catalog-model": "^1.1.4-next.1",
37
- "@backstage/config": "^1.0.5-next.1",
38
- "@backstage/core-components": "^0.12.1-next.3",
39
- "@backstage/core-plugin-api": "^1.2.0-next.2",
40
- "@backstage/plugin-catalog-react": "^1.2.2-next.3",
41
- "@backstage/plugin-stack-overflow": "^0.1.8-next.3",
36
+ "@backstage/catalog-model": "^1.1.4",
37
+ "@backstage/config": "^1.0.5",
38
+ "@backstage/core-components": "^0.12.1",
39
+ "@backstage/core-plugin-api": "^1.2.0",
40
+ "@backstage/plugin-catalog-react": "^1.2.2",
41
+ "@backstage/plugin-stack-overflow": "^0.1.8",
42
42
  "@backstage/theme": "^0.2.16",
43
43
  "@material-ui/core": "^4.12.2",
44
44
  "@material-ui/icons": "^4.9.1",
@@ -49,13 +49,13 @@
49
49
  "peerDependencies": {
50
50
  "@types/react": "^16.13.1 || ^17.0.0",
51
51
  "react": "^16.13.1 || ^17.0.0",
52
- "react-router": "6.0.0-beta.0 || ^6.3.0"
52
+ "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@backstage/cli": "^0.21.2-next.3",
56
- "@backstage/core-app-api": "^1.2.1-next.3",
57
- "@backstage/dev-utils": "^1.0.9-next.3",
58
- "@backstage/test-utils": "^1.2.3-next.3",
55
+ "@backstage/cli": "^0.22.0",
56
+ "@backstage/core-app-api": "^1.3.0",
57
+ "@backstage/dev-utils": "^1.0.9",
58
+ "@backstage/test-utils": "^1.2.3",
59
59
  "@testing-library/jest-dom": "^5.10.1",
60
60
  "@testing-library/react": "^12.1.3",
61
61
  "@testing-library/user-event": "^14.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-d929e87c.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={() => toggle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