@kyverno/backstage-plugin-policy-reporter 2.5.0 → 2.7.0

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,28 @@
1
1
  # @kyverno/backstage-plugin-policy-reporter
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4b09f8c: Backstage verion bump to v1.48.5
8
+ - c4e5ae4: Add initial support for the new Frontend System, this will be available under a `/alpha` route when importing packages.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [4b09f8c]
13
+ - @kyverno/backstage-plugin-policy-reporter-common@2.3.0
14
+
15
+ ## 2.6.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 93bf028: Added namespace filtering to the `PolicyReportsPage`. Users can now filter the list of policy reports by selecting one or more namespaces from the selected cluster.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [93bf028]
24
+ - @kyverno/backstage-plugin-policy-reporter-common@2.2.0
25
+
3
26
  ## 2.5.0
4
27
 
5
28
  ### Minor Changes
@@ -0,0 +1,77 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { ApiBlueprint, discoveryApiRef, fetchApiRef, PageBlueprint, SubPageBlueprint, createRouteRef, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
+ import { rootRouteRef } from '../routes.esm.js';
4
+ import { policyReporterApiRef } from '../api/PolicyReporterClient.esm.js';
5
+ import { DefaultApiClient } from '@kyverno/backstage-plugin-policy-reporter-common';
6
+ import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
7
+ import { isPolicyReporterAvailable } from '../utils/annotations.esm.js';
8
+ import PolicyIcon from '@material-ui/icons/Policy';
9
+
10
+ const policyReporterApi = ApiBlueprint.make({
11
+ params: (defineParams) => defineParams({
12
+ api: policyReporterApiRef,
13
+ deps: {
14
+ discoveryApi: discoveryApiRef,
15
+ fetchApi: fetchApiRef
16
+ },
17
+ factory: ({ discoveryApi, fetchApi }) => new DefaultApiClient({ discoveryApi, fetchApi })
18
+ })
19
+ });
20
+ const policyReporterPage = PageBlueprint.make({
21
+ params: {
22
+ path: "/policy-reporter",
23
+ routeRef: rootRouteRef,
24
+ title: "Policy Reporter"
25
+ }
26
+ });
27
+ const policyReporterNamespacedPoliciesPage = SubPageBlueprint.make({
28
+ name: "namespaced-policy",
29
+ params: {
30
+ path: "namespaced-policies",
31
+ routeRef: createRouteRef(),
32
+ // TODO: Support configuration of the actual component
33
+ title: "Namespaced Policies",
34
+ loader: () => (
35
+ // TODO: Create dedicated PolicyReporterNamespacedPoliciesPage Component
36
+ import('../components/PolicyReportsPage/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.PolicyReportsPage, {}))
37
+ )
38
+ }
39
+ });
40
+ const policyReporterEntityContent = EntityContentBlueprint.make({
41
+ name: "policy-reporter",
42
+ params: {
43
+ path: "/policy-reporter",
44
+ title: "Policy Reporter",
45
+ // TODO: Support configuration of the actual component
46
+ filter: isPolicyReporterAvailable,
47
+ loader: () => (
48
+ // TODO: Create dedicated EntityPolicyReporterContent component as replacement for Kyverno and Custom content components
49
+ import('../components/EntityKyvernoPoliciesContent/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityKyvernoPoliciesContent, {}))
50
+ )
51
+ }
52
+ });
53
+ const policyReporterNavItem = NavItemBlueprint.make({
54
+ params: {
55
+ title: "Policy Reporter",
56
+ icon: () => /* @__PURE__ */ jsx(PolicyIcon, {}),
57
+ routeRef: rootRouteRef
58
+ }
59
+ });
60
+ var plugin = createFrontendPlugin({
61
+ pluginId: "policy-reporter",
62
+ title: "Policy Reporter",
63
+ info: { packageJson: () => import('../package.json.esm.js') },
64
+ routes: {
65
+ root: rootRouteRef
66
+ },
67
+ extensions: [
68
+ policyReporterApi,
69
+ policyReporterEntityContent,
70
+ policyReporterPage,
71
+ policyReporterNamespacedPoliciesPage,
72
+ policyReporterNavItem
73
+ ]
74
+ });
75
+
76
+ export { plugin as default, policyReporterApi, policyReporterNavItem };
77
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["import {\n ApiBlueprint,\n createFrontendPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n NavItemBlueprint,\n PageBlueprint,\n SubPageBlueprint,\n} from '@backstage/frontend-plugin-api';\n\nimport { rootRouteRef } from '../routes';\nimport { policyReporterApiRef } from '../api';\nimport { DefaultApiClient } from '@kyverno/backstage-plugin-policy-reporter-common';\n\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { isPolicyReporterAvailable } from '../utils/annotations';\nimport PolicyIcon from '@material-ui/icons/Policy';\n\n/** @alpha */\nexport const policyReporterApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: policyReporterApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DefaultApiClient({ discoveryApi, fetchApi }),\n }),\n});\n\n/** @alpha */\nconst policyReporterPage = PageBlueprint.make({\n params: {\n path: '/policy-reporter',\n routeRef: rootRouteRef,\n title: 'Policy Reporter',\n },\n});\n\n/** @alpha */\nconst policyReporterNamespacedPoliciesPage = SubPageBlueprint.make({\n name: 'namespaced-policy',\n params: {\n path: 'namespaced-policies',\n routeRef: createRouteRef(),\n // TODO: Support configuration of the actual component\n title: 'Namespaced Policies',\n loader: () =>\n // TODO: Create dedicated PolicyReporterNamespacedPoliciesPage Component\n import('../components/PolicyReportsPage/').then(m => (\n <m.PolicyReportsPage /> // TODO: Update the PolicyReportsPage to be only used for old frontend system to mimic PageBlueprint from NFS\n )),\n },\n});\n\n/** @alpha */\nconst policyReporterEntityContent = EntityContentBlueprint.make({\n name: 'policy-reporter',\n params: {\n path: '/policy-reporter',\n title: 'Policy Reporter',\n // TODO: Support configuration of the actual component\n filter: isPolicyReporterAvailable,\n loader: () =>\n // TODO: Create dedicated EntityPolicyReporterContent component as replacement for Kyverno and Custom content components\n import('../components/EntityKyvernoPoliciesContent/').then(m => (\n <m.EntityKyvernoPoliciesContent />\n )),\n },\n});\n\n/** @alpha */\nexport const policyReporterNavItem = NavItemBlueprint.make({\n params: {\n title: 'Policy Reporter',\n icon: () => <PolicyIcon />,\n routeRef: rootRouteRef,\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'policy-reporter',\n title: 'Policy Reporter',\n info: { packageJson: () => import('../../package.json') },\n routes: {\n root: rootRouteRef,\n },\n extensions: [\n policyReporterApi,\n policyReporterEntityContent,\n policyReporterPage,\n policyReporterNamespacedPoliciesPage,\n policyReporterNavItem,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;AAoBa,MAAA,iBAAA,GAAoB,aAAa,IAAK,CAAA;AAAA,EACjD,MAAA,EAAQ,kBACN,YAAa,CAAA;AAAA,IACX,GAAK,EAAA,oBAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,eAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,gBAAiB,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,GAClD;AACL,CAAC;AAGD,MAAM,kBAAA,GAAqB,cAAc,IAAK,CAAA;AAAA,EAC5C,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,kBAAA;AAAA,IACN,QAAU,EAAA,YAAA;AAAA,IACV,KAAO,EAAA;AAAA;AAEX,CAAC,CAAA;AAGD,MAAM,oCAAA,GAAuC,iBAAiB,IAAK,CAAA;AAAA,EACjE,IAAM,EAAA,mBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,qBAAA;AAAA,IACN,UAAU,cAAe,EAAA;AAAA;AAAA,IAEzB,KAAO,EAAA,qBAAA;AAAA,IACP,MAAQ,EAAA;AAAA;AAAA,MAEN,OAAO,8CAAkC,CAAE,CAAA,IAAA,CAAK,uBAC7C,GAAA,CAAA,CAAA,CAAE,iBAAF,EAAA,EAAoB,CACtB;AAAA;AAAA;AAEP,CAAC,CAAA;AAGD,MAAM,2BAAA,GAA8B,uBAAuB,IAAK,CAAA;AAAA,EAC9D,IAAM,EAAA,iBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,kBAAA;AAAA,IACN,KAAO,EAAA,iBAAA;AAAA;AAAA,IAEP,MAAQ,EAAA,yBAAA;AAAA,IACR,MAAQ,EAAA;AAAA;AAAA,MAEN,OAAO,yDAA6C,CAAE,CAAA,IAAA,CAAK,uBACxD,GAAA,CAAA,CAAA,CAAE,4BAAF,EAAA,EAA+B,CACjC;AAAA;AAAA;AAEP,CAAC,CAAA;AAGY,MAAA,qBAAA,GAAwB,iBAAiB,IAAK,CAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,iBAAA;AAAA,IACP,IAAA,EAAM,sBAAM,GAAA,CAAC,UAAW,EAAA,EAAA,CAAA;AAAA,IACxB,QAAU,EAAA;AAAA;AAEd,CAAC;AAGD,aAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,iBAAA;AAAA,EACV,KAAO,EAAA,iBAAA;AAAA,EACP,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,wBAAoB,CAAE,EAAA;AAAA,EACxD,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,iBAAA;AAAA,IACA,2BAAA;AAAA,IACA,kBAAA;AAAA,IACA,oCAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
@@ -0,0 +1,147 @@
1
+ import * as _backstage_catalog_model from '@backstage/catalog-model';
2
+ import * as react from 'react';
3
+ import * as _backstage_filter_predicates from '@backstage/filter-predicates';
4
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
5
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
6
+
7
+ /** @alpha */
8
+ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
9
+ root: _backstage_core_plugin_api.RouteRef<undefined>;
10
+ }, {}, {
11
+ "api:policy-reporter": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
12
+ kind: "api";
13
+ name: undefined;
14
+ config: {};
15
+ configInput: {};
16
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
17
+ inputs: {};
18
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
19
+ }>;
20
+ "entity-content:policy-reporter/policy-reporter": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
21
+ kind: "entity-content";
22
+ name: "policy-reporter";
23
+ config: {
24
+ path: string | undefined;
25
+ title: string | undefined;
26
+ filter: _backstage_filter_predicates.FilterPredicate | undefined;
27
+ group: string | false | undefined;
28
+ icon: string | undefined;
29
+ };
30
+ configInput: {
31
+ filter?: _backstage_filter_predicates.FilterPredicate | undefined;
32
+ title?: string | undefined;
33
+ path?: string | undefined;
34
+ group?: string | false | undefined;
35
+ icon?: string | undefined;
36
+ };
37
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
38
+ optional: true;
39
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
40
+ optional: true;
41
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
42
+ optional: true;
43
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-group", {
44
+ optional: true;
45
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string | react.ReactElement<any, string | react.JSXElementConstructor<any>>, "catalog.entity-content-icon", {
46
+ optional: true;
47
+ }>;
48
+ inputs: {};
49
+ params: {
50
+ defaultPath?: [Error: `Use the 'path' param instead`];
51
+ path: string;
52
+ defaultTitle?: [Error: `Use the 'title' param instead`];
53
+ title: string;
54
+ defaultGroup?: [Error: `Use the 'group' param instead`];
55
+ group?: ("overview" | "documentation" | "development" | "deployment" | "operation" | "observability") | (string & {});
56
+ icon?: string | react.ReactElement;
57
+ loader: () => Promise<JSX.Element>;
58
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
59
+ filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
60
+ };
61
+ }>;
62
+ "nav-item:policy-reporter": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
63
+ kind: "nav-item";
64
+ name: undefined;
65
+ config: {};
66
+ configInput: {};
67
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<{
68
+ title: string;
69
+ icon: _backstage_frontend_plugin_api.IconComponent;
70
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
71
+ }, "core.nav-item.target", {}>;
72
+ inputs: {};
73
+ params: {
74
+ title: string;
75
+ icon: _backstage_frontend_plugin_api.IconComponent;
76
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
77
+ };
78
+ }>;
79
+ "page:policy-reporter": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
80
+ kind: "page";
81
+ name: undefined;
82
+ config: {
83
+ path: string | undefined;
84
+ title: string | undefined;
85
+ };
86
+ configInput: {
87
+ title?: string | undefined;
88
+ path?: string | undefined;
89
+ };
90
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
91
+ optional: true;
92
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
93
+ optional: true;
94
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
95
+ optional: true;
96
+ }>;
97
+ inputs: {
98
+ pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
99
+ optional: true;
100
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
101
+ optional: true;
102
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
103
+ optional: true;
104
+ }>, {
105
+ singleton: false;
106
+ optional: false;
107
+ internal: false;
108
+ }>;
109
+ };
110
+ params: {
111
+ defaultPath?: [Error: `Use the 'path' param instead`];
112
+ path: string;
113
+ title?: string;
114
+ icon?: _backstage_frontend_plugin_api.IconElement;
115
+ loader?: () => Promise<react.JSX.Element>;
116
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
117
+ noHeader?: boolean;
118
+ };
119
+ }>;
120
+ "sub-page:policy-reporter/namespaced-policy": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
121
+ kind: "sub-page";
122
+ name: "namespaced-policy";
123
+ config: {
124
+ path: string | undefined;
125
+ title: string | undefined;
126
+ };
127
+ configInput: {
128
+ title?: string | undefined;
129
+ path?: string | undefined;
130
+ };
131
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
132
+ optional: true;
133
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
134
+ optional: true;
135
+ }>;
136
+ inputs: {};
137
+ params: {
138
+ path: string;
139
+ title: string;
140
+ icon?: _backstage_frontend_plugin_api.IconElement;
141
+ loader: () => Promise<JSX.Element>;
142
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
143
+ };
144
+ }>;
145
+ }>;
146
+
147
+ export { _default as default };
@@ -0,0 +1,2 @@
1
+ export { default } from './alpha/plugin.esm.js';
2
+ //# sourceMappingURL=alpha.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -7,6 +7,8 @@ import { PolicyReportsTable } from '../PolicyReportsTable/PolicyReportsTable.esm
7
7
  import { useState } from 'react';
