@backstage/plugin-devtools 0.1.39-next.1 → 0.1.39-next.2

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,14 @@
1
1
  # @backstage/plugin-devtools
2
2
 
3
+ ## 0.1.39-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 08c922e: Migrated `ConfigContent` component from Material UI to Backstage UI (BUI).
8
+ - Updated dependencies
9
+ - @backstage/ui@0.15.0-next.2
10
+ - @backstage/core-components@0.18.10-next.1
11
+
3
12
  ## 0.1.39-next.1
4
13
 
5
14
  ### Patch Changes
@@ -1,57 +1,49 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Progress, WarningPanel } from '@backstage/core-components';
3
- import Box from '@material-ui/core/Box';
4
- import Paper from '@material-ui/core/Paper';
5
- import Typography from '@material-ui/core/Typography';
6
- import { useTheme, makeStyles, createStyles } from '@material-ui/core/styles';
7
- import Alert from '@material-ui/lab/Alert';
3
+ import { useApi, appThemeApiRef } from '@backstage/core-plugin-api';
4
+ import { Alert, Box, Text } from '@backstage/ui';
5
+ import useObservable from 'react-use/esm/useObservable';
8
6
  import ReactJson from 'react-json-view';
9
7
  import { useConfig } from '../../../hooks/useConfig.esm.js';
10
8
  import '../../../api/DevToolsApi.esm.js';
11
9
  import '@backstage/errors';
12
- import '@backstage/core-plugin-api';
13
10
  import 'react-use/esm/useAsync';
14
11
  import 'react-use/esm/useAsyncRetry';
15
12
  import 'react';
16
13
 
17
- const useStyles = makeStyles(
18
- (theme) => createStyles({
19
- warningStyle: {
20
- paddingBottom: theme.spacing(2)
21
- },
22
- paperStyle: {
23
- padding: theme.spacing(2)
24
- }
25
- })
26
- );
27
14
  const WarningContent = ({ error }) => {
28
15
  if (!error.messages) {
29
- return /* @__PURE__ */ jsx(Typography, { children: error.message });
16
+ return /* @__PURE__ */ jsx(Text, { as: "p", children: error.message });
30
17
  }
31
18
  const messages = error.messages;
32
- return /* @__PURE__ */ jsx(Box, { children: messages.map((message) => /* @__PURE__ */ jsx(Typography, { children: message })) });
19
+ return /* @__PURE__ */ jsx(Box, { children: messages.map((message) => /* @__PURE__ */ jsx(Text, { as: "p", children: message }, message)) });
33
20
  };
34
21
  const ConfigContent = () => {
35
- const classes = useStyles();
36
- const theme = useTheme();
22
+ const appThemeApi = useApi(appThemeApiRef);
23
+ const activeThemeId = useObservable(
24
+ appThemeApi.activeThemeId$(),
25
+ appThemeApi.getActiveThemeId()
26
+ );
27
+ const activeTheme = appThemeApi.getInstalledThemes().find((t) => t.id === activeThemeId);
28
+ const isDark = activeTheme?.variant === "dark";
37
29
  const { configInfo, loading, error } = useConfig();
38
30
  if (loading) {
39
31
  return /* @__PURE__ */ jsx(Progress, {});
40
32
  } else if (error) {
41
- return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message });
33
+ return /* @__PURE__ */ jsx(Alert, { status: "danger", description: error.message });
42
34
  }
43
35
  if (!configInfo) {
44
- return /* @__PURE__ */ jsx(Alert, { severity: "error", children: "Unable to load config data" });
36
+ return /* @__PURE__ */ jsx(Alert, { status: "danger", description: "Unable to load config data" });
45
37
  }
