@backstage-community/plugin-grafana 0.1.7 → 0.1.9

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,17 @@
1
1
  # @backstage-community/plugin-grafana
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - e657f8d: Add default filtering based on required annotation to the new frontend system components
8
+
9
+ ## 0.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 4ca895f: Backstage version bump to v1.32.0
14
+
3
15
  ## 0.1.7
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-grafana__alpha",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
@@ -1,24 +1,25 @@
1
1
  import React from 'react';
2
2
  import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
3
+ import { isDashboardSelectorAvailable, isAlertSelectorAvailable, isOverviewDashboardAvailable } from '../constants.esm.js';
3
4
 
4
5
  const entityGrafanaDashboardsCard = EntityCardBlueprint.make({
5
6
  name: "dashboards",
6
7
  params: {
7
- filter: "kind:component",
8
+ filter: (entity) => Boolean(isDashboardSelectorAvailable(entity)),
8
9
  loader: () => import('../components/DashboardsCard/index.esm.js').then((m) => /* @__PURE__ */ React.createElement(m.DashboardsCard, null))
9
10
  }
10
11
  });
11
12
  const entityGrafanaAlertsCard = EntityCardBlueprint.make({
12
13
  name: "alerts",
13
14
  params: {
14
- filter: "kind:component",
15
+ filter: (entity) => Boolean(isDashboardSelectorAvailable(entity)) || isAlertSelectorAvailable(entity),
15
16
  loader: () => import('../components/AlertsCard/index.esm.js').then((m) => /* @__PURE__ */ React.createElement(m.AlertsCard, null))
16
17
  }
17
18
  });
