@backstage-community/plugin-tech-insights 0.7.0 → 1.0.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 +21 -0
- package/README.md +15 -2
- package/dist/alpha/apis.esm.js +16 -0
- package/dist/alpha/apis.esm.js.map +1 -0
- package/dist/alpha/entityCards.esm.js +15 -0
- package/dist/alpha/entityCards.esm.js.map +1 -0
- package/dist/alpha/entityContent.esm.js +17 -0
- package/dist/alpha/entityContent.esm.js.map +1 -0
- package/dist/alpha/navItems.esm.js +14 -0
- package/dist/alpha/navItems.esm.js.map +1 -0
- package/dist/alpha/pages.esm.js +15 -0
- package/dist/alpha/pages.esm.js.map +1 -0
- package/dist/alpha/plugin.esm.js +20 -0
- package/dist/alpha/plugin.esm.js.map +1 -0
- package/dist/alpha.d.ts +125 -0
- package/dist/alpha.esm.js +2 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/components/ScorecardsPage/Filters.esm.js +25 -1
- package/dist/components/ScorecardsPage/Filters.esm.js.map +1 -1
- package/dist/components/ScorecardsPage/ScorecardsPage.esm.js +38 -6
- package/dist/components/ScorecardsPage/ScorecardsPage.esm.js.map +1 -1
- package/dist/index.d.ts +1 -18
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +1 -21
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +34 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @backstage-community/plugin-tech-insights
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 12c1773: All existing deprecation notices have been removed from the plugin
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- ecd421a: Added filter component to the ScorecardsPage to filter on entities with at least one failed check.
|
|
12
|
+
Also added desc/asc order based on check results in the 'Results' column. Sort by number of failed checks first, then by total checks.
|
|
13
|
+
|
|
14
|
+
## 0.8.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- b5f45fd: The plugin now supports the new frontend system by importing from `@backstage-community/plugin-tech-insights/alpha`.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 450c5aa: The new frontend system plugin now includes a tech insights navigation extension by default
|
|
23
|
+
|
|
3
24
|
## 0.7.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -16,7 +16,20 @@ Main areas covered by this plugin currently are:
|
|
|
16
16
|
yarn --cwd packages/app add @backstage-community/plugin-tech-insights
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Integrating with the New Frontend System
|
|
20
|
+
|
|
21
|
+
If you are using Backstage's [new frontend system](https://backstage.io/docs/frontend-system/), the plugin will be auto-discovered and automatically register:
|
|
22
|
+
|
|
23
|
+
- The Tech Insights API
|
|
24
|
+
- The Scorecards page at `/tech-insights`
|
|
25
|
+
- Entity content for displaying scorecards on entity pages
|
|
26
|
+
- Entity cards for displaying scorecards in entity overview
|
|
27
|
+
|
|
28
|
+
### Integrating with the Legacy Frontend System
|
|
29
|
+
|
|
30
|
+
The following sections describe how to integrate the plugin with the legacy frontend system.
|
|
31
|
+
|
|
32
|
+
#### Add boolean checks overview (Scorecards) page to the EntityPage
|
|
20
33
|
|
|
21
34
|
```tsx
|
|
22
35
|
// packages/app/src/components/catalog/EntityPage.tsx
|
|
@@ -119,7 +132,7 @@ If you follow the [Backend Example](../tech-insights-backend#backend-example), o
|
|
|
119
132
|
|
|
120
133
|

|
|
121
134
|
|
|
122
|
-
|
|
135
|
+
#### Add overview (Scorecards) page
|
|
123
136
|
|
|
124
137
|

|
|
125
138
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiBlueprint, discoveryApiRef, identityApiRef } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { techInsightsApiRef, TechInsightsClient } from '@backstage-community/plugin-tech-insights-react';
|
|
3
|
+
|
|
4
|
+
const techInsightsApi = ApiBlueprint.make({
|
|
5
|
+
params: (defineParams) => defineParams({
|
|
6
|
+
api: techInsightsApiRef,
|
|
7
|
+
deps: {
|
|
8
|
+
discoveryApi: discoveryApiRef,
|
|
9
|
+
identityApi: identityApiRef
|
|
10
|
+
},
|
|
11
|
+
factory: ({ discoveryApi, identityApi }) => new TechInsightsClient({ discoveryApi, identityApi })
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { techInsightsApi };
|
|
16
|
+
//# sourceMappingURL=apis.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.ts"],"sourcesContent":["/*\n * Copyright 2026 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 {\n ApiBlueprint,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n techInsightsApiRef,\n TechInsightsClient,\n} from '@backstage-community/plugin-tech-insights-react';\n\n/**\n * @alpha\n */\nexport const techInsightsApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: techInsightsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, identityApi }) =>\n new TechInsightsClient({ discoveryApi, identityApi }),\n }),\n});\n"],"names":[],"mappings":";;;AA4Ba,MAAA,eAAA,GAAkB,aAAa,IAAK,CAAA;AAAA,EAC/C,MAAA,EAAQ,kBACN,YAAa,CAAA;AAAA,IACX,GAAK,EAAA,kBAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,eAAA;AAAA,MACd,WAAa,EAAA;AAAA,KACf;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,WAAA,EACxB,KAAA,IAAI,kBAAmB,CAAA,EAAE,YAAc,EAAA,WAAA,EAAa;AAAA,GACvD;AACL,CAAC;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { compatWrapper } from '@backstage/core-compat-api';
|
|
3
|
+
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
4
|
+
|
|
5
|
+
const entityTechInsightsScorecardCard = EntityCardBlueprint.make({
|
|
6
|
+
name: "scorecards",
|
|
7
|
+
params: {
|
|
8
|
+
loader: () => import('../components/ScorecardsCard/index.esm.js').then(
|
|
9
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ScorecardsCard, { title: "Scorecards" }))
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { entityTechInsightsScorecardCard };
|
|
15
|
+
//# sourceMappingURL=entityCards.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\n/**\n * Entity card extension that displays Tech Insights scorecards for an entity.\n *\n * @alpha\n */\nexport const entityTechInsightsScorecardCard = EntityCardBlueprint.make({\n name: 'scorecards',\n params: {\n loader: () =>\n import('../components/ScorecardsCard').then(m =>\n compatWrapper(<m.ScorecardsCard title=\"Scorecards\" />),\n ),\n },\n});\n"],"names":[],"mappings":";;;;AAuBa,MAAA,+BAAA,GAAkC,oBAAoB,IAAK,CAAA;AAAA,EACtE,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,MACN,OAAO,2CAA8B,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KAC1C,8BAAe,GAAA,CAAA,CAAA,CAAE,gBAAF,EAAiB,KAAA,EAAM,cAAa,CAAE;AAAA;AACvD;AAEN,CAAC;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { compatWrapper } from '@backstage/core-compat-api';
|
|
3
|
+
import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
4
|
+
|
|
5
|
+
const entityTechInsightsScorecardContent = EntityContentBlueprint.make({
|
|
6
|
+
name: "scorecards",
|
|
7
|
+
params: {
|
|
8
|
+
path: "/tech-insights",
|
|
9
|
+
title: "Scorecards",
|
|
10
|
+
loader: () => import('../components/ScorecardsContent/index.esm.js').then(
|
|
11
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ScorecardsContent, { title: "Scorecards" }))
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { entityTechInsightsScorecardContent };
|
|
17
|
+
//# sourceMappingURL=entityContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityContent.esm.js","sources":["../../src/alpha/entityContent.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\n/**\n * Entity content extension that displays Tech Insights scorecards for an entity.\n *\n * @alpha\n */\nexport const entityTechInsightsScorecardContent = EntityContentBlueprint.make({\n name: 'scorecards',\n params: {\n path: '/tech-insights',\n title: 'Scorecards',\n loader: () =>\n import('../components/ScorecardsContent').then(m =>\n compatWrapper(<m.ScorecardsContent title=\"Scorecards\" />),\n ),\n },\n});\n"],"names":[],"mappings":";;;;AAuBa,MAAA,kCAAA,GAAqC,uBAAuB,IAAK,CAAA;AAAA,EAC5E,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,gBAAA;AAAA,IACN,KAAO,EAAA,YAAA;AAAA,IACP,MAAQ,EAAA,MACN,OAAO,8CAAiC,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KAC7C,8BAAe,GAAA,CAAA,CAAA,CAAE,mBAAF,EAAoB,KAAA,EAAM,cAAa,CAAE;AAAA;AAC1D;AAEN,CAAC;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import EmojiObjectsIcon from '@material-ui/icons/EmojiObjects';
|
|
3
|
+
import { rootRouteRef } from '../routes.esm.js';
|
|
4
|
+
|
|
5
|
+
const techInsightsNavItem = NavItemBlueprint.make({
|
|
6
|
+
params: {
|
|
7
|
+
title: "Tech Insights",
|
|
8
|
+
icon: EmojiObjectsIcon,
|
|
9
|
+
routeRef: rootRouteRef
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { techInsightsNavItem };
|
|
14
|
+
//# sourceMappingURL=navItems.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navItems.esm.js","sources":["../../src/alpha/navItems.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { NavItemBlueprint } from '@backstage/frontend-plugin-api';\nimport EmojiObjectsIcon from '@material-ui/icons/EmojiObjects';\nimport { rootRouteRef } from '../routes';\n\n/**\n * @alpha\n */\nexport const techInsightsNavItem = NavItemBlueprint.make({\n params: {\n title: 'Tech Insights',\n icon: EmojiObjectsIcon,\n routeRef: rootRouteRef,\n },\n});\n\nexport default [techInsightsNavItem];\n"],"names":[],"mappings":";;;;AAsBa,MAAA,mBAAA,GAAsB,iBAAiB,IAAK,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,eAAA;AAAA,IACP,IAAM,EAAA,gBAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAC;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { compatWrapper } from '@backstage/core-compat-api';
|
|
3
|
+
import { PageBlueprint } from '@backstage/frontend-plugin-api';
|
|
4
|
+
|
|
5
|
+
const techInsightsScorecardPage = PageBlueprint.make({
|
|
6
|
+
params: {
|
|
7
|
+
path: "/tech-insights",
|
|
8
|
+
loader: () => import('../components/ScorecardsPage/index.esm.js').then(
|
|
9
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ScorecardsPage, {}))
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { techInsightsScorecardPage };
|
|
15
|
+
//# sourceMappingURL=pages.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { PageBlueprint } from '@backstage/frontend-plugin-api';\n\n/**\n * Page extension that displays the Tech Insights scorecards overview page.\n *\n * @alpha\n */\nexport const techInsightsScorecardPage = PageBlueprint.make({\n params: {\n path: '/tech-insights',\n loader: () =>\n import('../components/ScorecardsPage').then(m =>\n compatWrapper(<m.ScorecardsPage />),\n ),\n },\n});\n"],"names":[],"mappings":";;;;AAuBa,MAAA,yBAAA,GAA4B,cAAc,IAAK,CAAA;AAAA,EAC1D,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,gBAAA;AAAA,IACN,MAAQ,EAAA,MACN,OAAO,2CAA8B,CAAE,CAAA,IAAA;AAAA,MAAK,OAC1C,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,cAAA,EAAF,EAAiB,CAAE;AAAA;AACpC;AAEN,CAAC;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { techInsightsApi } from './apis.esm.js';
|
|
3
|
+
import { entityTechInsightsScorecardContent } from './entityContent.esm.js';
|
|
4
|
+
import { entityTechInsightsScorecardCard } from './entityCards.esm.js';
|
|
5
|
+
import { techInsightsScorecardPage } from './pages.esm.js';
|
|
6
|
+
import { techInsightsNavItem } from './navItems.esm.js';
|
|
7
|
+
|
|
8
|
+
const techInsightsPlugin = createFrontendPlugin({
|
|
9
|
+
pluginId: "tech-insights",
|
|
10
|
+
extensions: [
|
|
11
|
+
techInsightsApi,
|
|
12
|
+
techInsightsScorecardPage,
|
|
13
|
+
entityTechInsightsScorecardContent,
|
|
14
|
+
entityTechInsightsScorecardCard,
|
|
15
|
+
techInsightsNavItem
|
|
16
|
+
]
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { techInsightsPlugin as default };
|
|
20
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport { techInsightsApi } from './apis';\nimport { entityTechInsightsScorecardContent } from './entityContent';\nimport { entityTechInsightsScorecardCard } from './entityCards';\nimport { techInsightsScorecardPage } from './pages';\nimport { techInsightsNavItem } from './navItems';\n\n/**\n * The Tech Insights frontend plugin for the new Backstage frontend system.\n *\n * @alpha\n */\nconst techInsightsPlugin = createFrontendPlugin({\n pluginId: 'tech-insights',\n extensions: [\n techInsightsApi,\n techInsightsScorecardPage,\n entityTechInsightsScorecardContent,\n entityTechInsightsScorecardCard,\n techInsightsNavItem,\n ],\n});\n\nexport default techInsightsPlugin;\n"],"names":[],"mappings":";;;;;;;AA2BA,MAAM,qBAAqB,oBAAqB,CAAA;AAAA,EAC9C,QAAU,EAAA,eAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,eAAA;AAAA,IACA,yBAAA;AAAA,IACA,kCAAA;AAAA,IACA,+BAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
5
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Tech Insights frontend plugin for the new Backstage frontend system.
|
|
9
|
+
*
|
|
10
|
+
* @alpha
|
|
11
|
+
*/
|
|
12
|
+
declare const techInsightsPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{}, {}, {
|
|
13
|
+
"api:tech-insights": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
14
|
+
kind: "api";
|
|
15
|
+
name: undefined;
|
|
16
|
+
config: {};
|
|
17
|
+
configInput: {};
|
|
18
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
19
|
+
inputs: {};
|
|
20
|
+
params: <TApi, TImpl extends TApi, TDeps extends {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
}>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
23
|
+
}>;
|
|
24
|
+
"entity-card:tech-insights/scorecards": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
25
|
+
kind: "entity-card";
|
|
26
|
+
name: "scorecards";
|
|
27
|
+
config: {
|
|
28
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
29
|
+
type: "content" | "summary" | "info" | undefined;
|
|
30
|
+
};
|
|
31
|
+
configInput: {
|
|
32
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
33
|
+
type?: "content" | "summary" | "info" | undefined;
|
|
34
|
+
};
|
|
35
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
36
|
+
optional: true;
|
|
37
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
38
|
+
optional: true;
|
|
39
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityCardType, "catalog.entity-card-type", {
|
|
40
|
+
optional: true;
|
|
41
|
+
}>;
|
|
42
|
+
inputs: {};
|
|
43
|
+
params: {
|
|
44
|
+
loader: () => Promise<JSX.Element>;
|
|
45
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
46
|
+
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
"entity-content:tech-insights/scorecards": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
50
|
+
kind: "entity-content";
|
|
51
|
+
name: "scorecards";
|
|
52
|
+
config: {
|
|
53
|
+
path: string | undefined;
|
|
54
|
+
title: string | undefined;
|
|
55
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
56
|
+
group: string | false | undefined;
|
|
57
|
+
};
|
|
58
|
+
configInput: {
|
|
59
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
60
|
+
title?: string | undefined;
|
|
61
|
+
path?: string | undefined;
|
|
62
|
+
group?: string | false | undefined;
|
|
63
|
+
};
|
|
64
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _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", {
|
|
65
|
+
optional: true;
|
|
66
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
67
|
+
optional: true;
|
|
68
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
69
|
+
optional: true;
|
|
70
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-group", {
|
|
71
|
+
optional: true;
|
|
72
|
+
}>;
|
|
73
|
+
inputs: {};
|
|
74
|
+
params: {
|
|
75
|
+
defaultPath?: [Error: "Use the 'path' param instead"] | undefined;
|
|
76
|
+
path: string;
|
|
77
|
+
defaultTitle?: [Error: "Use the 'title' param instead"] | undefined;
|
|
78
|
+
title: string;
|
|
79
|
+
defaultGroup?: [Error: "Use the 'group' param instead"] | undefined;
|
|
80
|
+
group?: (string & {}) | "development" | "deployment" | "overview" | "documentation" | "operation" | "observability" | undefined;
|
|
81
|
+
loader: () => Promise<JSX.Element>;
|
|
82
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
83
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
"nav-item:tech-insights": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
87
|
+
kind: "nav-item";
|
|
88
|
+
name: undefined;
|
|
89
|
+
config: {};
|
|
90
|
+
configInput: {};
|
|
91
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
92
|
+
title: string;
|
|
93
|
+
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
94
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
95
|
+
}, "core.nav-item.target", {}>;
|
|
96
|
+
inputs: {};
|
|
97
|
+
params: {
|
|
98
|
+
title: string;
|
|
99
|
+
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
100
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
"page:tech-insights": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
104
|
+
kind: "page";
|
|
105
|
+
name: undefined;
|
|
106
|
+
config: {
|
|
107
|
+
path: string | undefined;
|
|
108
|
+
};
|
|
109
|
+
configInput: {
|
|
110
|
+
path?: string | undefined;
|
|
111
|
+
};
|
|
112
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _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", {
|
|
113
|
+
optional: true;
|
|
114
|
+
}>;
|
|
115
|
+
inputs: {};
|
|
116
|
+
params: {
|
|
117
|
+
defaultPath?: [Error: "Use the 'path' param instead"] | undefined;
|
|
118
|
+
path: string;
|
|
119
|
+
loader: () => Promise<JSX.Element>;
|
|
120
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
121
|
+
};
|
|
122
|
+
}>;
|
|
123
|
+
}>;
|
|
124
|
+
|
|
125
|
+
export { techInsightsPlugin as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -57,8 +57,12 @@ const withResultsOptions = [
|
|
|
57
57
|
{ label: "Yes", value: true },
|
|
58
58
|
{ label: "No", value: false }
|
|
59
59
|
];
|
|
60
|
+
const failedOnlyOptions = [
|
|
61
|
+
{ label: "Yes", value: true },
|
|
62
|
+
{ label: "No", value: false }
|
|
63
|
+
];
|
|
60
64
|
const Filters = (props) => {
|
|
61
|
-
const { checksChanged, withResultsChanged } = props;
|
|
65
|
+
const { checksChanged, withResultsChanged, hasFailedChecksChanged } = props;
|
|
62
66
|
const api = useApi(techInsightsApiRef);
|
|
63
67
|
const { value, loading, error } = useAsync(async () => {
|
|
64
68
|
return api.getAllChecks();
|
|
@@ -109,6 +113,26 @@ const Filters = (props) => {
|
|
|
109
113
|
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, variant: "outlined" })
|
|
110
114
|
}
|
|
111
115
|
)
|
|
116
|
+
] }) }),
|
|
117
|
+
/* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsxs(Typography, { variant: "button", component: "label", children: [
|
|
118
|
+
"Has failed checks",
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
Autocomplete,
|
|
121
|
+
{
|
|
122
|
+
defaultValue: failedOnlyOptions[1],
|
|
123
|
+
options: failedOnlyOptions,
|
|
124
|
+
getOptionLabel: (o) => o.label,
|
|
125
|
+
onChange: (_, selectedItem) => {
|
|
126
|
+
if (selectedItem) {
|
|
127
|
+
hasFailedChecksChanged(selectedItem.value);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
disableClearable: true,
|
|
131
|
+
size: "small",
|
|
132
|
+
popupIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
|
|
133
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, variant: "outlined" })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
112
136
|
] }) })
|
|
113
137
|
] });
|
|
114
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filters.esm.js","sources":["../../../src/components/ScorecardsPage/Filters.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { Check } from '@backstage-community/plugin-tech-insights-common';\nimport Typography from '@material-ui/core/Typography';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport TextField from '@material-ui/core/TextField';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ErrorPanel } from '@backstage/core-components';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\n\nconst useStyles = makeStyles({\n fullWidth: { width: '100%' },\n boxLabel: {\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n },\n});\n\nconst FixedWidthFormControlLabel = withStyles(_theme => ({\n label: {\n width: '100%',\n },\n root: {\n width: '90%',\n },\n}))(FormControlLabel);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\nfunction RenderOptionLabel(props: { check: Check; isSelected: boolean }) {\n const classes = useStyles();\n const { check, isSelected } = props;\n return (\n <Box className={classes.fullWidth}>\n <FixedWidthFormControlLabel\n className={classes.fullWidth}\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={isSelected}\n />\n }\n onClick={event => event.preventDefault()}\n label={\n <Tooltip title={check.id}>\n <Box display=\"flex\" alignItems=\"center\">\n <Box className={classes.boxLabel}>\n <Typography noWrap>{check.name}</Typography>\n </Box>\n </Box>\n </Tooltip>\n }\n />\n </Box>\n );\n}\n\nconst withResultsOptions = [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n];\n\n/** public **/\nexport type FiltersProps = {\n checksChanged: (checks: Check[]) => void;\n withResultsChanged: (withResults: boolean) => void;\n};\n\nexport const Filters = (props: FiltersProps) => {\n const { checksChanged, withResultsChanged } = props;\n const api = useApi(techInsightsApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return api.getAllChecks();\n }, [api]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Checks\n <Autocomplete\n multiple\n disableCloseOnSelect\n options={value ?? []}\n loading={loading}\n getOptionLabel={o => o.name}\n onChange={(_: object, changedChecks) => {\n checksChanged(changedChecks);\n }}\n filterOptions={x => x}\n renderOption={(check, { selected }) => {\n return <RenderOptionLabel check={check} isSelected={selected} />;\n }}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Only with results\n <Autocomplete\n defaultValue={withResultsOptions[0]}\n options={withResultsOptions}\n getOptionLabel={o => o.label}\n onChange={(_: object, selectedItem) => {\n if (selectedItem) {\n withResultsChanged(selectedItem.value);\n }\n }}\n disableClearable\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAA,EAAW,EAAE,KAAA,EAAO,MAAO,EAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAED,MAAM,0BAAA,GAA6B,WAAW,CAAW,MAAA,MAAA;AAAA,EACvD,KAAO,EAAA;AAAA,IACL,KAAO,EAAA;AAAA,GACT;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA;AAAA;AAEX,CAAA,CAAE,EAAE,gBAAgB,CAAA;AAEpB,MAAM,IAAO,mBAAA,GAAA,CAAC,wBAAyB,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AACxD,MAAM,WAAc,mBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAEnD,SAAS,kBAAkB,KAA8C,EAAA;AACvE,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,KAAO,EAAA,UAAA,EAAe,GAAA,KAAA;AAC9B,EAAA,uBACG,GAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,SACtB,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,0BAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAQ,CAAA,SAAA;AAAA,MACnB,OACE,kBAAA,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA;AAAA,UACA,WAAA;AAAA,UACA,OAAS,E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AA;AAAA,UACvB,QAAA,EAAU,CAAC,CAAA,EAAW,YAAiB,KAAA;AACrC,YAAA,IAAI,YAAc,EAAA;AAChB,cAAA,kBAAA,CAAmB,aAAa,KAAK,CAAA;AAAA;AACvC,WACF;AAAA,UACA,gBAAgB,EAAA,IAAA;AAAA,UAChB,IAAK,EAAA,OAAA;AAAA,UACL,SAAA,sBAAY,cAAe,EAAA,EAAA,CAAA;AAAA,UAC3B,aAAa,CAAU,MAAA,qBAAA,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA;AACnE,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Filters.esm.js","sources":["../../../src/components/ScorecardsPage/Filters.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { Check } from '@backstage-community/plugin-tech-insights-common';\nimport Typography from '@material-ui/core/Typography';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport TextField from '@material-ui/core/TextField';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ErrorPanel } from '@backstage/core-components';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\n\nconst useStyles = makeStyles({\n fullWidth: { width: '100%' },\n boxLabel: {\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n },\n});\n\nconst FixedWidthFormControlLabel = withStyles(_theme => ({\n label: {\n width: '100%',\n },\n root: {\n width: '90%',\n },\n}))(FormControlLabel);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\nfunction RenderOptionLabel(props: { check: Check; isSelected: boolean }) {\n const classes = useStyles();\n const { check, isSelected } = props;\n return (\n <Box className={classes.fullWidth}>\n <FixedWidthFormControlLabel\n className={classes.fullWidth}\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={isSelected}\n />\n }\n onClick={event => event.preventDefault()}\n label={\n <Tooltip title={check.id}>\n <Box display=\"flex\" alignItems=\"center\">\n <Box className={classes.boxLabel}>\n <Typography noWrap>{check.name}</Typography>\n </Box>\n </Box>\n </Tooltip>\n }\n />\n </Box>\n );\n}\n\nconst withResultsOptions = [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n];\n\nconst failedOnlyOptions = [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n];\n\n/** public **/\nexport type FiltersProps = {\n checksChanged: (checks: Check[]) => void;\n withResultsChanged: (withResults: boolean) => void;\n hasFailedChecksChanged: (hasFailedChecks: boolean) => void;\n};\n\nexport const Filters = (props: FiltersProps) => {\n const { checksChanged, withResultsChanged, hasFailedChecksChanged } = props;\n const api = useApi(techInsightsApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return api.getAllChecks();\n }, [api]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Checks\n <Autocomplete\n multiple\n disableCloseOnSelect\n options={value ?? []}\n loading={loading}\n getOptionLabel={o => o.name}\n onChange={(_: object, changedChecks) => {\n checksChanged(changedChecks);\n }}\n filterOptions={x => x}\n renderOption={(check, { selected }) => {\n return <RenderOptionLabel check={check} isSelected={selected} />;\n }}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Only with results\n <Autocomplete\n defaultValue={withResultsOptions[0]}\n options={withResultsOptions}\n getOptionLabel={o => o.label}\n onChange={(_: object, selectedItem) => {\n if (selectedItem) {\n withResultsChanged(selectedItem.value);\n }\n }}\n disableClearable\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Has failed checks\n <Autocomplete\n defaultValue={failedOnlyOptions[1]}\n options={failedOnlyOptions}\n getOptionLabel={o => o.label}\n onChange={(_: object, selectedItem) => {\n if (selectedItem) {\n hasFailedChecksChanged(selectedItem.value);\n }\n }}\n disableClearable\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAA,EAAW,EAAE,KAAA,EAAO,MAAO,EAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAED,MAAM,0BAAA,GAA6B,WAAW,CAAW,MAAA,MAAA;AAAA,EACvD,KAAO,EAAA;AAAA,IACL,KAAO,EAAA;AAAA,GACT;AAAA,EACA,IAAM,EAAA;AAAA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CAAA;AAAA,oBACA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,EAAA,EAAI,CACd,EAAA,QAAA,kBAAA,IAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,QAAS,EAAA,SAAA,EAAU,OAAQ,EAAA,QAAA,EAAA;AAAA,MAAA,mBAAA;AAAA,sBAE7C,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,YAAA,EAAc,kBAAkB,CAAC,CAAA;AAAA,UACjC,OAAS,EAAA,iBAAA;AAAA,UACT,cAAA,EAAgB,OAAK,CAAE,CAAA,KAAA;AAAA,UACvB,QAAA,EAAU,CAAC,CAAA,EAAW,YAAiB,KAAA;AACrC,YAAA,IAAI,YAAc,EAAA;AAChB,cAAA,sBAAA,CAAuB,aAAa,KAAK,CAAA;AAAA;AAC3C,WACF;AAAA,UACA,gBAAgB,EAAA,IAAA;AAAA,UAChB,IAAK,EAAA,OAAA;AAAA,UACL,SAAA,sBAAY,cAAe,EAAA,EAAA,CAAA;AAAA,UAC3B,aAAa,CAAU,MAAA,qBAAA,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA;AACnE,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -11,10 +11,21 @@ import { ExportCsv } from '@material-table/exporters';
|
|
|
11
11
|
import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
|
|
12
12
|
import { ScorecardsBadge } from '../ScorecardsBadge/ScorecardsBadge.esm.js';
|
|
13
13
|
|
|
14
|
+
const sortByCheckResults = (a, b) => {
|
|
15
|
+
const aFailed = a.results.filter((r) => r.result === false).length;
|
|
16
|
+
const bFailed = b.results.filter((r) => r.result === false).length;
|
|
17
|
+
const aTotal = a.results.length;
|
|
18
|
+
const bTotal = b.results.length;
|
|
19
|
+
if (aFailed !== bFailed) {
|
|
20
|
+
return bFailed - aFailed;
|
|
21
|
+
}
|
|
22
|
+
return bTotal - aTotal;
|
|
23
|
+
};
|
|
14
24
|
const ScorecardsPage = (props) => {
|
|
15
25
|
const api = useApi(techInsightsApiRef);
|
|
16
26
|
const [filterSelectedChecks, setFilterSelectedChecks] = useState([]);
|
|
17
27
|
const [filterWithResults, setFilterWithResults] = useState(true);
|
|
28
|
+
const [filterFailedChecks, setFilterFailedChecks] = useState(false);
|
|
18
29
|
const tableOptions = {
|
|
19
30
|
exportAllData: true,
|
|
20
31
|
exportMenu: [
|
|
@@ -25,18 +36,36 @@ const ScorecardsPage = (props) => {
|
|
|
25
36
|
],
|
|
26
37
|
pageSize: props.badge ? 15 : 5,
|
|
27
38
|
pageSizeOptions: props.badge ? [15, 30, 100] : [5, 10, 20],
|
|
28
|
-
padding: `${props.dense ? "dense" : "default"}
|
|
39
|
+
padding: `${props.dense ? "dense" : "default"}`,
|
|
40
|
+
thirdSortClick: false
|
|
29
41
|
};
|
|
30
42
|
const { value, loading, error } = useAsync(async () => {
|
|
31
43
|
const checks = await api.getAllChecks();
|
|
32
44
|
const result = await api.runBulkChecks([], filterSelectedChecks);
|
|
45
|
+
let filteredResult = result;
|
|
46
|
+
if (filterWithResults) {
|
|
47
|
+
filteredResult = filteredResult.filter(
|
|
48
|
+
(response) => response.results.length > 0
|
|
49
|
+
);
|
|
50
|
+
} else {
|
|
51
|
+
filteredResult = filteredResult.filter(
|
|
52
|
+
(response) => (response.results?.length ?? 0) === 0 || response.results.every((r) => r.result === false)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
if (filterFailedChecks) {
|
|
56
|
+
filteredResult = filteredResult.filter(
|
|
57
|
+
(response) => response.results.some((r) => r.result === false)
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
filteredResult = filteredResult.filter(
|
|
61
|
+
(response) => response.results.length > 0 && response.results.every((r) => r.result === true)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
33
64
|
return {
|
|
34
65
|
checks,
|
|
35
|
-
result:
|
|
36
|
-
(response) => (response.results?.length ?? 0) === 0 || response.results.every((r) => r.result === false)
|
|
37
|
-
)
|
|
66
|
+
result: filteredResult
|
|
38
67
|
};
|
|
39
|
-
}, [api, filterSelectedChecks, filterWithResults]);
|
|
68
|
+
}, [api, filterSelectedChecks, filterWithResults, filterFailedChecks]);
|
|
40
69
|
const tableColumns = useMemo(() => {
|
|
41
70
|
const columns = [
|
|
42
71
|
{
|
|
@@ -48,6 +77,8 @@ const ScorecardsPage = (props) => {
|
|
|
48
77
|
field: "results",
|
|
49
78
|
title: "Results",
|
|
50
79
|
render: (row) => props.badge ? /* @__PURE__ */ jsx(ScorecardsBadge, { checkResults: row.results }) : /* @__PURE__ */ jsx(ScorecardsList, { checkResults: row.results, dense: props.dense }),
|
|
80
|
+
defaultSort: "desc",
|
|
81
|
+
customSort: sortByCheckResults,
|
|
51
82
|
export: false
|
|
52
83
|
}
|
|
53
84
|
];
|
|
@@ -77,7 +108,8 @@ const ScorecardsPage = (props) => {
|
|
|
77
108
|
Filters,
|
|
78
109
|
{
|
|
79
110
|
checksChanged: (checks) => setFilterSelectedChecks(checks),
|
|
80
|
-
withResultsChanged: (withResults) => setFilterWithResults(withResults)
|
|
111
|
+
withResultsChanged: (withResults) => setFilterWithResults(withResults),
|
|
112
|
+
hasFailedChecksChanged: (hasFailedChecks) => setFilterFailedChecks(hasFailedChecks)
|
|
81
113
|
}
|
|
82
114
|
) }),
|
|
83
115
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScorecardsPage.esm.js","sources":["../../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { useMemo, useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n TableOptions,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n Check,\n BulkCheckResponse,\n} from '@backstage-community/plugin-tech-insights-common';\nimport useAsync from 'react-use/lib/useAsync';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { ScorecardsList } from '../ScorecardsList';\nimport Grid from '@material-ui/core/Grid';\nimport { Filters } from './Filters';\nimport { ExportCsv as exportCsv } from '@material-table/exporters';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { ScorecardsBadge } from '../ScorecardsBadge';\n\nexport const ScorecardsPage = (props: { badge?: boolean; dense?: boolean }) => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n const [filterWithResults, setFilterWithResults] = useState<boolean>(true);\n const tableOptions: TableOptions = {\n exportAllData: true,\n exportMenu: [\n {\n label: 'Export CSV',\n exportFunc: (cols, datas) => exportCsv(cols, datas, 'tech-insights'),\n },\n ],\n pageSize: props.badge ? 15 : 5,\n pageSizeOptions: props.badge ? [15, 30, 100] : [5, 10, 20],\n padding: `${props.dense ? 'dense' : 'default'}`,\n };\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n\n return {\n checks,\n result: filterWithResults\n ? result.filter(response => response.results.length > 0)\n : result.filter(\n response =>\n (response.results?.length ?? 0) === 0 ||\n response.results.every(r => r.result === false),\n ),\n };\n }, [api, filterSelectedChecks, filterWithResults]);\n\n const tableColumns = useMemo(() => {\n const columns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row =>\n props.badge ? (\n <ScorecardsBadge checkResults={row.results} />\n ) : (\n <ScorecardsList checkResults={row.results} dense={props.dense} />\n ),\n export: false,\n },\n ];\n\n (filterSelectedChecks.length === 0\n ? value?.checks || []\n : filterSelectedChecks\n ).forEach(check => {\n columns.push({\n field: check.id,\n title: check.name,\n customExport: row =>\n `${\n row.results.filter(\n result => result && result.check && result.check.id === check.id,\n )[0]?.result\n }`,\n hidden: true,\n export: true,\n });\n });\n\n return columns;\n }, [props, value, filterSelectedChecks]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n withResultsChanged={withResults =>\n setFilterWithResults(withResults)\n }\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n options={tableOptions}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["exportCsv"],"mappings":";;;;;;;;;;;;;AAyCa,MAAA,cAAA,GAAiB,CAAC,KAAgD,KAAA;AAC7E,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AACrC,EAAA,MAAM,CAAC,oBAAsB,EAAA,uBAAuB,CAAI,GAAA,QAAA,CAAkB,EAAE,CAAA;AAC5E,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,IAAI,CAAA;AACxE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,aAAe,EAAA,IAAA;AAAA,IACf,UAAY,EAAA;AAAA,MACV;AAAA,QACE,KAAO,E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AAAA,oBAAC,IAAA,CAAA,MAAA,EAAA,EAAO,OAAM,eACZ,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,eAAY,KAAM,EAAA,UAAA,EAAW,OAAO,KAAO,EAAA,MAAA,CAAO,UAAU,CAAG,EAAA,CAAA;AAAA,sBAChE,GAAA,CAAC,eAAY,KAAM,EAAA,QAAA,EAAS,OAAO,KAAO,EAAA,MAAA,CAAO,UAAU,CAAG,EAAA;AAAA,KAChE,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,IAAA,CAAA,IAAA,EAAA,EAAK,WAAS,IACb,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,OAAO,EAAE,KAAA,EAAO,SACzB,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAe,CAAU,MAAA,KAAA,uBAAA,CAAwB,MAAM,CAAA;AAAA,UACvD,kBAAA,EAAoB,CAClB,WAAA,KAAA,oBAAA,CAAqB,WAAW;AAAA;AAAA,OAGtC,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACX,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,OAAS,EAAA,YAAA;AAAA,UACT,IAAA,EAAM,KAAO,EAAA,MAAA,IAAU,EAAC;AAAA,UACxB,SAAW,EAAA,OAAA;AAAA,UACX,OAAS,EAAA;AAAA;AAAA,OAEb,EAAA;AAAA,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"ScorecardsPage.esm.js","sources":["../../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { useMemo, useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n TableOptions,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n Check,\n BulkCheckResponse,\n} from '@backstage-community/plugin-tech-insights-common';\nimport useAsync from 'react-use/lib/useAsync';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { ScorecardsList } from '../ScorecardsList';\nimport Grid from '@material-ui/core/Grid';\nimport { Filters } from './Filters';\nimport { ExportCsv as exportCsv } from '@material-table/exporters';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { ScorecardsBadge } from '../ScorecardsBadge';\n\nconst sortByCheckResults = (\n a: BulkCheckResponse[0],\n b: BulkCheckResponse[0],\n) => {\n const aFailed = a.results.filter(r => r.result === false).length;\n const bFailed = b.results.filter(r => r.result === false).length;\n const aTotal = a.results.length;\n const bTotal = b.results.length;\n\n // Sort by number of failed checks first, then by total checks\n if (aFailed !== bFailed) {\n return bFailed - aFailed; // More failures first (descending)\n }\n return bTotal - aTotal; // More total checks first\n};\n\nexport const ScorecardsPage = (props: { badge?: boolean; dense?: boolean }) => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n const [filterWithResults, setFilterWithResults] = useState<boolean>(true);\n const [filterFailedChecks, setFilterFailedChecks] = useState<boolean>(false);\n const tableOptions: TableOptions = {\n exportAllData: true,\n exportMenu: [\n {\n label: 'Export CSV',\n exportFunc: (cols, datas) => exportCsv(cols, datas, 'tech-insights'),\n },\n ],\n pageSize: props.badge ? 15 : 5,\n pageSizeOptions: props.badge ? [15, 30, 100] : [5, 10, 20],\n padding: `${props.dense ? 'dense' : 'default'}`,\n thirdSortClick: false,\n };\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n\n let filteredResult = result;\n\n if (filterWithResults) {\n filteredResult = filteredResult.filter(\n response => response.results.length > 0,\n );\n } else {\n filteredResult = filteredResult.filter(\n response =>\n (response.results?.length ?? 0) === 0 ||\n response.results.every(r => r.result === false),\n );\n }\n\n if (filterFailedChecks) {\n filteredResult = filteredResult.filter(response =>\n response.results.some(r => r.result === false),\n );\n } else {\n filteredResult = filteredResult.filter(\n response =>\n response.results.length > 0 &&\n response.results.every(r => r.result === true),\n );\n }\n\n return {\n checks,\n result: filteredResult,\n };\n }, [api, filterSelectedChecks, filterWithResults, filterFailedChecks]);\n\n const tableColumns = useMemo(() => {\n const columns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row =>\n props.badge ? (\n <ScorecardsBadge checkResults={row.results} />\n ) : (\n <ScorecardsList checkResults={row.results} dense={props.dense} />\n ),\n defaultSort: 'desc',\n customSort: sortByCheckResults,\n export: false,\n },\n ];\n\n (filterSelectedChecks.length === 0\n ? value?.checks || []\n : filterSelectedChecks\n ).forEach(check => {\n columns.push({\n field: check.id,\n title: check.name,\n customExport: row =>\n `${\n row.results.filter(\n result => result && result.check && result.check.id === check.id,\n )[0]?.result\n }`,\n hidden: true,\n export: true,\n });\n });\n\n return columns;\n }, [props, value, filterSelectedChecks]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n withResultsChanged={withResults =>\n setFilterWithResults(withResults)\n }\n hasFailedChecksChanged={hasFailedChecks =>\n setFilterFailedChecks(hasFailedChecks)\n }\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n options={tableOptions}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["exportCsv"],"mappings":";;;;;;;;;;;;;AAyCA,MAAM,kBAAA,GAAqB,CACzB,CAAA,EACA,CACG,KAAA;AACH,EAAM,MAAA,OAAA,GAAU,EAAE,OAAQ,CAAA,MAAA,CAAO,OAAK,CAAE,CAAA,MAAA,KAAW,KAAK,CAAE,CAAA,MAAA;AAC1D,EAAM,MAAA,OAAA,GAAU,EAAE,OAAQ,CAAA,MAAA,CAAO,OAAK,CAAE,CAAA,MAAA,KAAW,KAAK,CAAE,CAAA,MAAA;AAC1D,EAAM,MAAA,MAAA,GAAS,EAAE,OAAQ,CAAA,MAAA;AACzB,EAAM,MAAA,MAAA,GAAS,EAAE,OAAQ,CAAA,MAAA;AAGzB,EAAA,IAAI,YAAY,OAAS,EAAA;AACvB,IAAA,OAAO,OAAU,GAAA,OAAA;AAAA;AAEnB,EAAA,OAAO,MAAS,GAAA,MAAA;AAClB,CAAA;AAEa,MAAA,cAAA,GAAiB,CAAC,KAAgD,KAAA;AAC7E,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AACrC,EAAA,MAAM,CAAC,oBAAsB,EAAA,uBAAuB,CAAI,GAAA,QAAA,CAAkB,EAAE,CAAA;AAC5E,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,IAAI,CAAA;AACxE,EAAA,MAAM,CAAC,kBAAA,EAAoB,qBAAqB,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC3E,EAA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AAA,IAAA,EAAC,OAAO,EAAE,KAAA,EAAO,SACzB,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAe,CAAU,MAAA,KAAA,uBAAA,CAAwB,MAAM,CAAA;AAAA,UACvD,kBAAA,EAAoB,CAClB,WAAA,KAAA,oBAAA,CAAqB,WAAW,CAAA;AAAA,UAElC,sBAAA,EAAwB,CACtB,eAAA,KAAA,qBAAA,CAAsB,eAAe;AAAA;AAAA,OAG3C,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACX,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,OAAS,EAAA,YAAA;AAAA,UACT,IAAA,EAAM,KAAO,EAAA,MAAA,IAAU,EAAC;AAAA,UACxB,SAAW,EAAA,OAAA;AAAA,UACX,OAAS,EAAA;AAAA;AAAA,OAEb,EAAA;AAAA,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as _backstage_community_plugin_tech_insights_react from '@backstage-community/plugin-tech-insights-react';
|
|
3
|
-
export { BooleanCheck, CheckResultRenderer, ResultCheckIconBaseComponentProps, ResultCheckIconProps, ResultLinksMenuInfo, TechInsightsApi, TechInsightsClient, jsonRulesEngineCheckResultRenderer, techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
|
|
4
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
3
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
6
4
|
import * as react from 'react';
|
|
7
5
|
import * as _backstage_community_plugin_tech_insights_common from '@backstage-community/plugin-tech-insights-common';
|
|
8
|
-
export { Check, InsightFacts } from '@backstage-community/plugin-tech-insights-common';
|
|
9
6
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
10
7
|
|
|
11
8
|
/**
|
|
@@ -69,19 +66,5 @@ declare const TechInsightsScorecardPage: (props: {
|
|
|
69
66
|
badge?: boolean | undefined;
|
|
70
67
|
dense?: boolean | undefined;
|
|
71
68
|
}) => react_jsx_runtime.JSX.Element;
|
|
72
|
-
/**
|
|
73
|
-
* @public
|
|
74
|
-
* @deprecated Use `ResultCheckIcon` from `@backstage-community/plugin-tech-insights-react` instead
|
|
75
|
-
*/
|
|
76
|
-
declare const TechInsightsCheckIcon: <P extends _backstage_community_plugin_tech_insights_react.ResultCheckIconBaseComponentProps>(props: _backstage_community_plugin_tech_insights_react.ResultCheckIconProps<P>) => react_jsx_runtime.JSX.Element;
|
|
77
|
-
/**
|
|
78
|
-
* @public
|
|
79
|
-
* @deprecated Use `ResultLinksMenu` from `@backstage-community/plugin-tech-insights-react` instead
|
|
80
|
-
*/
|
|
81
|
-
declare const TechInsightsLinksMenu: (props: react.PropsWithChildren<{
|
|
82
|
-
result: _backstage_community_plugin_tech_insights_common.CheckResult;
|
|
83
|
-
entity?: _backstage_catalog_model.Entity | undefined;
|
|
84
|
-
setMenu(opener: _backstage_community_plugin_tech_insights_react.ResultLinksMenuInfo | undefined): void;
|
|
85
|
-
}>) => react_jsx_runtime.JSX.Element | null;
|
|
86
69
|
|
|
87
|
-
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList,
|
|
70
|
+
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsScorecardPage, techInsightsPlugin };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList,
|
|
2
|
-
export { BooleanCheck, TechInsightsClient, jsonRulesEngineCheckResultRenderer, techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
|
|
1
|
+
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsScorecardPage, techInsightsPlugin } from './plugin.esm.js';
|
|
3
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/plugin.esm.js
CHANGED
|
@@ -68,26 +68,6 @@ const TechInsightsScorecardPage = techInsightsPlugin.provide(
|
|
|
68
68
|
mountPoint: rootRouteRef
|
|
69
69
|
})
|
|
70
70
|
);
|
|
71
|
-
const TechInsightsCheckIcon = techInsightsPlugin.provide(
|
|
72
|
-
createComponentExtension({
|
|
73
|
-
name: "TechInsightsCheckIcon",
|
|
74
|
-
component: {
|
|
75
|
-
lazy: () => import('@backstage-community/plugin-tech-insights-react').then(
|
|
76
|
-
(m) => m.ResultCheckIcon
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
const TechInsightsLinksMenu = techInsightsPlugin.provide(
|
|
82
|
-
createComponentExtension({
|
|
83
|
-
name: "TechInsightsLinksMenu",
|
|
84
|
-
component: {
|
|
85
|
-
lazy: () => import('@backstage-community/plugin-tech-insights-react').then(
|
|
86
|
-
(m) => m.ResultLinksMenu
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
);
|
|
91
71
|
|
|
92
|
-
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList,
|
|
72
|
+
export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsScorecardPage, techInsightsPlugin };
|
|
93
73
|
//# sourceMappingURL=plugin.esm.js.map
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {\n createPlugin,\n createComponentExtension,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n techInsightsApiRef,\n TechInsightsClient,\n} from '@backstage-community/plugin-tech-insights-react';\nimport { rootRouteRef } from './routes';\n\n/**\n * @public\n */\nexport const techInsightsPlugin = createPlugin({\n id: 'tech-insights',\n apis: [\n createApiFactory({\n api: techInsightsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new TechInsightsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * @public\n */\nexport const ScorecardInfo = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardInfo',\n component: {\n lazy: () =>\n import('./components/ScorecardsInfo').then(m => m.ScorecardInfo),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardsList = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardsList',\n component: {\n lazy: () =>\n import('./components/ScorecardsList').then(m => m.ScorecardsList),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardBadge = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardBadge',\n component: {\n lazy: () =>\n import('./components/ScorecardsBadge').then(m => m.ScorecardsBadge),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardGauge = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardGauge',\n component: {\n lazy: () =>\n import('./components/ScorecardsGauge').then(m => m.ScorecardsGauge),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardContent',\n component: () =>\n import('./components/ScorecardsContent').then(m => m.ScorecardsContent),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardCard',\n component: () =>\n import('./components/ScorecardsCard').then(m => m.ScorecardsCard),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsScorecardPage = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsScorecardPage',\n component: () =>\n import('./components/ScorecardsPage').then(m => m.ScorecardsPage),\n mountPoint: rootRouteRef,\n }),\n);\n
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {\n createPlugin,\n createComponentExtension,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n techInsightsApiRef,\n TechInsightsClient,\n} from '@backstage-community/plugin-tech-insights-react';\nimport { rootRouteRef } from './routes';\n\n/**\n * @public\n */\nexport const techInsightsPlugin = createPlugin({\n id: 'tech-insights',\n apis: [\n createApiFactory({\n api: techInsightsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new TechInsightsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * @public\n */\nexport const ScorecardInfo = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardInfo',\n component: {\n lazy: () =>\n import('./components/ScorecardsInfo').then(m => m.ScorecardInfo),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardsList = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardsList',\n component: {\n lazy: () =>\n import('./components/ScorecardsList').then(m => m.ScorecardsList),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardBadge = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardBadge',\n component: {\n lazy: () =>\n import('./components/ScorecardsBadge').then(m => m.ScorecardsBadge),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardGauge = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardGauge',\n component: {\n lazy: () =>\n import('./components/ScorecardsGauge').then(m => m.ScorecardsGauge),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardContent',\n component: () =>\n import('./components/ScorecardsContent').then(m => m.ScorecardsContent),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardCard',\n component: () =>\n import('./components/ScorecardsCard').then(m => m.ScorecardsCard),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsScorecardPage = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsScorecardPage',\n component: () =>\n import('./components/ScorecardsPage').then(m => m.Sc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A,IACvB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,2CAA8B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,eAAe;AAAA;AACtE,GACD;AACH;AAKO,MAAM,qCAAqC,kBAAmB,CAAA,OAAA;AAAA,EACnE,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,oCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6CAAgC,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,iBAAiB,CAAA;AAAA,IACxE,UAAY,EAAA;AAAA,GACb;AACH;AAKO,MAAM,kCAAkC,kBAAmB,CAAA,OAAA;AAAA,EAChE,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,iCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA;AAAA,GACb;AACH;AAKO,MAAM,4BAA4B,kBAAmB,CAAA,OAAA;AAAA,EAC1D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA;AAAA,GACb;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-tech-insights",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "tech-insights",
|
|
@@ -12,12 +12,37 @@
|
|
|
12
12
|
"@backstage-community/plugin-tech-insights-maturity-common",
|
|
13
13
|
"@backstage-community/plugin-tech-insights-node",
|
|
14
14
|
"@backstage-community/plugin-tech-insights-react"
|
|
15
|
-
]
|
|
15
|
+
],
|
|
16
|
+
"features": {
|
|
17
|
+
"./alpha": "@backstage/FrontendPlugin"
|
|
18
|
+
}
|
|
16
19
|
},
|
|
17
20
|
"publishConfig": {
|
|
18
|
-
"access": "public"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"import": "./dist/index.esm.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.esm.js"
|
|
28
|
+
},
|
|
29
|
+
"./alpha": {
|
|
30
|
+
"backstage": "@backstage/FrontendPlugin",
|
|
31
|
+
"import": "./dist/alpha.esm.js",
|
|
32
|
+
"types": "./dist/alpha.d.ts",
|
|
33
|
+
"default": "./dist/alpha.esm.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"typesVersions": {
|
|
38
|
+
"*": {
|
|
39
|
+
"alpha": [
|
|
40
|
+
"dist/alpha.d.ts"
|
|
41
|
+
],
|
|
42
|
+
"package.json": [
|
|
43
|
+
"package.json"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
21
46
|
},
|
|
22
47
|
"homepage": "https://backstage.io",
|
|
23
48
|
"repository": {
|
|
@@ -27,8 +52,8 @@
|
|
|
27
52
|
},
|
|
28
53
|
"license": "Apache-2.0",
|
|
29
54
|
"sideEffects": false,
|
|
30
|
-
"main": "dist/index.esm.js",
|
|
31
|
-
"types": "dist/index.d.ts",
|
|
55
|
+
"main": "./dist/index.esm.js",
|
|
56
|
+
"types": "./dist/index.d.ts",
|
|
32
57
|
"files": [
|
|
33
58
|
"dist"
|
|
34
59
|
],
|
|
@@ -45,9 +70,11 @@
|
|
|
45
70
|
"@backstage-community/plugin-tech-insights-common": "^0.8.0",
|
|
46
71
|
"@backstage-community/plugin-tech-insights-react": "^1.3.0",
|
|
47
72
|
"@backstage/catalog-model": "^1.7.6",
|
|
73
|
+
"@backstage/core-compat-api": "^0.5.5",
|
|
48
74
|
"@backstage/core-components": "^0.18.4",
|
|
49
75
|
"@backstage/core-plugin-api": "^1.12.1",
|
|
50
76
|
"@backstage/errors": "^1.2.7",
|
|
77
|
+
"@backstage/frontend-plugin-api": "^0.13.2",
|
|
51
78
|
"@backstage/plugin-catalog-react": "^1.21.4",
|
|
52
79
|
"@backstage/types": "^1.2.2",
|
|
53
80
|
"@material-table/exporters": "^1.2.19",
|
|
@@ -73,12 +100,5 @@
|
|
|
73
100
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
74
101
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
75
102
|
},
|
|
76
|
-
"typesVersions": {
|
|
77
|
-
"*": {
|
|
78
|
-
"package.json": [
|
|
79
|
-
"package.json"
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
103
|
"module": "./dist/index.esm.js"
|
|
84
104
|
}
|