46
38
  return /* @__PURE__ */ jsxs(Box, { children: [
47
- configInfo && configInfo.error && /* @__PURE__ */ jsx(Box, { className: classes.warningStyle, children: /* @__PURE__ */ jsx(WarningPanel, { title: "Config validation failed", children: /* @__PURE__ */ jsx(WarningContent, { error: configInfo.error }) }) }),
48
- /* @__PURE__ */ jsx(Paper, { className: classes.paperStyle, children: /* @__PURE__ */ jsx(
39
+ configInfo && configInfo.error && /* @__PURE__ */ jsx(Box, { pb: "2", children: /* @__PURE__ */ jsx(WarningPanel, { title: "Config validation failed", children: /* @__PURE__ */ jsx(WarningContent, { error: configInfo.error }) }) }),
40
+ /* @__PURE__ */ jsx(Box, { bg: "neutral", p: "4", children: /* @__PURE__ */ jsx(
49
41
  ReactJson,
50
42
  {
51
43
  src: configInfo.config,
52
44
  name: "config",
53
45
  enableClipboard: false,
54
- theme: theme.palette.type === "dark" ? "chalk" : "rjv-default"
46
+ theme: isDark ? "chalk" : "rjv-default"
55
47
  }
56
48
  ) })
57
49
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigContent.esm.js","sources":["../../../../src/components/Content/ConfigContent/ConfigContent.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 { 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 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,YAAA,EAAc;AAAA,MACZ,aAAA,EAAe,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KAChC;AAAA,IACA,UAAA,EAAY;AAAA,MACV,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA;AAC1B,GACD;AACH,CAAA;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,KAAA,EAAM,KAA8B;AACnE,EAAA,IAAI,CAAC,MAAM,QAAA,EAAU;AACnB,IAAA,uBAAO,GAAA,CAAC,UAAA,EAAA,EAAY,QAAA,EAAA,KAAA,CAAM,OAAA,EAAQ,CAAA;AAAA,EACpC;AAEA,EAAA,MAAM,WAAW,KAAA,CAAM,QAAA;AAEvB,EAAA,uBACE,GAAA,CAAC,OACE,QAAA,EAAA,QAAA,CAAS,GAAA,CAAI,6BACZ,GAAA,CAAC,UAAA,EAAA,EAAY,QAAA,EAAA,OAAA,EAAQ,CACtB,CAAA,EACH,CAAA;AAEJ;AAGO,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,MAAM,EAAE,UAAA,EAAY,OAAA,EAAS,KAAA,KAAU,SAAA,EAAU;AAEjD,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB,WAAW,KAAA,EAAO;AAChB,IAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,OAAA,EAAS,gBAAM,OAAA,EAAQ,CAAA;AAAA,EAChD;AAEA,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,OAAA,EAAQ,QAAA,EAAA,4BAAA,EAA0B,CAAA;AAAA,EAC3D;AAEA,EAAA,4BACG,GAAA,EAAA,EACE,QAAA,EAAA;AAAA,IAAA,UAAA,IAAc,WAAW,KAAA,oBACxB,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,QAAQ,YAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,KAAA,EAAM,4BAClB,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAO,UAAA,CAAW,KAAA,EAAO,GAC3C,CAAA,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,OAAA,CAAQ,UAAA,EACxB,QAAA,kBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,KAAK,UAAA,CAAW,MAAA;AAAA,QAChB,IAAA,EAAK,QAAA;AAAA,QACL,eAAA,EAAiB,KAAA;AAAA,QACjB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,SAAS,OAAA,GAAU;AAAA;AAAA,KACnD,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ConfigContent.esm.js","sources":["../../../../src/components/Content/ConfigContent/ConfigContent.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 { Progress, WarningPanel } from '@backstage/core-components';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Alert, Box, Text } from '@backstage/ui';\nimport useObservable from 'react-use/esm/useObservable';\nimport ReactJson from 'react-json-view';\nimport { useConfig } from '../../../hooks';\nimport { ConfigError } from '@backstage/plugin-devtools-common';\n\nexport const WarningContent = ({ error }: { error: ConfigError }) => {\n if (!error.messages) {\n return <Text as=\"p\">{error.message}</Text>;\n }\n\n const messages = error.messages;\n\n return (\n <Box>\n {messages.map(message => (\n <Text as=\"p\" key={message}>\n {message}\n </Text>\n ))}\n </Box>\n );\n};\n\n/** @public */\nexport const ConfigContent = () => {\n const appThemeApi = useApi(appThemeApiRef);\n const activeThemeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n const activeTheme = appThemeApi\n .getInstalledThemes()\n .find(t => t.id === activeThemeId);\n const isDark = activeTheme?.variant === 'dark';\n const { configInfo, loading, error } = useConfig();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert status=\"danger\" description={error.message} />;\n }\n\n if (!configInfo) {\n return <Alert status=\"danger\" description=\"Unable to load config data\" />;\n }\n\n return (\n <Box>\n {configInfo && configInfo.error && (\n <Box pb=\"2\">\n <WarningPanel title=\"Config validation failed\">\n <WarningContent error={configInfo.error} />\n </WarningPanel>\n </Box>\n )}\n <Box bg=\"neutral\" p=\"4\">\n <ReactJson\n src={configInfo.config as object}\n name=\"config\"\n enableClipboard={false}\n theme={isDark ? 'chalk' : 'rjv-default'}\n />\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwBO,MAAM,cAAA,GAAiB,CAAC,EAAE,KAAA,EAAM,KAA8B;AACnE,EAAA,IAAI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A,IAAA,UAAA,IAAc,WAAW,KAAA,oBACxB,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,KACN,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,KAAA,EAAM,0BAAA,EAClB,8BAAC,cAAA,EAAA,EAAe,KAAA,EAAO,UAAA,CAAW,KAAA,EAAO,GAC3C,CAAA,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,SAAA,EAAU,GAAE,GAAA,EAClB,QAAA,kBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,KAAK,UAAA,CAAW,MAAA;AAAA,QAChB,IAAA,EAAK,QAAA;AAAA,QACL,eAAA,EAAiB,KAAA;AAAA,QACjB,KAAA,EAAO,SAAS,OAAA,GAAU;AAAA;AAAA,KAC5B,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-devtools";
2
- var version = "0.1.39-next.1";
2
+ var version = "0.1.39-next.2";
3
3
  var backstage = {
4
4
  role: "frontend-plugin",
5
5
  pluginId: "devtools",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-devtools",
3
- "version": "0.1.39-next.1",
3
+ "version": "0.1.39-next.2",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "devtools",
@@ -66,13 +66,13 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@backstage/core-compat-api": "0.5.11-next.0",
69
- "@backstage/core-components": "0.18.10-next.0",
69
+ "@backstage/core-components": "0.18.10-next.1",
70
70
  "@backstage/core-plugin-api": "1.12.6-next.1",
71
71
  "@backstage/errors": "1.3.1-next.0",
72
72
  "@backstage/frontend-plugin-api": "0.17.0-next.1",
73
73
  "@backstage/plugin-devtools-common": "0.1.25-next.0",
74
74
  "@backstage/plugin-permission-react": "0.5.1-next.0",
75
- "@backstage/ui": "0.15.0-next.1",
75
+ "@backstage/ui": "0.15.0-next.2",
76
76
  "@material-ui/core": "^4.9.13",
77
77
  "@material-ui/icons": "^4.9.1",
78
78
  "@material-ui/lab": "^4.0.0-alpha.57",