18
19
  const entityGrafanaOverviewDashboardViewer = EntityCardBlueprint.make({
19
20
  name: "overview-dashboard",
20
21
  params: {
21
- filter: "kind:component",
22
+ filter: (entity) => isOverviewDashboardAvailable(entity),
22
23
  loader: () => import('../components/DashboardViewer/index.esm.js').then((m) => /* @__PURE__ */ React.createElement(m.EntityDashboardViewer, null))
23
24
  }
24
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\n/**\n * @alpha\n */\nexport const entityGrafanaDashboardsCard = EntityCardBlueprint.make({\n name: 'dashboards',\n params: {\n filter: 'kind:component',\n loader: () =>\n import('../components/DashboardsCard').then(m => <m.DashboardsCard />),\n },\n});\n\n/**\n * @alpha\n */\nexport const entityGrafanaAlertsCard = EntityCardBlueprint.make({\n name: 'alerts',\n params: {\n filter: 'kind:component',\n loader: () =>\n import('../components/AlertsCard').then(m => <m.AlertsCard />),\n },\n});\n\n/**\n * @alpha\n */\nexport const entityGrafanaOverviewDashboardViewer = EntityCardBlueprint.make({\n name: 'overview-dashboard',\n params: {\n filter: 'kind:component',\n loader: () =>\n import('../components/DashboardViewer').then(m => (\n <m.EntityDashboardViewer />\n )),\n },\n});\n"],"names":[],"mappings":";;;AAqBa,MAAA,2BAAA,GAA8B,oBAAoB,IAAK,CAAA;AAAA,EAClE,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,gBAAA;AAAA,IACR,MAAA,EAAQ,MACN,OAAO,2CAA8B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAAM,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,cAAF,EAAA,IAAiB,CAAE,CAAA;AAAA,GACzE;AACF,CAAC,EAAA;AAKY,MAAA,uBAAA,GAA0B,oBAAoB,IAAK,CAAA;AAAA,EAC9D,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,gBAAA;AAAA,IACR,MAAA,EAAQ,MACN,OAAO,uCAA0B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAAM,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,UAAF,EAAA,IAAa,CAAE,CAAA;AAAA,GACjE;AACF,CAAC,EAAA;AAKY,MAAA,oCAAA,GAAuC,oBAAoB,IAAK,CAAA;AAAA,EAC3E,IAAM,EAAA,oBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,gBAAA;AAAA,IACR,MAAA,EAAQ,MACN,OAAO,4CAA+B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAC1C,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,qBAAF,EAAA,IAAwB,CAC1B,CAAA;AAAA,GACL;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport {\n isAlertSelectorAvailable,\n isDashboardSelectorAvailable,\n isOverviewDashboardAvailable,\n} from '../constants';\n\n/**\n * @alpha\n */\nexport const entityGrafanaDashboardsCard = EntityCardBlueprint.make({\n name: 'dashboards',\n params: {\n filter: entity => Boolean(isDashboardSelectorAvailable(entity)),\n loader: () =>\n import('../components/DashboardsCard').then(m => <m.DashboardsCard />),\n },\n});\n\n/**\n * @alpha\n */\nexport const entityGrafanaAlertsCard = EntityCardBlueprint.make({\n name: 'alerts',\n params: {\n filter: entity =>\n Boolean(isDashboardSelectorAvailable(entity)) ||\n isAlertSelectorAvailable(entity),\n loader: () =>\n import('../components/AlertsCard').then(m => <m.AlertsCard />),\n },\n});\n\n/**\n * @alpha\n */\nexport const entityGrafanaOverviewDashboardViewer = EntityCardBlueprint.make({\n name: 'overview-dashboard',\n params: {\n filter: entity => isOverviewDashboardAvailable(entity),\n loader: () =>\n import('../components/DashboardViewer').then(m => (\n <m.EntityDashboardViewer />\n )),\n },\n});\n"],"names":[],"mappings":";;;;AA0Ba,MAAA,2BAAA,GAA8B,oBAAoB,IAAK,CAAA;AAAA,EAClE,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,CAAA,MAAA,KAAU,OAAQ,CAAA,4BAAA,CAA6B,MAAM,CAAC,CAAA;AAAA,IAC9D,MAAA,EAAQ,MACN,OAAO,2CAA8B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAAM,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,cAAF,EAAA,IAAiB,CAAE,CAAA;AAAA,GACzE;AACF,CAAC,EAAA;AAKY,MAAA,uBAAA,GAA0B,oBAAoB,IAAK,CAAA;AAAA,EAC9D,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAA,EAAQ,YACN,OAAQ,CAAA,4BAAA,CAA6B,MAAM,CAAC,CAAA,IAC5C,yBAAyB,MAAM,CAAA;AAAA,IACjC,MAAA,EAAQ,MACN,OAAO,uCAA0B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAAM,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,UAAF,EAAA,IAAa,CAAE,CAAA;AAAA,GACjE;AACF,CAAC,EAAA;AAKY,MAAA,oCAAA,GAAuC,oBAAoB,IAAK,CAAA;AAAA,EAC3E,IAAM,EAAA,oBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAA,EAAQ,CAAU,MAAA,KAAA,4BAAA,CAA6B,MAAM,CAAA;AAAA,IACrD,MAAA,EAAQ,MACN,OAAO,4CAA+B,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,qBAC1C,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,qBAAF,EAAA,IAAwB,CAC1B,CAAA;AAAA,GACL;AACF,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -9,50 +9,77 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
9
9
  *
10
10
  * @alpha
11
11
  */
12
- declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<{}, {}, {
13
- "api:grafana": _backstage_frontend_plugin_api.ExtensionDefinition<{}, {}, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_core_plugin_api.AnyApiFactory, "core.api.factory", {}>, {}, {
12
+ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
13
+ "api:grafana": _backstage_frontend_plugin_api.ExtensionDefinition<{
14
14
  kind: "api";
15
- namespace: undefined;
16
15
  name: undefined;
16
+ config: {};
17
+ configInput: {};
18
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_core_plugin_api.AnyApiFactory, "core.api.factory", {}>;
19
+ inputs: {};
20
+ params: {
21
+ factory: _backstage_core_plugin_api.AnyApiFactory;
22
+ };
17
23
  }>;
18
24
  "entity-card:grafana/dashboards": _backstage_frontend_plugin_api.ExtensionDefinition<{
19
- filter: string | undefined;
20
- }, {
21
- filter?: string | undefined;
22
- }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
23
- optional: true;
24
- }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
25
- optional: true;
26
- }>, {}, {
27
25
  kind: "entity-card";
28
- namespace: undefined;
29
26
  name: "dashboards";
27
+ config: {
28
+ filter: string | undefined;
29
+ };
30
+ configInput: {
31
+ filter?: string | undefined;
32
+ };
33
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
34
+ optional: true;
35
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
36
+ optional: true;
37
+ }>;
38
+ inputs: {};
39
+ params: {
40
+ loader: () => Promise<JSX.Element>;
41
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
42
+ };
30
43
  }>;
31
44
  "entity-card:grafana/alerts": _backstage_frontend_plugin_api.ExtensionDefinition<{
32
- filter: string | undefined;
33
- }, {
34
- filter?: string | undefined;
35
- }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
36
- optional: true;
37
- }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
38
- optional: true;
39
- }>, {}, {
40
45
  kind: "entity-card";
41
- namespace: undefined;
42
46
  name: "alerts";
47
+ config: {
48
+ filter: string | undefined;
49
+ };
50
+ configInput: {
51
+ filter?: string | undefined;
52
+ };
53
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
54
+ optional: true;
55
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
56
+ optional: true;
57
+ }>;
58
+ inputs: {};
59
+ params: {
60
+ loader: () => Promise<JSX.Element>;
61
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
62
+ };
43
63
  }>;
