@backstage/plugin-devtools 0.0.0-nightly-20240122021809 → 0.0.0-nightly-20240124021659

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,14 +1,31 @@
1
1
  # @backstage/plugin-devtools
2
2
 
3
- ## 0.0.0-nightly-20240122021809
3
+ ## 0.0.0-nightly-20240124021659
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - c12a86c: Refactored code to improve accessibility by moving elements outside the `ul` tag and placing them appropriately. Also adjusted theme to offer better contrast.
7
8
  - b89d8be: Added alpha support for the New Frontend System (Declarative Integration)
8
9
  - 995d280: Updated imports from named to default imports to help with the Material UI v4 to v5 migration
9
10
  - Updated dependencies
10
- - @backstage/core-compat-api@0.0.0-nightly-20240122021809
11
- - @backstage/frontend-plugin-api@0.0.0-nightly-20240122021809
11
+ - @backstage/core-compat-api@0.0.0-nightly-20240124021659
12
+ - @backstage/frontend-plugin-api@0.0.0-nightly-20240124021659
13
+ - @backstage/core-components@0.13.10
14
+ - @backstage/core-plugin-api@1.8.2
15
+ - @backstage/errors@1.2.3
16
+ - @backstage/plugin-devtools-common@0.1.8
17
+ - @backstage/plugin-permission-react@0.4.19
18
+
19
+ ## 0.1.9-next.0
20
+
21
+ ### Patch Changes
22
+
23
+ - c12a86c: Refactored code to improve accessibility by moving elements outside the `ul` tag and placing them appropriately. Also adjusted theme to offer better contrast.
24
+ - b89d8be: Added alpha support for the New Frontend System (Declarative Integration)
25
+ - 995d280: Updated imports from named to default imports to help with the Material UI v4 to v5 migration
26
+ - Updated dependencies
27
+ - @backstage/core-compat-api@0.1.2-next.0
28
+ - @backstage/frontend-plugin-api@0.5.1-next.0
12
29
  - @backstage/core-components@0.13.10
13
30
  - @backstage/core-plugin-api@1.8.2
14
31
  - @backstage/errors@1.2.3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-devtools",
3
- "version": "0.0.0-nightly-20240122021809",
3
+ "version": "0.0.0-nightly-20240124021659",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.esm.js CHANGED
@@ -16,7 +16,7 @@ const devToolsApi = createApiExtension({
16
16
  const devToolsPage = createPageExtension({
17
17
  defaultPath: "/devtools",
18
18
  routeRef: convertLegacyRouteRef(rootRouteRef),
19
- loader: () => import('./esm/index-83ffc2b9.esm.js').then(
19
+ loader: () => import('./esm/index-a2af236c.esm.js').then(
20
20
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.DevToolsPage, null))
21
21
  )
22
22
  });
@@ -16,6 +16,7 @@ import List from '@material-ui/core/List';
16
16
  import ListItem from '@material-ui/core/ListItem';
17
17
  import ListItemAvatar from '@material-ui/core/ListItemAvatar';
18
18
  import ListItemText from '@material-ui/core/ListItemText';
19
+ import Button from '@material-ui/core/Button';
19
20
  import DescriptionIcon from '@material-ui/icons/Description';
20
21
  import MemoryIcon from '@material-ui/icons/Memory';
21
22
  import DeveloperBoardIcon from '@material-ui/icons/DeveloperBoard';
@@ -81,7 +82,7 @@ const ConfigContent = () => {
81
82
  src: configInfo.config,
82
83
  name: "config",
83
84
  enableClipboard: false,
84
- theme: theme.palette.type === "dark" ? "monokai" : "rjv-default"
85
+ theme: theme.palette.type === "dark" ? "chalk" : "rjv-default"
85
86
  }
86
87
  )));
87
88
  };
@@ -124,6 +125,7 @@ const BackstageLogoIcon = (props) => /* @__PURE__ */ React.createElement(SvgIcon
124
125
  const useStyles = makeStyles(
125
126
  (theme) => createStyles({
126
127
  paperStyle: {
128
+ display: "flex",
127
129
  marginBottom: theme.spacing(2)
128
130
  },
129
131
  flexContainer: {
@@ -187,18 +189,17 @@ const InfoContent = () => {
187
189
  primary: "Backstage Version",
188
190
  secondary: about == null ? void 0 : about.backstageVersion
189
191
  }
190
- )), /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", variant: "middle", flexItem: true }), /* @__PURE__ */ React.createElement(
191
- ListItem,
192
+ ))), /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", variant: "middle", flexItem: true }), /* @__PURE__ */ React.createElement(
193
+ Button,
192
194
  {
193
- button: true,
194
195
  onClick: () => {
195
196
  copyToClipboard({ about });
196
197
  },
197
- className: classes.copyButton
198
+ className: classes.copyButton,
199
+ startIcon: /* @__PURE__ */ React.createElement(FileCopyIcon, null)
198
200
  },
199
- /* @__PURE__ */ React.createElement(ListItemAvatar, null, /* @__PURE__ */ React.createElement(Avatar, null, /* @__PURE__ */ React.createElement(FileCopyIcon, null))),
200
- /* @__PURE__ */ React.createElement(ListItemText, { primary: "Copy Info to Clipboard" })
201
- ))), /* @__PURE__ */ React.createElement(InfoDependenciesTable, { infoDependencies: about == null ? void 0 : about.dependencies }));
201
+ "Copy Info to Clipboard"
202
+ )), /* @__PURE__ */ React.createElement(InfoDependenciesTable, { infoDependencies: about == null ? void 0 : about.dependencies }));
202
203
  };