8
8
  import { SelectStatus } from '../SelectStatus/SelectStatus.esm.js';
9
9
  import { SelectSeverity } from '../SelectSeverity/SelectSeverity.esm.js';
10
+ import { SelectNamespace } from '../SelectNamespace/SelectNamespace.esm.js';
11
+ import { useNamespaces } from '../../hooks/useNamespaces.esm.js';
10
12
 
11
13
  const PolicyReportsPage = ({
12
14
  title = "Policy Reports",
@@ -21,6 +23,8 @@ const PolicyReportsPage = ({
21
23
  } = useEnvironments();
22
24
  const [status, setStatus] = useState(["fail"]);
23
25
  const [severity, setSeverity] = useState([]);
26
+ const [selectedNamespaces, setSelectedNamespaces] = useState([]);
27
+ const { namespaces: availableNamespaces } = useNamespaces(currentEnvironment);
24
28
  if (environmentsLoading) return /* @__PURE__ */ jsx(Progress, {});
25
29
  if (environments === void 0 || !currentEnvironment)
26
30
  return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
@@ -59,6 +63,14 @@ const PolicyReportsPage = ({
59
63
  setSeverity
60
64
  }
61
65
  ),
66
+ /* @__PURE__ */ jsx(
67
+ SelectNamespace,
68
+ {
69
+ currentNamespaces: selectedNamespaces,
70
+ setNamespaces: setSelectedNamespaces,
71
+ availableNamespaces
72
+ }
73
+ ),
62
74
  /* @__PURE__ */ jsx(
63
75
  SelectEnvironment,
64
76
  {
@@ -74,7 +86,8 @@ const PolicyReportsPage = ({
74
86
  currentEnvironment,
75
87
  filter: {
76
88
  status,
77
- severities: severity
89
+ severities: severity,
90
+ namespaces: selectedNamespaces
78
91
  },
79
92
  title: "Policy Results",
80
93
  emptyContentText: "No policies found",
@@ -1 +1 @@
1
- {"version":3,"file":"PolicyReportsPage.esm.js","sources":["../../../src/components/PolicyReportsPage/PolicyReportsPage.tsx"],"sourcesContent":["import {\n Content,\n ContentHeader,\n EmptyState,\n Header,\n Link,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport { useEnvironments } from '../../hooks/useEnvironments';\nimport { SelectEnvironment } from '../SelectEnvironment';\nimport { Button, Grid } from '@material-ui/core';\nimport { PolicyReportsTable } from '../PolicyReportsTable';\nimport { useState } from 'react';\nimport {\n Severity,\n Status,\n} from '@kyverno/backstage-plugin-policy-reporter-common';\nimport { SelectStatus } from '../SelectStatus';\nimport { SelectSeverity } from '../SelectSeverity';\n\nexport interface PolicyReportsPageProps {\n title?: string;\n policyDocumentationUrl?: string;\n subtitle?: string;\n}\n\nexport const PolicyReportsPage = ({\n title = 'Policy Reports',\n subtitle = 'View all policy reports from a Kubernetes cluster',\n policyDocumentationUrl,\n}: PolicyReportsPageProps) => {\n const {\n environments,\n environmentsLoading,\n setCurrentEnvironment,\n currentEnvironment,\n } = useEnvironments();\n\n const [status, setStatus] = useState<Status[]>(['fail']);\n const [severity, setSeverity] = useState<Severity[]>([]);\n\n // Fetching environments\n if (environmentsLoading) return <Progress />;\n\n // Environments missing\n if (environments === undefined || !currentEnvironment)\n return (\n <Page themeId=\"tool\">\n <Header title={title} subtitle={subtitle} />\n <Content>\n <EmptyState\n missing=\"content\"\n title=\"No kubernetes-cluster Resources found\"\n description={\n <>\n You need to define a Resource with the kubernetes-cluster type\n and a<code> kyverno.io/endpoint </code> annotation for this\n plugin to work.\n </>\n }\n action={\n <>\n <Button\n color=\"primary\"\n component={Link}\n to=\"https://github.com/kyverno/backstage-policy-reporter-plugin\"\n >\n Read More\n </Button>\n </>\n }\n />\n </Content>\n </Page>\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title={title} subtitle={subtitle} />\n <Content>\n <ContentHeader>\n <SelectStatus currentStatus={status} setStatus={setStatus} />\n <SelectSeverity\n currentSeverity={severity}\n setSeverity={setSeverity}\n />\n <SelectEnvironment\n environments={environments}\n currentEnvironment={currentEnvironment}\n setCurrentEnvironment={setCurrentEnvironment}\n />\n </ContentHeader>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <PolicyReportsTable\n currentEnvironment={currentEnvironment}\n filter={{\n status: status,\n severities: severity,\n }}\n title=\"Policy Results\"\n emptyContentText=\"No policies found\"\n policyDocumentationUrl={policyDocumentationUrl}\n pagination={{ offset: 25 }}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,oBAAoB,CAAC;AAAA,EAChC,KAAQ,GAAA,gBAAA;AAAA,EACR,QAAW,GAAA,mDAAA;AAAA,EACX;AACF,CAA8B,KAAA;AAC5B,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,MACE,eAAgB,EAAA;AAEpB,EAAA,MAAM,CAAC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AAA,IAAA,CAAC,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,YAAA,EAAA,EAAa,aAAe,EAAA,MAAA,EAAQ,SAAsB,EAAA,CAAA;AAAA,wBAC3D,GAAA;AAAA,UAAC,cAAA;AAAA,UAAA;AAAA,YACC,eAAiB,EAAA,QAAA;AAAA,YACjB;AAAA;AAAA,SACF;AAAA,wBACA,GAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,YAAA;AAAA,YACA,kBAAA;AAAA,YACA;AAAA;AAAA;AACF,OACF,EAAA,CAAA;AAAA,sBACA,GAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,CACvB,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,kBAAA;AAAA,UACA,MAAQ,EAAA;AAAA,YACN,MAAA;AAAA,YACA,UAAY,EAAA;AAAA,WACd;AAAA,UACA,KAAM,EAAA,gBAAA;AAAA,UACN,gBAAiB,EAAA,mBAAA;AAAA,UACjB,sBAAA;AAAA,UACA,UAAA,EAAY,EAAE,MAAA,EAAQ,EAAG;AAAA;AAAA,SAE7B,CACF,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PolicyReportsPage.esm.js","sources":["../../../src/components/PolicyReportsPage/PolicyReportsPage.tsx"],"sourcesContent":["import {\n Content,\n ContentHeader,\n EmptyState,\n Header,\n Link,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport { useEnvironments } from '../../hooks/useEnvironments';\nimport { SelectEnvironment } from '../SelectEnvironment';\nimport { Button, Grid } from '@material-ui/core';\nimport { PolicyReportsTable } from '../PolicyReportsTable';\nimport { useState } from 'react';\nimport {\n Severity,\n Status,\n} from '@kyverno/backstage-plugin-policy-reporter-common';\nimport { SelectStatus } from '../SelectStatus';\nimport { SelectSeverity } from '../SelectSeverity';\nimport { SelectNamespace } from '../SelectNamespace';\nimport { useNamespaces } from '../../hooks/useNamespaces';\n\nexport interface PolicyReportsPageProps {\n title?: string;\n policyDocumentationUrl?: string;\n subtitle?: string;\n}\n\nexport const PolicyReportsPage = ({\n title = 'Policy Reports',\n subtitle = 'View all policy reports from a Kubernetes cluster',\n policyDocumentationUrl,\n}: PolicyReportsPageProps) => {\n const {\n environments,\n environmentsLoading,\n setCurrentEnvironment,\n currentEnvironment,\n } = useEnvironments();\n\n const [status, setStatus] = useState<Status[]>(['fail']);\n const [severity, setSeverity] = useState<Severity[]>([]);\n const [selectedNamespaces, setSelectedNamespaces] = useState<string[]>([]);\n const { namespaces: availableNamespaces } = useNamespaces(currentEnvironment);\n\n // Fetching environments\n if (environmentsLoading) return <Progress />;\n\n // Environments missing\n if (environments === undefined || !currentEnvironment)\n return (\n <Page themeId=\"tool\">\n <Header title={title} subtitle={subtitle} />\n <Content>\n <EmptyState\n missing=\"content\"\n title=\"No kubernetes-cluster Resources found\"\n description={\n <>\n You need to define a Resource with the kubernetes-cluster type\n and a<code> kyverno.io/endpoint </code> annotation for this\n plugin to work.\n </>\n }\n action={\n <>\n <Button\n color=\"primary\"\n component={Link}\n to=\"https://github.com/kyverno/backstage-policy-reporter-plugin\"\n >\n Read More\n </Button>\n </>\n }\n />\n </Content>\n </Page>\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title={title} subtitle={subtitle} />\n <Content>\n <ContentHeader>\n <SelectStatus currentStatus={status} setStatus={setStatus} />\n <SelectSeverity\n currentSeverity={severity}\n setSeverity={setSeverity}\n />\n <SelectNamespace\n currentNamespaces={selectedNamespaces}\n setNamespaces={setSelectedNamespaces}\n availableNamespaces={availableNamespaces}\n />\n <SelectEnvironment\n environments={environments}\n currentEnvironment={currentEnvironment}\n setCurrentEnvironment={setCurrentEnvironment}\n />\n </ContentHeader>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <PolicyReportsTable\n currentEnvironment={currentEnvironment}\n filter={{\n status: status,\n severities: severity,\n namespaces: selectedNamespaces,\n }}\n title=\"Policy Results\"\n emptyContentText=\"No policies found\"\n policyDocumentationUrl={policyDocumentationUrl}\n pagination={{ offset: 25 }}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,oBAAoB,CAAC;AAAA,EAChC,KAAQ,GAAA,gBAAA;AAAA,EACR,QAAW,GAAA,mDAAA;AAAA,EACX;AACF,CAA8B,KAAA;AAC5B,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,MACE,eAAgB,EAAA;AAEpB,EAAA,MAAM,CAAC,MAAQ,EAAA,SAAS,IAAI,QAAmB,CAAA,CAAC,MAAM,CAAC,CAAA;AACvD,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,QAAA,CAAqB,EAAE,CAAA;AACvD,EAAA,MAAM,CAAC,kBAAoB,EAAA,qBAAqB,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AACzE,EAAA,MAAM,EAAE,UAAA,EAAY,mBAAoB,EAAA,GAAI,cAAc,kBAAkB,CAAA;AAG5E,EAAI,IAAA,mBAAA,EAA4B,uBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,CAAA;AAG1C,EAAI,IAAA,YAAA,KAAiB,UAAa,CAAC,kBAAA;AACjC,IACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,MAAA,EAAA,EAAO,OAAc,QAAoB,EAAA,CAAA;AAAA,0BACzC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,SAAA;AAA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K,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,CACvB,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,kBAAA;AAAA,UACA,MAAQ,EAAA;AAAA,YACN,MAAA;AAAA,YACA,UAAY,EAAA,QAAA;AAAA,YACZ,UAAY,EAAA;AAAA,WACd;AAAA,UACA,KAAM,EAAA,gBAAA;AAAA,UACN,gBAAiB,EAAA,mBAAA;AAAA,UACjB,sBAAA;AAAA,UACA,UAAA,EAAY,EAAE,MAAA,EAAQ,EAAG;AAAA;AAAA,SAE7B,CACF,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,51 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import MenuItem from '@material-ui/core/MenuItem';
3
+ import InputLabel from '@material-ui/core/InputLabel';
4
+ import FormControl from '@material-ui/core/FormControl';
5
+ import Select from '@material-ui/core/Select';
6
+ import { makeStyles } from '@material-ui/core/styles';
7
+ import { Checkbox, ListItemText } from '@material-ui/core';
8
+
9
+ const useStyles = makeStyles({
10
+ formControl: {
11
+ margin: 8,
12
+ minWidth: 150
13
+ }
14
+ });
15
+ const SelectNamespace = ({
16
+ currentNamespaces,
17
+ setNamespaces,
18
+ availableNamespaces
19
+ }) => {
20
+ const classes = useStyles();
21
+ const handleChange = (event) => {
22
+ setNamespaces(event.target.value);
23
+ };
24
+ return /* @__PURE__ */ jsxs(FormControl, { className: classes.formControl, children: [
25
+ /* @__PURE__ */ jsx(InputLabel, { id: "select-namespace-label", shrink: true, children: "Namespaces" }),
26
+ /* @__PURE__ */ jsx(
27
+ Select,
28
+ {
29
+ labelId: "select-namespace-label",
30
+ id: "select-namespace",
31
+ multiple: true,
32
+ displayEmpty: true,
33
+ value: currentNamespaces,
34
+ renderValue: (selected) => {
35
+ if (selected.length === 0) {
36
+ return "All";
37
+ }
38
+ return selected.join(", ");
39
+ },
40
+ onChange: handleChange,
41
+ children: availableNamespaces.map((namespace) => /* @__PURE__ */ jsxs(MenuItem, { value: namespace, children: [
42
+ /* @__PURE__ */ jsx(Checkbox, { checked: currentNamespaces.includes(namespace) }),
43
+ /* @__PURE__ */ jsx(ListItemText, { primary: namespace })
44
+ ] }, namespace))
45
+ }
46
+ )
47
+ ] });
48
+ };
49
+
50
+ export { SelectNamespace };
51
+ //# sourceMappingURL=SelectNamespace.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectNamespace.esm.js","sources":["../../../src/components/SelectNamespace/SelectNamespace.tsx"],"sourcesContent":["import MenuItem from '@material-ui/core/MenuItem';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport FormControl from '@material-ui/core/FormControl';\nimport Select from '@material-ui/core/Select';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Checkbox, ListItemText } from '@material-ui/core';\n\nconst useStyles = makeStyles({\n formControl: {\n margin: 8,\n minWidth: 150,\n },\n});\n\nexport type SelectNamespaceProps = {\n currentNamespaces: string[];\n setNamespaces: (namespaces: string[]) => void;\n availableNamespaces: string[];\n};\n\nexport const SelectNamespace = ({\n currentNamespaces,\n setNamespaces,\n availableNamespaces,\n}: SelectNamespaceProps) => {\n const classes = useStyles();\n\n const handleChange = (event: any) => {\n setNamespaces(event.target.value);\n };\n\n return (\n <FormControl className={classes.formControl}>\n <InputLabel id=\"select-namespace-label\" shrink>\n Namespaces\n </InputLabel>\n <Select\n labelId=\"select-namespace-label\"\n id=\"select-namespace\"\n multiple\n displayEmpty\n value={currentNamespaces}\n renderValue={selected => {\n if ((selected as string[]).length === 0) {\n return 'All';\n }\n\n return (selected as string[]).join(', ');\n }}\n onChange={handleChange}\n >\n {availableNamespaces.map(namespace => (\n <MenuItem key={namespace} value={namespace}>\n <Checkbox checked={currentNamespaces.includes(namespace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AS,EAAA,EAAA,OAAA,EAAS,iBAAkB,CAAA,QAAA,CAAS,SAAS,CAAG,EAAA,CAAA;AAAA,0BAC1D,GAAA,CAAC,YAAa,EAAA,EAAA,OAAA,EAAS,SAAW,EAAA;AAAA,SAAA,EAAA,EAFrB,SAGf,CACD;AAAA;AAAA;AACH,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,28 @@
1
+ import { useAsync } from 'react-use';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { policyReporterApiRef } from '../api/PolicyReporterClient.esm.js';
4
+
5
+ const useNamespaces = (currentEnvironment) => {
6
+ const api = useApi(policyReporterApiRef);
7
+ const {
8
+ value: namespaces,
9
+ loading,
10
+ error
11
+ } = useAsync(async () => {
12
+ if (!currentEnvironment) {
13
+ return [];
14
+ }
15
+ const response = await api.getNamespaces({
16
+ query: { environment: currentEnvironment.entityRef }
17
+ });
18
+ return response.json();
19
+ }, [api, currentEnvironment]);
20
+ return {
21
+ namespaces: namespaces ?? [],
22
+ loading,
23
+ error
24
+ };
25
+ };
26
+
27
+ export { useNamespaces };
28
+ //# sourceMappingURL=useNamespaces.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNamespaces.esm.js","sources":["../../src/hooks/useNamespaces.ts"],"sourcesContent":["import { useAsync } from 'react-use';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { policyReporterApiRef } from '../api';\nimport { Environment } from '@kyverno/backstage-plugin-policy-reporter-common';\n\nexport const useNamespaces = (currentEnvironment?: Environment) => {\n const api = useApi(policyReporterApiRef);\n\n const {\n value: namespaces,\n loading,\n error,\n } = useAsync(async () => {\n if (!currentEnvironment) {\n return [];\n }\n\n const response = await api.getNamespaces({\n query: { environment: currentEnvironment.entityRef },\n });\n return response.json();\n }, [api, currentEnvironment]);\n\n return {\n namespaces: namespaces ?? [],\n loading,\n error,\n };\n};\n"],"names":[],"mappings":";;;;AAKa,MAAA,aAAA,GAAgB,CAAC,kBAAqC,KAAA;AACjE,EAAM,MAAA,GAAA,GAAM,OAAO,oBAAoB,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,UAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,IAAI,CAAC,kBAAoB,EAAA;AACvB,MAAA,OAAO,EAAC;AAAA;AAGV,IAAM,MAAA,QAAA,GAAW,MAAM,GAAA,CAAI,aAAc,CAAA;AAAA,MACvC,KAAO,EAAA,EAAE,WAAa,EAAA,kBAAA,CAAmB,SAAU;AAAA,KACpD,CAAA;AACD,IAAA,OAAO,SAAS,IAAK,EAAA;AAAA,GACpB,EAAA,CAAC,GAAK,EAAA,kBAAkB,CAAC,CAAA;AAE5B,EAAO,OAAA;AAAA,IACL,UAAA,EAAY,cAAc,EAAC;AAAA,IAC3B,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,106 @@
1
+ var name = "@kyverno/backstage-plugin-policy-reporter";
2
+ var version = "2.7.0";
3
+ var main = "src/index.ts";
4
+ var types = "src/index.ts";
5
+ var license = "Apache-2.0";
6
+ var keywords = [
7
+ "backstage",
8
+ "kyverno",
9
+ "policy-reporter"
10
+ ];
11
+ var backstage = {
12
+ role: "frontend-plugin",
13
+ pluginId: "policy-reporter",
14
+ pluginPackages: [
15
+ "@kyverno/backstage-plugin-policy-reporter",
16
+ "@kyverno/backstage-plugin-policy-reporter-backend",
17
+ "@kyverno/backstage-plugin-policy-reporter-common"
18
+ ]
19
+ };
20
+ var publishConfig = {
21
+ access: "public",
22
+ main: "dist/index.esm.js",
23
+ types: "dist/index.d.ts"
24
+ };
25
+ var exports = {
26
+ ".": "./src/index.ts",
27
+ "./alpha": "./src/alpha.ts",
28
+ "./package.json": "./package.json"
29
+ };
30
+ var typesVersions = {
31
+ "*": {
32
+ alpha: [
33
+ "src/alpha.ts"
34
+ ],
35
+ "package.json": [
36
+ "package.json"
37
+ ]
38
+ }
39
+ };
40
+ var sideEffects = false;
41
+ var scripts = {
42
+ start: "backstage-cli package start",
43
+ build: "backstage-cli package build",
44
+ lint: "backstage-cli package lint",
45
+ test: "backstage-cli package test",
46
+ clean: "backstage-cli package clean",
47
+ prepack: "backstage-cli package prepack",
48
+ postpack: "backstage-cli package postpack"
49
+ };
50
+ var repository = {
51
+ type: "git",
52
+ url: "https://github.com/kyverno/backstage-policy-reporter-plugin",
53
+ directory: "plugins/policy-reporter"
54
+ };
55
+ var dependencies = {
56
+ "@backstage/catalog-client": "backstage:^",
57
+ "@backstage/catalog-model": "backstage:^",
58
+ "@backstage/core-components": "backstage:^",
59
+ "@backstage/core-plugin-api": "backstage:^",
60
+ "@backstage/frontend-plugin-api": "backstage:^",
61
+ "@backstage/plugin-catalog-react": "backstage:^",
62
+ "@backstage/theme": "backstage:^",
63
+ "@kyverno/backstage-plugin-policy-reporter-common": "workspace:^",
64
+ "@material-ui/core": "^4.12.4",
65
+ "@material-ui/icons": "^4.11.3",
66
+ "@material-ui/lab": "4.0.0-alpha.61",
67
+ "react-use": "^17.6.0"
68
+ };
69
+ var peerDependencies = {
70
+ react: "^16.13.1 || ^17.0.0 || ^18.0.0"
71
+ };
72
+ var devDependencies = {
73
+ "@backstage/cli": "backstage:^",
74
+ "@backstage/core-app-api": "backstage:^",
75
+ "@backstage/dev-utils": "backstage:^",
76
+ "@backstage/test-utils": "backstage:^",
77
+ "@testing-library/jest-dom": "^6.0.0",
78
+ "@testing-library/react": "^14.0.0",
79
+ "@testing-library/user-event": "^14.0.0",
80
+ msw: "^1.0.0"
81
+ };
82
+ var files = [
83
+ "dist"
84
+ ];
85
+ var _package = {
86
+ name: name,
87
+ version: version,
88
+ main: main,
89
+ types: types,
90
+ license: license,
91
+ keywords: keywords,
92
+ backstage: backstage,
93
+ publishConfig: publishConfig,
94
+ exports: exports,
95
+ typesVersions: typesVersions,
96
+ sideEffects: sideEffects,
97
+ scripts: scripts,
98
+ repository: repository,
99
+ dependencies: dependencies,
100
+ peerDependencies: peerDependencies,
101
+ devDependencies: devDependencies,
102
+ files: files
103
+ };
104
+
105
+ export { backstage, _package as default, dependencies, devDependencies, exports, files, keywords, license, main, name, peerDependencies, publishConfig, repository, scripts, sideEffects, types, typesVersions, version };
106
+ //# sourceMappingURL=package.json.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyverno/backstage-plugin-policy-reporter",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -16,13 +16,40 @@
16
16
  "@kyverno/backstage-plugin-policy-reporter",
17
17
  "@kyverno/backstage-plugin-policy-reporter-backend",
18
18
  "@kyverno/backstage-plugin-policy-reporter-common"
19
- ]
19
+ ],
20
+ "features": {
21
+ "./alpha": "@backstage/FrontendPlugin"
22
+ }
20
23
  },
21
24
  "publishConfig": {
22
25
  "access": "public",
23
26
  "main": "dist/index.esm.js",
24
27
  "types": "dist/index.d.ts"
25
28
  },
29
+ "exports": {
30
+ ".": {
31
+ "import": "./dist/index.esm.js",
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.esm.js"
34
+ },
35
+ "./alpha": {
36
+ "backstage": "@backstage/FrontendPlugin",
37
+ "import": "./dist/alpha.esm.js",
38
+ "types": "./dist/alpha.d.ts",
39
+ "default": "./dist/alpha.esm.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "typesVersions": {
44
+ "*": {
45
+ "alpha": [
46
+ "dist/alpha.d.ts"
47
+ ],
48
+ "package.json": [
49
+ "package.json"
50
+ ]
51
+ }
52
+ },
26
53
  "sideEffects": false,
27
54
  "scripts": {
28
55
  "start": "backstage-cli package start",
@@ -39,13 +66,14 @@
39
66
  "directory": "plugins/policy-reporter"
40
67
  },
41
68
  "dependencies": {
42
- "@backstage/catalog-client": "^1.12.0",
43
- "@backstage/catalog-model": "^1.7.5",
44
- "@backstage/core-components": "^0.18.1",
45
- "@backstage/core-plugin-api": "^1.11.0",
46
- "@backstage/plugin-catalog-react": "^1.21.1",
47
- "@backstage/theme": "^0.6.8",
48
- "@kyverno/backstage-plugin-policy-reporter-common": "^2.1.0",
69
+ "@backstage/catalog-client": "^1.13.0",
70
+ "@backstage/catalog-model": "^1.7.6",
71
+ "@backstage/core-components": "^0.18.7",
72
+ "@backstage/core-plugin-api": "^1.12.3",
73
+ "@backstage/frontend-plugin-api": "^0.14.1",
74
+ "@backstage/plugin-catalog-react": "^2.0.0",
75
+ "@backstage/theme": "^0.7.2",
76
+ "@kyverno/backstage-plugin-policy-reporter-common": "^2.3.0",
49
77
  "@material-ui/core": "^4.12.4",
50
78
  "@material-ui/icons": "^4.11.3",
51
79
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -55,10 +83,10 @@
55
83
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0"
56
84
  },
57
85
  "devDependencies": {
58
- "@backstage/cli": "^0.34.3",
59
- "@backstage/core-app-api": "^1.19.0",
60
- "@backstage/dev-utils": "^1.1.14",
61
- "@backstage/test-utils": "^1.7.11",
86
+ "@backstage/cli": "^0.35.4",
87
+ "@backstage/core-app-api": "^1.19.5",
88
+ "@backstage/dev-utils": "^1.1.20",
89
+ "@backstage/test-utils": "^1.7.15",
62
90
  "@testing-library/jest-dom": "^6.0.0",
63
91
  "@testing-library/react": "^14.0.0",
64
92
  "@testing-library/user-event": "^14.0.0",
@@ -67,12 +95,5 @@
67
95
  "files": [
68
96
  "dist"
69
97
  ],
70
- "typesVersions": {
71
- "*": {
72
- "package.json": [
73
- "package.json"
74
- ]
75
- }
76
- },
77
98
  "module": "./dist/index.esm.js"
78
99
  }