44
64
  "entity-card:grafana/overview-dashboard": _backstage_frontend_plugin_api.ExtensionDefinition<{
45
- filter: string | undefined;
46
- }, {
47
- filter?: string | undefined;
48
- }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
49
- optional: true;
50
- }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
51
- optional: true;
52
- }>, {}, {
53
65
  kind: "entity-card";
54
- namespace: undefined;
55
66
  name: "overview-dashboard";
67
+ config: {
68
+ filter: string | undefined;
69
+ };
70
+ configInput: {
71
+ filter?: string | undefined;
72
+ };
73
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
74
+ optional: true;
75
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
76
+ optional: true;
77
+ }>;
78
+ inputs: {};
79
+ params: {
80
+ loader: () => Promise<JSX.Element>;
81
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
82
+ };
56
83
  }>;
57
84
  }>;
58
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-grafana",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "A Backstage backend plugin that integrates towards Grafana",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -31,6 +31,7 @@
31
31
  "default": "./dist/index.esm.js"
32
32
  },
33
33
  "./alpha": {
34
+ "backstage": "@backstage/FrontendPlugin",
34
35
  "import": "./dist/alpha.esm.js",
35
36
  "types": "./dist/alpha.d.ts",
36
37
  "default": "./dist/alpha.esm.js"
@@ -48,11 +49,11 @@
48
49
  "postpack": "backstage-cli package postpack"
49
50
  },
50
51
  "dependencies": {
51
- "@backstage/catalog-model": "^1.6.0",
52
- "@backstage/core-components": "^0.14.10",
53
- "@backstage/core-plugin-api": "^1.9.3",
54
- "@backstage/frontend-plugin-api": "^0.7.0",
55
- "@backstage/plugin-catalog-react": "^1.12.3",
52
+ "@backstage/catalog-model": "^1.7.0",
53
+ "@backstage/core-components": "^0.15.1",
54
+ "@backstage/core-plugin-api": "^1.10.0",
55
+ "@backstage/frontend-plugin-api": "^0.9.0",
56
+ "@backstage/plugin-catalog-react": "^1.14.0",
56
57
  "@material-ui/core": "^4.12.2",
57
58
  "@material-ui/lab": "4.0.0-alpha.61",
58
59
  "cross-fetch": "^4.0.0",
@@ -65,11 +66,11 @@
65
66
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
66
67
  },
67
68
  "devDependencies": {
68
- "@backstage/cli": "^0.27.0",
69
- "@backstage/core-app-api": "^1.14.2",
70
- "@backstage/dev-utils": "^1.0.37",
71
- "@backstage/frontend-test-utils": "^0.1.12",
72
- "@backstage/test-utils": "^1.5.10",
69
+ "@backstage/cli": "^0.28.0",
70
+ "@backstage/core-app-api": "^1.15.1",
71
+ "@backstage/dev-utils": "^1.1.2",
72
+ "@backstage/frontend-test-utils": "^0.2.1",
73
+ "@backstage/test-utils": "^1.7.0",
73
74
  "@testing-library/dom": "^10.0.0",
74
75
  "@testing-library/jest-dom": "^6.0.0",
75
76
  "@testing-library/react": "^15.0.0",