@backstage-community/plugin-tech-insights 0.8.0 → 1.0.1
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 +20 -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 +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @backstage-community/plugin-tech-insights
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3ca2b56: Upgrades to Backstage v1.47.2
|
|
8
|
+
- Updated dependencies [3ca2b56]
|
|
9
|
+
- @backstage-community/plugin-tech-insights-common@0.8.1
|
|
10
|
+
- @backstage-community/plugin-tech-insights-react@1.3.1
|
|
11
|
+
|
|
12
|
+
## 1.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- 12c1773: All existing deprecation notices have been removed from the plugin
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- ecd421a: Added filter component to the ScorecardsPage to filter on entities with at least one failed check.
|
|
21
|
+
Also added desc/asc order based on check results in the 'Results' column. Sort by number of failed checks first, then by total checks.
|
|
22
|
+
|
|
3
23
|
## 0.8.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -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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A,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,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,SA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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,EAAA,YAAA;AAAA,QACP,YAAY,CAAC,IAAA,EAAM,UAAUA,SAAU,CAAA,IAAA,EAAM,OAAO,eAAe;AAAA;AACrE,KACF;AAAA,IACA,QAAA,EAAU,KAAM,CAAA,KAAA,GAAQ,EAAK,GAAA,CAAA;AAAA,IAC7B,eAAA,EAAiB,KAAM,CAAA,KAAA,GAAQ,CAAC,EAAA,EAAI,EAAI,EAAA,GAAG,CAAI,GAAA,CAAC,CAAG,EAAA,EAAA,EAAI,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A,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>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Ae;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.ScorecardsPage),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;AAgCO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,kBAAA;AAAA,MACL,IAAM,EAAA,EAAE,YAAc,EAAA,eAAA,EAAiB,aAAa,cAAe,EAAA;AAAA,MACnE,OAAA,EAAS,CA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C,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.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "tech-insights",
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"test": "backstage-cli package test"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@backstage-community/plugin-tech-insights-common": "^0.8.
|
|
71
|
-
"@backstage-community/plugin-tech-insights-react": "^1.3.
|
|
70
|
+
"@backstage-community/plugin-tech-insights-common": "^0.8.1",
|
|
71
|
+
"@backstage-community/plugin-tech-insights-react": "^1.3.1",
|
|
72
72
|
"@backstage/catalog-model": "^1.7.6",
|
|
73
|
-
"@backstage/core-compat-api": "^0.5.
|
|
74
|
-
"@backstage/core-components": "^0.18.
|
|
75
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
73
|
+
"@backstage/core-compat-api": "^0.5.7",
|
|
74
|
+
"@backstage/core-components": "^0.18.6",
|
|
75
|
+
"@backstage/core-plugin-api": "^1.12.2",
|
|
76
76
|
"@backstage/errors": "^1.2.7",
|
|
77
|
-
"@backstage/frontend-plugin-api": "^0.13.
|
|
78
|
-
"@backstage/plugin-catalog-react": "^1.21.
|
|
77
|
+
"@backstage/frontend-plugin-api": "^0.13.4",
|
|
78
|
+
"@backstage/plugin-catalog-react": "^1.21.6",
|
|
79
79
|
"@backstage/types": "^1.2.2",
|
|
80
80
|
"@material-table/exporters": "^1.2.19",
|
|
81
81
|
"@material-ui/core": "^4.12.2",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"react-use": "^17.2.4"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@backstage/cli": "^0.35.
|
|
89
|
-
"@backstage/dev-utils": "^1.1.
|
|
88
|
+
"@backstage/cli": "^0.35.3",
|
|
89
|
+
"@backstage/dev-utils": "^1.1.19",
|
|
90
90
|
"@testing-library/dom": "^10.0.0",
|
|
91
91
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
92
|
"@testing-library/react": "^15.0.0",
|