203
204
 
204
205
  const dataKey = "plugin.devtools.devtoolsLayoutRoute";
@@ -222,4 +223,4 @@ const DevToolsLayout = ({
222
223
  DevToolsLayout.Route = Route;
223
224
 
224
225
  export { ConfigContent as C, DevToolsLayout as D, InfoContent as I };
225
- //# sourceMappingURL=DevToolsLayout-a33aa3a6.esm.js.map
226
+ //# sourceMappingURL=DevToolsLayout-638d22a2.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevToolsLayout-638d22a2.esm.js","sources":["../../src/hooks/useConfig.ts","../../src/hooks/useInfo.ts","../../src/components/Content/ConfigContent/ConfigContent.tsx","../../src/components/Content/InfoContent/InfoDependenciesTable.tsx","../../src/components/Content/InfoContent/BackstageLogoIcon.tsx","../../src/components/Content/InfoContent/InfoContent.tsx","../../src/components/DevToolsLayout/DevToolsLayout.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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ConfigInfo } from '@backstage/plugin-devtools-common';\n\nexport function useConfig(): {\n configInfo?: ConfigInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getConfig();\n }, [api]);\n\n return {\n configInfo: value,\n loading,\n error,\n };\n}\n","/*\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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { DevToolsInfo } from '@backstage/plugin-devtools-common';\n\nexport function useInfo(): {\n about?: DevToolsInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getInfo();\n }, [api]);\n\n return {\n about: value,\n loading,\n error,\n };\n}\n","/*\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 { Progress, WarningPanel } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport {\n createStyles,\n makeStyles,\n Theme,\n useTheme,\n} from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport ReactJson from 'react-json-view';\nimport { useConfig } from '../../../hooks';\nimport { ConfigError } from '@backstage/plugin-devtools-common';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n warningStyle: {\n paddingBottom: theme.spacing(2),\n },\n paperStyle: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const WarningContent = ({ error }: { error: ConfigError }) => {\n if (!error.messages) {\n return <Typography>{error.message}</Typography>;\n }\n\n const messages = error.messages as string[];\n\n return (\n <Box>\n {messages.map(message => (\n <Typography>{message}</Typography>\n ))}\n </Box>\n );\n};\n\n/** @public */\nexport const ConfigContent = () => {\n const classes = useStyles();\n const theme = useTheme();\n const { configInfo, loading, error } = useConfig();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!configInfo) {\n return <Alert severity=\"error\">Unable to load config data</Alert>;\n }\n\n return (\n <Box>\n {configInfo && configInfo.error && (\n <Box className={classes.warningStyle}>\n <WarningPanel title=\"Config validation failed\">\n <WarningContent error={configInfo.error} />\n </WarningPanel>\n </Box>\n )}\n <Paper className={classes.paperStyle}>\n <ReactJson\n src={configInfo.config as object}\n name=\"config\"\n enableClipboard={false}\n theme={theme.palette.type === 'dark' ? 'chalk' : 'rjv-default'}\n />\n </Paper>\n </Box>\n );\n};\n","/*\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 { Table, TableColumn } from '@backstage/core-components';\nimport { PackageDependency } from '@backstage/plugin-devtools-common';\n\nimport React from 'react';\n\nconst columns: TableColumn[] = [\n {\n title: 'Name',\n width: 'auto',\n field: 'name',\n defaultSort: 'asc',\n },\n {\n title: 'Versions',\n width: 'auto',\n field: 'versions',\n },\n];\n\nexport const InfoDependenciesTable = ({\n infoDependencies,\n}: {\n infoDependencies: PackageDependency[] | undefined;\n}) => {\n return (\n <Table\n title=\"Package Dependencies\"\n options={{\n paging: true,\n pageSize: 15,\n pageSizeOptions: [15, 30, 100],\n loadingType: 'linear',\n padding: 'dense',\n }}\n columns={columns}\n data={infoDependencies || []}\n />\n );\n};\n","/*\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 SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nimport React from 'react';\n\nexport const BackstageLogoIcon = (props: SvgIconProps) => (\n <SvgIcon {...props} viewBox=\"0 0 337.46 428.5\">\n <path d=\"M303 166.05a80.69 80.69 0 0013.45-10.37c.79-.77 1.55-1.53 2.3-2.3a83.12 83.12 0 007.93-9.38 63.69 63.69 0 006.32-10.77 48.58 48.58 0 004.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56 0 78.3 115.23 0 190.25l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.69 19.16-18.36 25.52-42.12 13.7-61.87a49.22 49.22 0 00-6.8-8.87 89.17 89.17 0 0019.32 2.15h.15a85.08 85.08 0 0031-5.79 80.88 80.88 0 0012.85-6.45zm-100.55 59.81c-19.32 18.51-50.4 21.23-75.7 5.9l-75.14-45.61 67.45-64.64 76.41 46.38c27.53 16.69 26.02 39.72 6.98 57.97zm8.93-82.22l-70.65-42.89L205.14 39l69.37 42.1c25.94 15.72 29.31 37 10.55 55a60.69 60.69 0 01-73.68 7.54zm29.86 190c-19.57 18.75-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 282.52v24.67l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.75-46.17 29.08-74.88 29.08a123.81 123.81 0 01-64.1-18.19L0 243.53v24.68l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.5v-1.78a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.76-46.17 29.09-74.88 29.09a123.81 123.81 0 01-64.1-18.19L0 204.55v24.68l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.68 12.88-12.35 20-27.13 19.68-41.5v-1.82a86.09 86.09 0 01-11.22 13.16zm83.7 25.74a94.15 94.15 0 01-60.2 25.86V334a81.6 81.6 0 0051.74-22.37c14-13.38 21.14-28.11 21-42.64v-2.19a94.92 94.92 0 01-12.54 14.65zm-83.7 91.21c-19.57 18.76-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 321.5v24.68l108.6 65.9a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.8 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a86.29 86.29 0 01-11.22 13.13zM327 162.45c-.68.69-1.35 1.38-2.05 2.06a94.37 94.37 0 01-10.64 8.65 91.35 91.35 0 01-11.6 7 94.53 94.53 0 01-26.24 8.71 97.69 97.69 0 01-14.16 1.57c.5 1.61.9 3.25 1.25 4.9a53.27 53.27 0 011.14 12V217h.05a84.41 84.41 0 0025.35-5.55 81 81 0 0026.39-16.82c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.32-10.74 48.55 48.55 0 004.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08 1.54-2.25 3.09a96.73 96.73 0 01-8.26 9.36zm0 77.92c-.69.7-1.31 1.41-2 2.1a94.2 94.2 0 01-60.2 25.86V295a81.6 81.6 0 0051.74-22.37 73.51 73.51 0 0016.46-22.5 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74 1.07-1.46 2.15-2.27 3.21a95.68 95.68 0 01-8.24 9.37zm0-39c-.69.7-1.31 1.41-2 2.1a93.18 93.18 0 01-10.63 8.65 91.63 91.63 0 01-11.63 7 95.47 95.47 0 01-37.94 10.18V256a81.65 81.65 0 0051.74-22.37c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.27-10.76 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74 1.08-1.46 2.16-2.27 3.22a95.68 95.68 0 01-8.24 9.37z\" />\n </SvgIcon>\n);\n","/*\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 { Progress } from '@backstage/core-components';\nimport Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Paper from '@material-ui/core/Paper';\nimport Button from '@material-ui/core/Button';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { useInfo } from '../../../hooks';\nimport { InfoDependenciesTable } from './InfoDependenciesTable';\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport MemoryIcon from '@material-ui/icons/Memory';\nimport DeveloperBoardIcon from '@material-ui/icons/DeveloperBoard';\nimport { BackstageLogoIcon } from './BackstageLogoIcon';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\nimport { DevToolsInfo } from '@backstage/plugin-devtools-common';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n paperStyle: {\n display: 'flex',\n marginBottom: theme.spacing(2),\n },\n flexContainer: {\n display: 'flex',\n flexDirection: 'row',\n padding: 0,\n },\n copyButton: {\n float: 'left',\n margin: theme.spacing(2),\n },\n }),\n);\n\nconst copyToClipboard = ({ about }: { about: DevToolsInfo | undefined }) => {\n if (about) {\n let formatted = `OS: ${about.operatingSystem}\\nResources: ${about.resourceUtilization}\\nnode: ${about.nodeJsVersion}\\nbackstage: ${about.backstageVersion}\\nDependencies:\\n`;\n const deps = about.dependencies;\n for (const key in deps) {\n if (Object.prototype.hasOwnProperty.call(deps, key)) {\n formatted = `${formatted} ${deps[key].name}: ${deps[key].versions}\\n`;\n }\n }\n window.navigator.clipboard.writeText(formatted);\n }\n};\n\n/** @public */\nexport const InfoContent = () => {\n const classes = useStyles();\n const { about, loading, error } = useInfo();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n return (\n <Box>\n <Paper className={classes.paperStyle}>\n <List className={classes.flexContainer}>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <DeveloperBoardIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Operating System\"\n secondary={about?.operatingSystem}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <MemoryIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Resource utilization\"\n secondary={about?.resourceUtilization}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <DescriptionIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"NodeJS Version\"\n secondary={about?.nodeJsVersion}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <BackstageLogoIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Backstage Version\"\n secondary={about?.backstageVersion}\n />\n </ListItem>\n </List>\n <Divider orientation=\"vertical\" variant=\"middle\" flexItem />\n <Button\n onClick={() => {\n copyToClipboard({ about });\n }}\n className={classes.copyButton}\n startIcon={<FileCopyIcon />}\n >\n Copy Info to Clipboard\n </Button>\n </Paper>\n <InfoDependenciesTable infoDependencies={about?.dependencies} />\n </Box>\n );\n};\n","/*\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 { Header, Page, RoutedTabs } from '@backstage/core-components';\nimport {\n attachComponentData,\n useElementFilter,\n} from '@backstage/core-plugin-api';\nimport { TabProps } from '@material-ui/core/Tab';\nimport { default as React } from 'react';\n\n/** @public */\nexport type SubRoute = {\n path: string;\n title: string;\n children: JSX.Element;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.devtools.devtoolsLayoutRoute';\n\nconst Route: (props: SubRoute) => null = () => null;\nattachComponentData(Route, dataKey, true);\n\n// This causes all mount points that are discovered within this route to use the path of the route itself\nattachComponentData(Route, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type DevToolsLayoutProps = {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n};\n\n/**\n * DevTools is a compound component, which allows you to define a custom layout\n *\n * @example\n * ```jsx\n * <DevToolsLayout>\n * <DevToolsLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </DevToolsLayout.Route>\n * </DevToolsLayout>\n * ```\n * @public\n */\nexport const DevToolsLayout = ({\n children,\n title,\n subtitle,\n}: DevToolsLayoutProps) => {\n const routes = useElementFilter(children, elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of DevToolsLayout must be an DevToolsLayout.Route',\n })\n .getElements<SubRoute>()\n .map(child => child.props),\n );\n\n return (\n <Page themeId=\"home\">\n <Header title={title ?? 'Backstage DevTools'} subtitle={subtitle} />\n <RoutedTabs routes={routes} />\n </Page>\n );\n};\n\nDevToolsLayout.Route = Route;\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,SAAS,SAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,OAAO,IAAI,SAAU,EAAA,CAAA;AAAA,GACvB,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,UAAY,EAAA,KAAA;AAAA,IACZ,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;ACfO,SAAS,OAId,GAAA;AACA,EAAM,MAAA,GAAA,G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EAAO,SAAS,IAAI,CAAA,CAAA;AAGxC,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA,CAAA;AAsBlD,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AACF,CAA2B,KAAA;AACzB,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,QAAA;AAAA,IAAU,CAAA,QAAA,KACxC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,OAAA;AAAA,MACL,eACE,EAAA,yDAAA;AAAA,KACH,CACA,CAAA,WAAA,GACA,GAAI,CAAA,CAAA,KAAA,KAAS,MAAM,KAAK,CAAA;AAAA,GAC7B,CAAA;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,MAAO,EAAA,EAAA,KAAA,EAAO,KAAS,IAAA,IAAA,GAAA,KAAA,GAAA,oBAAA,EAAsB,QAAoB,EAAA,CAAA,kBACjE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,QAAgB,CAC9B,CAAA,CAAA;AAEJ,EAAA;AAEA,cAAA,CAAe,KAAQ,GAAA,KAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useOutlet } from 'react-router-dom';
3
3
  import { devToolsInfoReadPermission, devToolsConfigReadPermission } from '@backstage/plugin-devtools-common';
4
- import { D as DevToolsLayout, I as InfoContent, C as ConfigContent } from './DevToolsLayout-a33aa3a6.esm.js';
4
+ import { D as DevToolsLayout, I as InfoContent, C as ConfigContent } from './DevToolsLayout-638d22a2.esm.js';
5
5
  import { RequirePermission } from '@backstage/plugin-permission-react';
6
6
  import '@backstage/core-components';
7
7
  import '@material-ui/core/Box';
@@ -20,6 +20,7 @@ import '@material-ui/core/List';
20
20
  import '@material-ui/core/ListItem';
21
21
  import '@material-ui/core/ListItemAvatar';
22
22
  import '@material-ui/core/ListItemText';
23
+ import '@material-ui/core/Button';
23
24
  import '@material-ui/icons/Description';
24
25
  import '@material-ui/icons/Memory';
25
26
  import '@material-ui/icons/DeveloperBoard';
@@ -34,4 +35,4 @@ const DevToolsPage = () => {
34
35
  };
35
36
 
36
37
  export { DevToolsPage };
37
- //# sourceMappingURL=index-83ffc2b9.esm.js.map
38
+ //# sourceMappingURL=index-a2af236c.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-83ffc2b9.esm.js","sources":["../../src/components/DefaultDevToolsPage/DefaultDevToolsPage.tsx","../../src/components/DevToolsPage/DevToolsPage.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 devToolsConfigReadPermission,\n devToolsInfoReadPermission,\n} from '@backstage/plugin-devtools-common';\n\nimport { ConfigContent } from '../Content/ConfigContent';\nimport { DevToolsLayout } from '../DevToolsLayout';\nimport { InfoContent } from '../Content/InfoContent';\nimport React from 'react';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\n/** @public */\nexport const DefaultDevToolsPage = () => (\n <DevToolsLayout>\n <DevToolsLayout.Route path=\"info\" title=\"Info\">\n <RequirePermission permission={devToolsInfoReadPermission}>\n <InfoContent />\n </RequirePermission>\n </DevToolsLayout.Route>\n <DevToolsLayout.Route path=\"config\" title=\"Config\">\n <RequirePermission permission={devToolsConfigReadPermission}>\n <ConfigContent />\n </RequirePermission>\n </DevToolsLayout.Route>\n </DevToolsLayout>\n);\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport { DefaultDevToolsPage } from '../DefaultDevToolsPage';\n\nexport const DevToolsPage = () => {\n const outlet = useOutlet();\n\n return <>{outlet || <DefaultDevToolsPage />}</>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,sBAAsB,sBACjC,KAAA,CAAA,aAAA,CAAC,cACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,KAAf,EAAA,EAAqB,IAAK,EAAA,MAAA,EAAO,OAAM,MACtC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,EAAA,UAAA,EAAY,8CAC5B,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CACF,mBACC,KAAA,CAAA,aAAA,CAAA,cAAA,CAAe,KAAf,EAAA,EAAqB,MAAK,QAAS,EAAA,KAAA,EAAM,QACxC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBAAkB,UAAY,EAAA,4BAAA,EAAA,sCAC5B,aAAc,EAAA,IAAA,CACjB,CACF,CACF,CAAA;;ACpBK,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,uBAAU,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,oBAAW,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CAAG,CAAA,CAAA;AAC9C;;;;"}
1
+ {"version":3,"file":"index-a2af236c.esm.js","sources":["../../src/components/DefaultDevToolsPage/DefaultDevToolsPage.tsx","../../src/components/DevToolsPage/DevToolsPage.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 devToolsConfigReadPermission,\n devToolsInfoReadPermission,\n} from '@backstage/plugin-devtools-common';\n\nimport { ConfigContent } from '../Content/ConfigContent';\nimport { DevToolsLayout } from '../DevToolsLayout';\nimport { InfoContent } from '../Content/InfoContent';\nimport React from 'react';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\n/** @public */\nexport const DefaultDevToolsPage = () => (\n <DevToolsLayout>\n <DevToolsLayout.Route path=\"info\" title=\"Info\">\n <RequirePermission permission={devToolsInfoReadPermission}>\n <InfoContent />\n </RequirePermission>\n </DevToolsLayout.Route>\n <DevToolsLayout.Route path=\"config\" title=\"Config\">\n <RequirePermission permission={devToolsConfigReadPermission}>\n <ConfigContent />\n </RequirePermission>\n </DevToolsLayout.Route>\n </DevToolsLayout>\n);\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport { DefaultDevToolsPage } from '../DefaultDevToolsPage';\n\nexport const DevToolsPage = () => {\n const outlet = useOutlet();\n\n return <>{outlet || <DefaultDevToolsPage />}</>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,sBAAsB,sBACjC,KAAA,CAAA,aAAA,CAAC,cACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,KAAf,EAAA,EAAqB,IAAK,EAAA,MAAA,EAAO,OAAM,MACtC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,EAAA,UAAA,EAAY,8CAC5B,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CACF,mBACC,KAAA,CAAA,aAAA,CAAA,cAAA,CAAe,KAAf,EAAA,EAAqB,MAAK,QAAS,EAAA,KAAA,EAAM,QACxC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBAAkB,UAAY,EAAA,4BAAA,EAAA,sCAC5B,aAAc,EAAA,IAAA,CACjB,CACF,CACF,CAAA;;ACpBK,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,uBAAU,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,oBAAW,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CAAG,CAAA,CAAA;AAC9C;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension, useApi } from '@backstage/core-plugin-api';
2
2
  import { d as devToolsApiRef, D as DevToolsClient, r as rootRouteRef } from './esm/routes-75249767.esm.js';
3
- export { C as ConfigContent, D as DevToolsLayout, I as InfoContent } from './esm/DevToolsLayout-a33aa3a6.esm.js';
3
+ export { C as ConfigContent, D as DevToolsLayout, I as InfoContent } from './esm/DevToolsLayout-638d22a2.esm.js';
4
4
  import { Progress, Table, StatusWarning, StatusError, StatusOK } from '@backstage/core-components';
5
5
  import Box from '@material-ui/core/Box';
6
6
  import Grid from '@material-ui/core/Grid';
@@ -18,6 +18,7 @@ import '@material-ui/core/List';
18
18
  import '@material-ui/core/ListItem';
19
19
  import '@material-ui/core/ListItemAvatar';
20
20
  import '@material-ui/core/ListItemText';
21
+ import '@material-ui/core/Button';
21
22
  import '@material-ui/icons/Description';
22
23
  import '@material-ui/icons/Memory';
23
24
  import '@material-ui/icons/DeveloperBoard';
@@ -40,7 +41,7 @@ const devToolsPlugin = createPlugin({
40
41
  const DevToolsPage = devToolsPlugin.provide(
41
42
  createRoutableExtension({
42
43
  name: "DevToolsPage",
43
- component: () => import('./esm/index-83ffc2b9.esm.js').then((m) => m.DevToolsPage),
44
+ component: () => import('./esm/index-a2af236c.esm.js').then((m) => m.DevToolsPage),
44
45
  mountPoint: rootRouteRef
45
46
  })
46
47
  );
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/hooks/useExternalDependencies.ts","../src/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.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 createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { devToolsApiRef, DevToolsClient } from './api';\n\nimport { rootRouteRef } from './routes';\n\n/** @public */\nexport const devToolsPlugin = createPlugin({\n id: 'devtools',\n apis: [\n createApiFactory({\n api: devToolsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new DevToolsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/** @public */\nexport const DevToolsPage = devToolsPlugin.provide(\n createRoutableExtension({\n name: 'DevToolsPage',\n component: () =>\n import('./components/DevToolsPage').then(m => m.DevToolsPage),\n mountPoint: rootRouteRef,\n }),\n);\n","/*\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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\n\nexport function useExternalDependencies(): {\n externalDependencies?: ExternalDependency[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getExternalDependencies();\n }, [api]);\n\n return {\n externalDependencies: value,\n loading,\n error,\n };\n}\n","/*\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 Progress,\n StatusError,\n StatusOK,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { useExternalDependencies } from '../../../hooks';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n paperStyle: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const getExternalDependencyStatus = (\n result: Partial<ExternalDependency> | undefined,\n) => {\n switch (result?.status) {\n case 'Healthy':\n return (\n <Typography component=\"span\">\n <StatusOK /> {result.status}\n </Typography>\n );\n case 'Unhealthy':\n return (\n <Typography component=\"span\">\n <StatusError /> {`${result.status}`}\n </Typography>\n );\n case undefined:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nconst columns: TableColumn[] = [\n {\n title: 'Name',\n width: 'auto',\n field: 'name',\n },\n {\n title: 'Target',\n width: 'auto',\n field: 'target',\n },\n {\n title: 'Type',\n width: 'auto',\n field: 'type',\n },\n {\n title: 'Status',\n width: 'auto',\n render: (row: Partial<ExternalDependency>) => (\n <Grid container direction=\"column\">\n <Grid item>\n <Typography variant=\"button\">\n {getExternalDependencyStatus(row)}\n </Typography>\n </Grid>\n <Grid item>{row.error && <Typography>{row.error}</Typography>}</Grid>\n </Grid>\n ),\n },\n];\n\n/** @public */\nexport const ExternalDependenciesContent = () => {\n const classes = useStyles();\n const { externalDependencies, loading, error } = useExternalDependencies();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!externalDependencies || externalDependencies.length === 0) {\n return (\n <Box>\n <Paper className={classes.paperStyle}>\n <Typography>No external dependencies found</Typography>\n </Paper>\n </Box>\n );\n }\n\n return (\n <Table\n title=\"Status\"\n options={{\n paging: true,\n pageSize: 20,\n pageSizeOptions: [20, 50, 100],\n loadingType: 'linear',\n showEmptyDataSourceMessage: !loading,\n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,KAAM,EAAA,QAAA;AAAA,MACN,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,EAAA;AAAA,QACV,eAAiB,EAAA,CAAC,EAAI,EAAA,EAAA,EAAI,GAAG,CAAA;AAAA,QAC7B,WAAa,EAAA,QAAA;AAAA,QACb,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,OAAA;AAAA,MACA,IAAA,EAAM,wBAAwB,EAAC;AAAA,KAAA;AAAA,GACjC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/hooks/useExternalDependencies.ts","../src/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.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 createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { devToolsApiRef, DevToolsClient } from './api';\n\nimport { rootRouteRef } from './routes';\n\n/** @public */\nexport const devToolsPlugin = createPlugin({\n id: 'devtools',\n apis: [\n createApiFactory({\n api: devToolsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new DevToolsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/** @public */\nexport const DevToolsPage = devToolsPlugin.provide(\n createRoutableExtension({\n name: 'DevToolsPage',\n component: () =>\n import('./components/DevToolsPage').then(m => m.DevToolsPage),\n mountPoint: rootRouteRef,\n }),\n);\n","/*\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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\n\nexport function useExternalDependencies(): {\n externalDependencies?: ExternalDependency[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getExternalDependencies();\n }, [api]);\n\n return {\n externalDependencies: value,\n loading,\n error,\n };\n}\n","/*\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 Progress,\n StatusError,\n StatusOK,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { useExternalDependencies } from '../../../hooks';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n paperStyle: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const getExternalDependencyStatus = (\n result: Partial<ExternalDependency> | undefined,\n) => {\n switch (result?.status) {\n case 'Healthy':\n return (\n <Typography component=\"span\">\n <StatusOK /> {result.status}\n </Typography>\n );\n case 'Unhealthy':\n return (\n <Typography component=\"span\">\n <StatusError /> {`${result.status}`}\n </Typography>\n );\n case undefined:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nconst columns: TableColumn[] = [\n {\n title: 'Name',\n width: 'auto',\n field: 'name',\n },\n {\n title: 'Target',\n width: 'auto',\n field: 'target',\n },\n {\n title: 'Type',\n width: 'auto',\n field: 'type',\n },\n {\n title: 'Status',\n width: 'auto',\n render: (row: Partial<ExternalDependency>) => (\n <Grid container direction=\"column\">\n <Grid item>\n <Typography variant=\"button\">\n {getExternalDependencyStatus(row)}\n </Typography>\n </Grid>\n <Grid item>{row.error && <Typography>{row.error}</Typography>}</Grid>\n </Grid>\n ),\n },\n];\n\n/** @public */\nexport const ExternalDependenciesContent = () => {\n const classes = useStyles();\n const { externalDependencies, loading, error } = useExternalDependencies();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!externalDependencies || externalDependencies.length === 0) {\n return (\n <Box>\n <Paper className={classes.paperStyle}>\n <Typography>No external dependencies found</Typography>\n </Paper>\n </Box>\n );\n }\n\n return (\n <Table\n title=\"Status\"\n options={{\n paging: true,\n pageSize: 20,\n pageSizeOptions: [20, 50, 100],\n loadingType: 'linear',\n showEmptyDataSourceMessage: !loading,\n }}\n columns={columns}\n data={externalDependencies || []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,iBAAiB,YAAa,CAAA;AAAA,EACzC,EAAI,EAAA,UAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,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AA;AAAA,QACb,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,OAAA;AAAA,MACA,IAAA,EAAM,wBAAwB,EAAC;AAAA,KAAA;AAAA,GACjC,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-devtools",
3
- "version": "0.0.0-nightly-20240122021809",
3
+ "version": "0.0.0-nightly-20240124021659",
4
4
  "main": "./dist/index.esm.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -40,11 +40,11 @@
40
40
  "postpack": "backstage-cli package postpack"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/core-compat-api": "^0.0.0-nightly-20240122021809",
43
+ "@backstage/core-compat-api": "^0.0.0-nightly-20240124021659",
44
44
  "@backstage/core-components": "^0.13.10",
45
45
  "@backstage/core-plugin-api": "^1.8.2",
46
46
  "@backstage/errors": "^1.2.3",
47
- "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240122021809",
47
+ "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240124021659",
48
48
  "@backstage/plugin-devtools-common": "^0.1.8",
49
49
  "@backstage/plugin-permission-react": "^0.4.19",
50
50
  "@material-ui/core": "^4.9.13",
@@ -60,8 +60,8 @@
60
60
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@backstage/cli": "^0.0.0-nightly-20240122021809",
64
- "@backstage/dev-utils": "^0.0.0-nightly-20240122021809",
63
+ "@backstage/cli": "^0.0.0-nightly-20240124021659",
64
+ "@backstage/dev-utils": "^0.0.0-nightly-20240124021659",
65
65
  "@testing-library/jest-dom": "^6.0.0",
66
66
  "@testing-library/react": "^14.0.0"
67
67
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevToolsLayout-a33aa3a6.esm.js","sources":["../../src/hooks/useConfig.ts","../../src/hooks/useInfo.ts","../../src/components/Content/ConfigContent/ConfigContent.tsx","../../src/components/Content/InfoContent/InfoDependenciesTable.tsx","../../src/components/Content/InfoContent/BackstageLogoIcon.tsx","../../src/components/Content/InfoContent/InfoContent.tsx","../../src/components/DevToolsLayout/DevToolsLayout.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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ConfigInfo } from '@backstage/plugin-devtools-common';\n\nexport function useConfig(): {\n configInfo?: ConfigInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getConfig();\n }, [api]);\n\n return {\n configInfo: value,\n loading,\n error,\n };\n}\n","/*\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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { DevToolsInfo } from '@backstage/plugin-devtools-common';\n\nexport function useInfo(): {\n about?: DevToolsInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getInfo();\n }, [api]);\n\n return {\n about: value,\n loading,\n error,\n };\n}\n","/*\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 { Progress, WarningPanel } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport {\n createStyles,\n makeStyles,\n Theme,\n useTheme,\n} from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport ReactJson from 'react-json-view';\nimport { useConfig } from '../../../hooks';\nimport { ConfigError } from '@backstage/plugin-devtools-common';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n warningStyle: {\n paddingBottom: theme.spacing(2),\n },\n paperStyle: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const WarningContent = ({ error }: { error: ConfigError }) => {\n if (!error.messages) {\n return <Typography>{error.message}</Typography>;\n }\n\n const messages = error.messages as string[];\n\n return (\n <Box>\n {messages.map(message => (\n <Typography>{message}</Typography>\n ))}\n </Box>\n );\n};\n\n/** @public */\nexport const ConfigContent = () => {\n const classes = useStyles();\n const theme = useTheme();\n const { configInfo, loading, error } = useConfig();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!configInfo) {\n return <Alert severity=\"error\">Unable to load config data</Alert>;\n }\n\n return (\n <Box>\n {configInfo && configInfo.error && (\n <Box className={classes.warningStyle}>\n <WarningPanel title=\"Config validation failed\">\n <WarningContent error={configInfo.error} />\n </WarningPanel>\n </Box>\n )}\n <Paper className={classes.paperStyle}>\n <ReactJson\n src={configInfo.config as object}\n name=\"config\"\n enableClipboard={false}\n theme={theme.palette.type === 'dark' ? 'monokai' : 'rjv-default'}\n />\n </Paper>\n </Box>\n );\n};\n","/*\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 { Table, TableColumn } from '@backstage/core-components';\nimport { PackageDependency } from '@backstage/plugin-devtools-common';\n\nimport React from 'react';\n\nconst columns: TableColumn[] = [\n {\n title: 'Name',\n width: 'auto',\n field: 'name',\n defaultSort: 'asc',\n },\n {\n title: 'Versions',\n width: 'auto',\n field: 'versions',\n },\n];\n\nexport const InfoDependenciesTable = ({\n infoDependencies,\n}: {\n infoDependencies: PackageDependency[] | undefined;\n}) => {\n return (\n <Table\n title=\"Package Dependencies\"\n options={{\n paging: true,\n pageSize: 15,\n pageSizeOptions: [15, 30, 100],\n loadingType: 'linear',\n padding: 'dense',\n }}\n columns={columns}\n data={infoDependencies || []}\n />\n );\n};\n","/*\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 SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nimport React from 'react';\n\nexport const BackstageLogoIcon = (props: SvgIconProps) => (\n <SvgIcon {...props} viewBox=\"0 0 337.46 428.5\">\n <path d=\"M303 166.05a80.69 80.69 0 0013.45-10.37c.79-.77 1.55-1.53 2.3-2.3a83.12 83.12 0 007.93-9.38 63.69 63.69 0 006.32-10.77 48.58 48.58 0 004.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56 0 78.3 115.23 0 190.25l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.69 19.16-18.36 25.52-42.12 13.7-61.87a49.22 49.22 0 00-6.8-8.87 89.17 89.17 0 0019.32 2.15h.15a85.08 85.08 0 0031-5.79 80.88 80.88 0 0012.85-6.45zm-100.55 59.81c-19.32 18.51-50.4 21.23-75.7 5.9l-75.14-45.61 67.45-64.64 76.41 46.38c27.53 16.69 26.02 39.72 6.98 57.97zm8.93-82.22l-70.65-42.89L205.14 39l69.37 42.1c25.94 15.72 29.31 37 10.55 55a60.69 60.69 0 01-73.68 7.54zm29.86 190c-19.57 18.75-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 282.52v24.67l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.75-46.17 29.08-74.88 29.08a123.81 123.81 0 01-64.1-18.19L0 243.53v24.68l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.5v-1.78a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.76-46.17 29.09-74.88 29.09a123.81 123.81 0 01-64.1-18.19L0 204.55v24.68l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.68 12.88-12.35 20-27.13 19.68-41.5v-1.82a86.09 86.09 0 01-11.22 13.16zm83.7 25.74a94.15 94.15 0 01-60.2 25.86V334a81.6 81.6 0 0051.74-22.37c14-13.38 21.14-28.11 21-42.64v-2.19a94.92 94.92 0 01-12.54 14.65zm-83.7 91.21c-19.57 18.76-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 321.5v24.68l108.6 65.9a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.8 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a86.29 86.29 0 01-11.22 13.13zM327 162.45c-.68.69-1.35 1.38-2.05 2.06a94.37 94.37 0 01-10.64 8.65 91.35 91.35 0 01-11.6 7 94.53 94.53 0 01-26.24 8.71 97.69 97.69 0 01-14.16 1.57c.5 1.61.9 3.25 1.25 4.9a53.27 53.27 0 011.14 12V217h.05a84.41 84.41 0 0025.35-5.55 81 81 0 0026.39-16.82c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.32-10.74 48.55 48.55 0 004.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08 1.54-2.25 3.09a96.73 96.73 0 01-8.26 9.36zm0 77.92c-.69.7-1.31 1.41-2 2.1a94.2 94.2 0 01-60.2 25.86V295a81.6 81.6 0 0051.74-22.37 73.51 73.51 0 0016.46-22.5 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74 1.07-1.46 2.15-2.27 3.21a95.68 95.68 0 01-8.24 9.37zm0-39c-.69.7-1.31 1.41-2 2.1a93.18 93.18 0 01-10.63 8.65 91.63 91.63 0 01-11.63 7 95.47 95.47 0 01-37.94 10.18V256a81.65 81.65 0 0051.74-22.37c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.27-10.76 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74 1.08-1.46 2.16-2.27 3.22a95.68 95.68 0 01-8.24 9.37z\" />\n </SvgIcon>\n);\n","/*\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 { Progress } from '@backstage/core-components';\nimport Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Paper from '@material-ui/core/Paper';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { useInfo } from '../../../hooks';\nimport { InfoDependenciesTable } from './InfoDependenciesTable';\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport MemoryIcon from '@material-ui/icons/Memory';\nimport DeveloperBoardIcon from '@material-ui/icons/DeveloperBoard';\nimport { BackstageLogoIcon } from './BackstageLogoIcon';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\nimport { DevToolsInfo } from '@backstage/plugin-devtools-common';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n paperStyle: {\n marginBottom: theme.spacing(2),\n },\n flexContainer: {\n display: 'flex',\n flexDirection: 'row',\n padding: 0,\n },\n copyButton: {\n float: 'left',\n margin: theme.spacing(2),\n },\n }),\n);\n\nconst copyToClipboard = ({ about }: { about: DevToolsInfo | undefined }) => {\n if (about) {\n let formatted = `OS: ${about.operatingSystem}\\nResources: ${about.resourceUtilization}\\nnode: ${about.nodeJsVersion}\\nbackstage: ${about.backstageVersion}\\nDependencies:\\n`;\n const deps = about.dependencies;\n for (const key in deps) {\n if (Object.prototype.hasOwnProperty.call(deps, key)) {\n formatted = `${formatted} ${deps[key].name}: ${deps[key].versions}\\n`;\n }\n }\n window.navigator.clipboard.writeText(formatted);\n }\n};\n\n/** @public */\nexport const InfoContent = () => {\n const classes = useStyles();\n const { about, loading, error } = useInfo();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n return (\n <Box>\n <Paper className={classes.paperStyle}>\n <List className={classes.flexContainer}>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <DeveloperBoardIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Operating System\"\n secondary={about?.operatingSystem}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <MemoryIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Resource utilization\"\n secondary={about?.resourceUtilization}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <DescriptionIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"NodeJS Version\"\n secondary={about?.nodeJsVersion}\n />\n </ListItem>\n <ListItem>\n <ListItemAvatar>\n <Avatar>\n <BackstageLogoIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary=\"Backstage Version\"\n secondary={about?.backstageVersion}\n />\n </ListItem>\n <Divider orientation=\"vertical\" variant=\"middle\" flexItem />\n <ListItem\n button\n onClick={() => {\n copyToClipboard({ about });\n }}\n className={classes.copyButton}\n >\n <ListItemAvatar>\n <Avatar>\n <FileCopyIcon />\n </Avatar>\n </ListItemAvatar>\n <ListItemText primary=\"Copy Info to Clipboard\" />\n </ListItem>\n </List>\n </Paper>\n <InfoDependenciesTable infoDependencies={about?.dependencies} />\n </Box>\n );\n};\n","/*\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 { Header, Page, RoutedTabs } from '@backstage/core-components';\nimport {\n attachComponentData,\n useElementFilter,\n} from '@backstage/core-plugin-api';\nimport { TabProps } from '@material-ui/core/Tab';\nimport { default as React } from 'react';\n\n/** @public */\nexport type SubRoute = {\n path: string;\n title: string;\n children: JSX.Element;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.devtools.devtoolsLayoutRoute';\n\nconst Route: (props: SubRoute) => null = () => null;\nattachComponentData(Route, dataKey, true);\n\n// This causes all mount points that are discovered within this route to use the path of the route itself\nattachComponentData(Route, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type DevToolsLayoutProps = {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n};\n\n/**\n * DevTools is a compound component, which allows you to define a custom layout\n *\n * @example\n * ```jsx\n * <DevToolsLayout>\n * <DevToolsLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </DevToolsLayout.Route>\n * </DevToolsLayout>\n * ```\n * @public\n */\nexport const DevToolsLayout = ({\n children,\n title,\n subtitle,\n}: DevToolsLayoutProps) => {\n const routes = useElementFilter(children, elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of DevToolsLayout must be an DevToolsLayout.Route',\n })\n .getElements<SubRoute>()\n .map(child => child.props),\n );\n\n return (\n <Page themeId=\"home\">\n <Header title={title ?? 'Backstage DevTools'} subtitle={subtitle} />\n <RoutedTabs routes={routes} />\n </Page>\n );\n};\n\nDevToolsLayout.Route = Route;\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBO,SAAS,SAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,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