@backstage/plugin-kubernetes-cluster 0.0.22-next.1 → 0.0.22-next.3

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,34 @@
1
1
  # @backstage/plugin-kubernetes-cluster
2
2
 
3
+ ## 0.0.22-next.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/catalog-model@1.7.3
9
+ - @backstage/core-components@0.16.4-next.1
10
+ - @backstage/core-plugin-api@1.10.4-next.0
11
+ - @backstage/plugin-catalog-react@1.15.2-next.3
12
+ - @backstage/plugin-kubernetes-common@0.9.3-next.1
13
+ - @backstage/plugin-kubernetes-react@0.5.4-next.2
14
+ - @backstage/plugin-permission-react@0.4.31-next.0
15
+
16
+ ## 0.0.22-next.2
17
+
18
+ ### Patch Changes
19
+
20
+ - ca3da29: The `/clusters` endpoint is now protected by the `kubernetes.clusters.read` permission.
21
+ The `/services/:serviceId` endpoint is now protected by the `kubernetes.resources.read` permission.
22
+ The `/resources` endpoints are now protected by the `kubernetes.resources.read` permission.
23
+ - Updated dependencies
24
+ - @backstage/core-components@0.16.4-next.1
25
+ - @backstage/plugin-kubernetes-common@0.9.3-next.1
26
+ - @backstage/plugin-catalog-react@1.15.2-next.2
27
+ - @backstage/catalog-model@1.7.3
28
+ - @backstage/core-plugin-api@1.10.4-next.0
29
+ - @backstage/plugin-kubernetes-react@0.5.4-next.2
30
+ - @backstage/plugin-permission-react@0.4.31-next.0
31
+
3
32
  ## 0.0.22-next.1
4
33
 
5
34
  ### Patch Changes
@@ -0,0 +1,9 @@
1
+ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
2
+
3
+ /** @alpha */
4
+ declare const kubernetesClusterTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"kubernetes-cluster", {
5
+ readonly "kubernetesClusterContentPage.permissionAlert.message": "To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission.";
6
+ readonly "kubernetesClusterContentPage.permissionAlert.title": "Permission required";
7
+ }>;
8
+
9
+ export { kubernetesClusterTranslationRef };
@@ -0,0 +1,2 @@
1
+ export { kubernetesClusterTranslationRef } from './translation.esm.js';
2
+ //# sourceMappingURL=alpha.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -6,13 +6,31 @@ import { Nodes } from '../Nodes/Nodes.esm.js';
6
6
  import { ClusterOverview } from '../ClusterOverview/ClusterOverview.esm.js';
7
7
  import { KubernetesClusterErrorProvider, useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
8
8
  import { WarningPanel } from '@backstage/core-components';
9
+ import { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';
10
+ import { RequirePermission } from '@backstage/plugin-permission-react';
11
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
12
+ import { kubernetesClusterTranslationRef } from '../../translation.esm.js';
9
13
 
10
14
  const ContentGrid = () => {
11
15
  const { error } = useKubernetesClusterError();
12
16
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, error && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(WarningPanel, { title: "Error loading Kubernetes Cluster Plugin" }, /* @__PURE__ */ React.createElement(Typography, null, error))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ClusterOverview, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ApiResources, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Nodes, null))));
13
17
  };
14
18
  const KubernetesClusterContent = () => {
15
- return /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null));
19
+ const { t } = useTranslationRef(kubernetesClusterTranslationRef);
20
+ return /* @__PURE__ */ React.createElement(
21
+ RequirePermission,
22
+ {
23
+ permission: kubernetesClustersReadPermission,
24
+ errorPage: /* @__PURE__ */ React.createElement(
25
+ WarningPanel,
26
+ {
27
+ title: t("kubernetesClusterContentPage.permissionAlert.title"),
28
+ message: t("kubernetesClusterContentPage.permissionAlert.message")
29
+ }
30
+ )
31
+ },
32
+ /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null))
33
+ );
16
34
  };
17
35
 
18
36
  export { KubernetesClusterContent };
