@backstage-community/plugin-tech-insights 1.1.0 → 1.2.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,8 +1,7 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import Chip from '@material-ui/core/Chip';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useApi } from '@backstage/core-plugin-api';
|
|
3
|
+
import { TooltipTrigger, TagGroup, Tag, Tooltip } from '@backstage/ui';
|
|
4
4
|
import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
|
|
5
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
6
5
|
import { ScorecardsList } from '../ScorecardsList/ScorecardsList.esm.js';
|
|
7
6
|
|
|
8
7
|
const ScorecardsBadge = (props) => {
|
|
@@ -19,30 +18,33 @@ const ScorecardsBadge = (props) => {
|
|
|
19
18
|
const succeeded = checkResultsWithRenderer.filter(
|
|
20
19
|
({ result, renderer }) => !renderer?.isFailed?.(result)
|
|
21
20
|
).length;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
const isAllPassing = succeeded === checkResults.length;
|
|
22
|
+
return /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsxs(TagGroup, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Tag,
|
|
25
|
+
{
|
|
26
|
+
size: "medium",
|
|
27
|
+
style: {
|
|
28
|
+
borderRadius: 16,
|
|
29
|
+
paddingTop: 8,
|
|
30
|
+
paddingBottom: 8,
|
|
31
|
+
paddingLeft: 16,
|
|
32
|
+
paddingRight: 16,
|
|
33
|
+
backgroundColor: isAllPassing ? "mediumseagreen" : "orangered"
|
|
34
|
+
},
|
|
35
|
+
children: `${succeeded}/${checkResults.length}`
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsx(Tooltip, { children: /* @__PURE__ */ jsx(
|
|
39
|
+
ScorecardsList,
|
|
40
|
+
{
|
|
41
|
+
checkResults,
|
|
42
|
+
entity,
|
|
43
|
+
dense: true,
|
|
44
|
+
hideDescription: true
|
|
45
|
+
}
|
|
46
|
+
) })
|
|
47
|
+
] }) });
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
export { ScorecardsBadge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScorecardsBadge.esm.js","sources":["../../../src/components/ScorecardsBadge/ScorecardsBadge.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"ScorecardsBadge.esm.js","sources":["../../../src/components/ScorecardsBadge/ScorecardsBadge.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Tooltip, Tag, TagGroup, TooltipTrigger } from '@backstage/ui';\n\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\n\nimport { ScorecardsList } from '../ScorecardsList';\n\nexport const ScorecardsBadge = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n}) => {\n const { checkResults, entity } = props;\n\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n const checkResultsWithRenderer = checkResults.map(result => ({\n result,\n renderer: checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n ),\n }));\n\n const succeeded = checkResultsWithRenderer.filter(\n ({ result, renderer }) => !renderer?.isFailed?.(result),\n ).length;\n\n const isAllPassing = succeeded === checkResults.length;\n\n return (\n <TooltipTrigger>\n <TagGroup>\n <Tag\n size=\"medium\"\n style={{\n borderRadius: 16,\n paddingTop: 8,\n paddingBottom: 8,\n paddingLeft: 16,\n paddingRight: 16,\n backgroundColor: isAllPassing ? 'mediumseagreen' : 'orangered',\n }}\n >\n {`${succeeded}/${checkResults.length}`}\n </Tag>\n\n <Tooltip>\n <ScorecardsList\n checkResults={checkResults}\n entity={entity}\n dense\n hideDescription\n />\n </Tooltip>\n </TagGroup>\n </TooltipTrigger>\n );\n};\n"],"names":[],"mappings":";;;;;;AAyBa,MAAA,eAAA,GAAkB,CAAC,KAG1B,KAAA;AACJ,EAAM,MAAA,EAAE,YAAc,EAAA,MAAA,EAAW,GAAA,KAAA;AAEjC,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AAErC,EAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,YAAa,CAAA,GAAA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IAAA;AAAA,QACL,eAAe,EAAA;AAAA;AAAA,KAEnB,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-tech-insights",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "tech-insights",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@backstage/frontend-plugin-api": "^0.13.4",
|
|
78
78
|
"@backstage/plugin-catalog-react": "^1.21.6",
|
|
79
79
|
"@backstage/types": "^1.2.2",
|
|
80
|
+
"@backstage/ui": "^0.11.2",
|
|
80
81
|
"@material-table/exporters": "^1.2.19",
|
|
81
82
|
"@material-ui/core": "^4.12.2",
|
|
82
83
|
"@material-ui/icons": "^4.9.1",
|