@@ -1 +1 @@
1
- {"version":3,"file":"KubernetesClusterContent.esm.js","sources":["../../../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n return (\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA2BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,EACZ,yBACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sCACZ,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAa,CAChB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAM,CACT,CACF,CACF,CAAA;AAEJ,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"KubernetesClusterContent.esm.js","sources":["../../../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\nimport { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesClusterTranslationRef } from '../../translation';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n const { t } = useTranslationRef(kubernetesClusterTranslationRef);\n\n return (\n <RequirePermission\n permission={kubernetesClustersReadPermission}\n errorPage={\n <WarningPanel\n title={t('kubernetesClusterContentPage.permissionAlert.title')}\n message={t('kubernetesClusterContentPage.permissionAlert.message')}\n />\n }\n >\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,EACZ,yBACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sCACZ,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAa,CAChB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAM,CACT,CACF,CACF,CAAA;AAEJ,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,+BAA+B,CAAA;AAE/D,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,MACZ,SACE,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,oDAAoD,CAAA;AAAA,UAC7D,OAAA,EAAS,EAAE,sDAAsD;AAAA;AAAA;AACnE,KAAA;AAAA,oBAGD,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf;AAAA,GACF;AAEJ;;;;"}
@@ -0,0 +1,16 @@
1
+ import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
2
+
3
+ const kubernetesClusterTranslationRef = createTranslationRef({
4
+ id: "kubernetes-cluster",
5
+ messages: {
6
+ kubernetesClusterContentPage: {
7
+ permissionAlert: {
8
+ title: "Permission required",
9
+ message: "To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission."
10
+ }
11
+ }
12
+ }
13
+ });
14
+
15
+ export { kubernetesClusterTranslationRef };
16
+ //# sourceMappingURL=translation.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const kubernetesClusterTranslationRef = createTranslationRef({\n id: 'kubernetes-cluster',\n messages: {\n kubernetesClusterContentPage: {\n permissionAlert: {\n title: 'Permission required',\n message:\n \"To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission.\",\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,kCAAkC,oBAAqB,CAAA;AAAA,EAClE,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,4BAA8B,EAAA;AAAA,MAC5B,eAAiB,EAAA;AAAA,QACf,KAAO,EAAA,qBAAA;AAAA,QACP,OACE,EAAA;AAAA;AACJ;AACF;AAEJ,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-cluster",
3
- "version": "0.0.22-next.1",
3
+ "version": "0.0.22-next.3",
4
4
  "description": "A Backstage plugin that shows details of Kubernetes clusters",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -10,9 +10,7 @@
10
10
  ]
11
11
  },
12
12
  "publishConfig": {
13
- "access": "public",
14
- "main": "dist/index.esm.js",
15
- "types": "dist/index.d.ts"
13
+ "access": "public"
16
14
  },
17
15
  "keywords": [
18
16
  "backstage",
@@ -26,8 +24,31 @@
26
24
  },
27
25
  "license": "Apache-2.0",
28
26
  "sideEffects": false,
29
- "main": "dist/index.esm.js",
30
- "types": "dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./dist/index.esm.js",
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.esm.js"
32
+ },
33
+ "./alpha": {
34
+ "import": "./dist/alpha.esm.js",
35
+ "types": "./dist/alpha.d.ts",
36
+ "default": "./dist/alpha.esm.js"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "main": "./dist/index.esm.js",
41
+ "types": "./dist/index.d.ts",
42
+ "typesVersions": {
43
+ "*": {
44
+ "index": [
45
+ "dist/index.d.ts"
46
+ ],
47
+ "alpha": [
48
+ "dist/alpha.d.ts"
49
+ ]
50
+ }
51
+ },
31
52
  "files": [
32
53
  "dist"
33
54
  ],
@@ -42,11 +63,12 @@
42
63
  },
43
64
  "dependencies": {
44
65
  "@backstage/catalog-model": "1.7.3",
45
- "@backstage/core-components": "0.16.4-next.0",
66
+ "@backstage/core-components": "0.16.4-next.1",
46
67
  "@backstage/core-plugin-api": "1.10.4-next.0",
47
- "@backstage/plugin-catalog-react": "1.15.2-next.1",
48
- "@backstage/plugin-kubernetes-common": "0.9.3-next.0",
49
- "@backstage/plugin-kubernetes-react": "0.5.4-next.1",
68
+ "@backstage/plugin-catalog-react": "1.15.2-next.3",
69
+ "@backstage/plugin-kubernetes-common": "0.9.3-next.1",
70
+ "@backstage/plugin-kubernetes-react": "0.5.4-next.2",
71
+ "@backstage/plugin-permission-react": "0.4.31-next.0",
50
72
  "@kubernetes-models/apimachinery": "^2.0.0",
51
73
  "@kubernetes-models/base": "^5.0.0",
52
74
  "@material-ui/core": "^4.12.2",
@@ -59,7 +81,7 @@
59
81
  "react-use": "^17.2.4"
60
82
  },
61
83
  "devDependencies": {
62
- "@backstage/cli": "0.30.0-next.1",
84
+ "@backstage/cli": "0.30.0-next.3",
63
85
  "@backstage/test-utils": "1.7.5-next.0",
64
86
  "@testing-library/dom": "^10.0.0",
65
87
  "@testing-library/jest-dom": "^6.0.0",
@@ -81,12 +103,5 @@
81
103
  "optional": true
82
104
  }
83
105
  },
84
- "typesVersions": {
85
- "*": {
86
- "index": [
87
- "dist/index.d.ts"
88
- ]
89
- }
90
- },
91
106
  "module": "./dist/index.esm.js"
92
107
  }