@backstage-community/plugin-tech-insights 0.5.2 → 0.6.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +31 -0
  3. package/dist/components/ScorecardsBadge/ScorecardsBadge.esm.js +49 -0
  4. package/dist/components/ScorecardsBadge/ScorecardsBadge.esm.js.map +1 -0
  5. package/dist/components/ScorecardsBadge/index.esm.js +2 -0
  6. package/dist/components/ScorecardsBadge/index.esm.js.map +1 -0
  7. package/dist/components/ScorecardsCard/ScorecardsCard.esm.js +18 -5
  8. package/dist/components/ScorecardsCard/ScorecardsCard.esm.js.map +1 -1
  9. package/dist/components/ScorecardsContent/ScorecardContent.esm.js +8 -7
  10. package/dist/components/ScorecardsContent/ScorecardContent.esm.js.map +1 -1
  11. package/dist/components/ScorecardsGauge/ScorecardsGauge.esm.js +40 -0
  12. package/dist/components/ScorecardsGauge/ScorecardsGauge.esm.js.map +1 -0
  13. package/dist/components/ScorecardsGauge/index.esm.js +2 -0
  14. package/dist/components/ScorecardsGauge/index.esm.js.map +1 -0
  15. package/dist/components/ScorecardsInfo/ScorecardInfo.esm.js +55 -23
  16. package/dist/components/ScorecardsInfo/ScorecardInfo.esm.js.map +1 -1
  17. package/dist/components/ScorecardsList/ScorecardsList.esm.js +34 -24
  18. package/dist/components/ScorecardsList/ScorecardsList.esm.js.map +1 -1
  19. package/dist/components/ScorecardsPage/Filters.esm.js +52 -43
  20. package/dist/components/ScorecardsPage/Filters.esm.js.map +1 -1
  21. package/dist/components/ScorecardsPage/ScorecardsPage.esm.js +36 -22
  22. package/dist/components/ScorecardsPage/ScorecardsPage.esm.js.map +1 -1
  23. package/dist/index.d.ts +23 -11
  24. package/dist/plugin.esm.js +16 -0
  25. package/dist/plugin.esm.js.map +1 -1
  26. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @backstage-community/plugin-tech-insights
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d97a34e: Added support for alternate visualizations of boolean checks:
8
+
9
+ - Content lists can be rendered with smaller text size and reduced padding (option `dense`)
10
+ - Checks in the overview page can be rendered as a badge (option `badge`)
11
+ - Checks in the entity card can be rendered as a gauge (option `gauge`)
12
+
13
+ ## 0.6.0
14
+
15
+ ### Minor Changes
16
+
17
+ - a01ae4e: Backstage version bump to v1.39.0
18
+
19
+ ### Patch Changes
20
+
21
+ - 01640b2: Makes minor change to API report.
22
+ - Updated dependencies [d6411fe]
23
+ - Updated dependencies [a01ae4e]
24
+ - @backstage-community/plugin-tech-insights-common@0.7.0
25
+ - @backstage-community/plugin-tech-insights-react@1.2.0
26
+
3
27
  ## 0.5.2
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -60,6 +60,8 @@ You can also pass a `filter` function to both `EntityTechInsightsScorecardConten
60
60
 
61
61
  To only show failed checks, you can pass the boolean `onlyFailed` to these components.
62
62
 
63
+ If you prefer a condensed list (with smaller text size and less padding) in `EntityTechInsightsScorecardContent`, you can pass the boolean `dense`.
64
+
63
65
  If you want to show checks in the overview of an entity use `EntityTechInsightsScorecardCard`.
64
66
 
65
67
  ```tsx
@@ -88,6 +90,29 @@ const overviewContent = (
88
90
  );
89
91
  ```
90
92
 
93
+ If you want to display checks as a gauge visualization, pass the boolean `gauge` to `EntityTechInsightsScorecardCard`.
94
+
95
+ ```tsx
96
+ // packages/app/src/components/catalog/EntityPage.tsx
97
+
98
+ import { EntityTechInsightsScorecardCard } from '@backstage-community/plugin-tech-insights';
99
+
100
+ const overviewContent = (
101
+ <Grid container spacing={3} alignItems="stretch">
102
+ ...
103
+ <Grid item md={4}>
104
+ <EntityTechInsightsScorecardCard
105
+ title="Customized title for the scorecard"
106
+ description="Small description about scorecards"
107
+ gauge
108
+ />
109
+ </Grid>
110
+ </Grid>
111
+ );
112
+ ```
113
+
114
+ ![Gauge Scorecard Example](docs/gauge-scorecard-overview.png)
115
+
91
116
  ## Boolean Scorecard Example
92
117
 
93
118
  If you follow the [Backend Example](../tech-insights-backend#backend-example), once the needed facts have been generated the default boolean scorecard will look like this:
@@ -113,6 +138,12 @@ const routes = (
113
138
  );
114
139
  ```
115
140
 
141
+ To show a condensed list (with smaller text size and less padding), you can pass the boolean `dense`.
142
+
143
+ If you want to display checks as a badge visualization, pass the boolean `badge` to `TechInsightsScorecardPage`.
144
+
145
+ ![Badge Scorecard Overview](./docs/badge-scorecard-overview.png)
146
+
116
147
  Then add it to the navigation menu
117
148
 
118
149
  ```tsx
@@ -0,0 +1,49 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import Chip from '@material-ui/core/Chip';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
5
+ import Tooltip from '@material-ui/core/Tooltip';
6
+ import { ScorecardsList } from '../ScorecardsList/ScorecardsList.esm.js';
7
+
8
+ const ScorecardsBadge = (props) => {
9
+ const { checkResults, entity } = props;
10
+ const api = useApi(techInsightsApiRef);
11
+ const types = [...new Set(checkResults.map(({ check }) => check.type))];
12
+ const checkResultRenderers = api.getCheckResultRenderers(types);
13
+ const checkResultsWithRenderer = checkResults.map((result) => ({
14
+ result,
15
+ renderer: checkResultRenderers.find(
16
+ (renderer) => renderer.type === result.check.type
17
+ )
18
+ }));
19
+ const succeeded = checkResultsWithRenderer.filter(
20
+ ({ result, renderer }) => !renderer?.isFailed?.(result)
21
+ ).length;
22
+ return /* @__PURE__ */ jsx(
23
+ Tooltip,
24
+ {
25
+ title: /* @__PURE__ */ jsx(
26
+ ScorecardsList,
27
+ {
28
+ checkResults,
29
+ entity,
30
+ dense: true,
31
+ hideDescription: true
32
+ }
33
+ ),
34
+ children: /* @__PURE__ */ jsx(
35
+ Chip,
36
+ {
37
+ label: `${succeeded}/${checkResults.length}`,
38
+ size: "small",
39
+ style: {
40
+ backgroundColor: succeeded === checkResults.length ? "mediumseagreen" : "orangered"
41
+ }
42
+ }
43
+ )
44
+ }
45
+ );
46
+ };
47
+
48
+ export { ScorecardsBadge };
49
+ //# sourceMappingURL=ScorecardsBadge.esm.js.map
@@ -0,0 +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 { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { Entity } from '@backstage/catalog-model';\nimport Chip from '@material-ui/core/Chip';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport Tooltip from '@material-ui/core/Tooltip';\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 return (\n <Tooltip\n title={\n <ScorecardsList\n checkResults={checkResults}\n entity={entity}\n dense\n hideDescription\n />\n }\n >\n <Chip\n label={`${succeeded}/${checkResults.length}`}\n size=\"small\"\n style={{\n backgroundColor:\n succeeded === checkResults.length ?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A,UACL,KAAO,EAAA;AAAA,YACL,eACE,EAAA,SAAA,KAAc,YAAa,CAAA,MAAA,GAAS,gBAAmB,GAAA;AAAA;AAC3D;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardsBadge } from './ScorecardsBadge.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- import React, { useMemo } from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
2
3
  import useAsync from 'react-use/esm/useAsync';
3
4
  import { Progress, ErrorPanel } from '@backstage/core-components';
4
5
  import { useApi } from '@backstage/core-plugin-api';
@@ -6,6 +7,7 @@ import { ScorecardInfo } from '../ScorecardsInfo/ScorecardInfo.esm.js';
6
7
  import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
7
8
  import { useEntity } from '@backstage/plugin-catalog-react';
8
9
  import { getCompoundEntityRef } from '@backstage/catalog-model';
10
+ import { ScorecardsGauge } from '../ScorecardsGauge/ScorecardsGauge.esm.js';
9
11
 
10
12
  const ScorecardsCard = (props) => {
11
13
  const {
@@ -14,7 +16,8 @@ const ScorecardsCard = (props) => {
14
16
  checksId,
15
17
  filter,
16
18
  onlyFailed,
17
- expanded = true
19
+ gauge,
20
+ expanded = !gauge
18
21
  } = props;
19
22
  const api = useApi(techInsightsApiRef);
20
23
  const { entity } = useEntity();
@@ -32,14 +35,24 @@ const ScorecardsCard = (props) => {
32
35
  );
33
36
  }, [api, filteredValues, onlyFailed]);
34
37
  if (loading) {
35
- return /* @__PURE__ */ React.createElement(Progress, null);
38
+ return /* @__PURE__ */ jsx(Progress, {});
36
39
  } else if (error) {
37
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
40
+ return /* @__PURE__ */ jsx(ErrorPanel, { error });
38
41
  }
39
42
  const filteredValue = !onlyFailed ? filteredValues || [] : (filteredValues || []).filter(
40
43
  (val) => checkResultRenderers[val.check.type]?.isFailed?.(val)
41
44
  );
42
- return /* @__PURE__ */ React.createElement(
45
+ return gauge ? /* @__PURE__ */ jsx(
46
+ ScorecardsGauge,
47
+ {
48
+ title,
49
+ description,
50
+ entity,
51
+ checkResults: filteredValue,
52
+ noWarning: onlyFailed,
53
+ expanded
54
+ }
55
+ ) : /* @__PURE__ */ jsx(
43
56
  ScorecardInfo,
44
57
  {
45
58
  title,
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardsCard.esm.js","sources":["../../../src/components/ScorecardsCard/ScorecardsCard.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 React, { useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ErrorPanel, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\nimport { Check } from '@backstage-community/plugin-tech-insights-common';\n\nexport const ScorecardsCard = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n filter?: (check: Check) => boolean;\n onlyFailed?: boolean;\n expanded?: boolean;\n}) => {\n const {\n title,\n description,\n checksId,\n filter,\n onlyFailed,\n expanded = true,\n } = props;\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { value, loading, error } = useAsync(\n async () => await api.runChecks(getCompoundEntityRef(entity), checksId),\n [api, entity, JSON.stringify(checksId)],\n );\n\n const filteredValues =\n !filter || !value ? value : value.filter(val => filter(val.check));\n\n const checkResultRenderers = useMemo(() => {\n if (!onlyFailed || !filteredValues) return {};\n\n const types = [...new Set(filteredValues.map(({ check }) => check.type))];\n const renderers = api.getCheckResultRenderers(types);\n return Object.fromEntries(\n renderers.map(renderer => [renderer.type, renderer]),\n );\n }, [api, filteredValues, onlyFailed]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const filteredValue = !onlyFailed\n ? filteredValues || []\n : (filteredValues || []).filter(val =>\n checkResultRenderers[val.check.type]?.isFailed?.(val),\n );\n\n return (\n <ScorecardInfo\n title={title}\n description={description}\n entity={entity}\n checkResults={filteredValue}\n noWarning={onlyFailed}\n expanded={expanded}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA0Ba,MAAA,cAAA,GAAiB,CAAC,KAOzB,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAW,GAAA;AAAA,GACT,GAAA,KAAA;AACJ,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAA,CAAI,UAAU,oBAAqB,CAAA,MAAM,GAAG,QAAQ,CAAA;AAAA,IACtE,CAAC,GAAK,EAAA,MAAA,EAAQ,IAAK,CAAA,SAAA,CAAU,QAAQ,CAAC;AAAA,GACxC;AAEA,EAAA,MAAM,cACJ,GAAA,CAAC,MAAU,IAAA,CAAC,KAAQ,GAAA,KAAA,GAAQ,KAAM,CAAA,MAAA,CAAO,CAAO,GAAA,KAAA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sCard.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 } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ErrorPanel, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\nimport { Check } from '@backstage-community/plugin-tech-insights-common';\nimport { ScorecardsGauge } from '../ScorecardsGauge';\n\nexport const ScorecardsCard = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n filter?: (check: Check) => boolean;\n onlyFailed?: boolean;\n expanded?: boolean;\n gauge?: boolean;\n}) => {\n const {\n title,\n description,\n checksId,\n filter,\n onlyFailed,\n gauge,\n expanded = !gauge,\n } = props;\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { value, loading, error } = useAsync(\n async () => await api.runChecks(getCompoundEntityRef(entity), checksId),\n [api, entity, JSON.stringify(checksId)],\n );\n\n const filteredValues =\n !filter || !value ? value : value.filter(val => filter(val.check));\n\n const checkResultRenderers = useMemo(() => {\n if (!onlyFailed || !filteredValues) return {};\n\n const types = [...new Set(filteredValues.map(({ check }) => check.type))];\n const renderers = api.getCheckResultRenderers(types);\n return Object.fromEntries(\n renderers.map(renderer => [renderer.type, renderer]),\n );\n }, [api, filteredValues, onlyFailed]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const filteredValue = !onlyFailed\n ? filteredValues || []\n : (filteredValues || []).filter(val =>\n checkResultRenderers[val.check.type]?.isFailed?.(val),\n );\n\n return gauge ? (\n <ScorecardsGauge\n title={title}\n description={description}\n entity={entity}\n checkResults={filteredValue}\n noWarning={onlyFailed}\n expanded={expanded}\n />\n ) : (\n <ScorecardInfo\n title={title}\n description={description}\n entity={entity}\n checkResults={filteredValue}\n noWarning={onlyFailed}\n expanded={expanded}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2Ba,MAAA,cAAA,GAAiB,CAAC,KAQzB,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAW,CAAC;AAAA,GACV,GAAA,KAAA;AACJ,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAA,CAAI,UAAU,oBAAqB,CAAA,MAAM,GAAG,QAAQ,CAAA;AAAA,IACtE,CAAC,GAAK,EAAA,MAAA,EAAQ,IAAK,CAAA,SAAA,CAAU,QAAQ,CAAC;AAAA,GACxC;AAEA,EAAA,MAAM,cACJ,GAAA,CAAC,MAAU,IAAA,CAAC,KAAQ,GAAA,KAAA,GAAQ,KAAM,CAAA,MAAA,CAAO,CAAO,GAAA,KAAA,MAAA,CAAO,GAAI,CAAA,KAAK,CAAC,CAAA;AAEnE,EAAM,MAAA,oBAAA,GAAuB,QAAQ,MAAM;AACzC,IAAA,IAAI,CAAC,UAAA,IAAc,CAAC,cAAA,SAAuB,EAAC;AAE5C,IAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,cAAe,CAAA,GAAA,CAAI,CAAC,EAAE,KAAM,EAAA,KAAM,KAAM,CAAA,IAAI,CAAC,CAAC,CAAA;AACxE,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,uBAAA,CAAwB,KAAK,CAAA;AACnD,IAAA,OAAO,MAAO,CAAA,WAAA;AAAA,MACZ,UAAU,GAAI,CAAA,CAAA,QAAA,KAAY,CAAC,QAAS,CAAA,IAAA,EAAM,QAAQ,CAAC;AAAA,KACrD;AAAA,GACC,EAAA,CAAC,GAAK,EAAA,cAAA,EAAgB,UAAU,CAAC,CAAA;AAEpC,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2BAAQ,QAAS,EAAA,EAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAO,uBAAA,GAAA,CAAC,cAAW,KAAc,EAAA,CAAA;AAAA;AAGnC,EAAM,MAAA,aAAA,GAAgB,CAAC,UACnB,GAAA,cAAA,IAAkB,EACjB,GAAA,CAAA,cAAA,IAAkB,EAAI,EAAA,MAAA;AAAA,IAAO,SAC5B,oBAAqB,CAAA,GAAA,CAAI,MAAM,IAAI,CAAA,EAAG,WAAW,GAAG;AAAA,GACtD;AAEJ,EAAA,OAAO,KACL,mBAAA,GAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAc,EAAA,aAAA;AAAA,MACd,SAAW,EAAA,UAAA;AAAA,MACX;AAAA;AAAA,GAGF,mBAAA,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAc,EAAA,aAAA;AAAA,MACd,SAAW,EAAA,UAAA;AAAA,MACX;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import useAsync from 'react-use/esm/useAsync';
3
3
  import { Progress, Page, Content } from '@backstage/core-components';
4
4
  import { useApi } from '@backstage/core-plugin-api';
@@ -16,7 +16,7 @@ const useStyles = makeStyles(() => ({
16
16
  }
17
17
  }));
18
18
  const ScorecardsContent = (props) => {
19
- const { title, description, checksId, filter } = props;
19
+ const { title, description, checksId, filter, dense } = props;
20
20
  const classes = useStyles();
21
21
  const api = useApi(techInsightsApiRef);
22
22
  const { entity } = useEntity();
@@ -26,19 +26,20 @@ const ScorecardsContent = (props) => {
26
26
  );
27
27
  const filteredValues = !filter || !value ? value : value.filter((val) => filter(val.check));
28
28
  if (loading) {
29
- return /* @__PURE__ */ React.createElement(Progress, null);
29
+ return /* @__PURE__ */ jsx(Progress, {});
30
30
  } else if (error) {
31
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.message);
31
+ return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message });
32
32
  }
33
- return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(Content, { className: classes.contentScorecards }, /* @__PURE__ */ React.createElement(
33
+ return /* @__PURE__ */ jsx(Page, { themeId: "home", children: /* @__PURE__ */ jsx(Content, { className: classes.contentScorecards, children: /* @__PURE__ */ jsx(
34
34
  ScorecardInfo,
35
35
  {
36
36
  title,
37
37
  description,
38
38
  entity,
39
- checkResults: filteredValues || []
39
+ checkResults: filteredValues || [],
40
+ dense
40
41
  }
41
- )));
42
+ ) }) });
42
43
  };
43
44
 
44
45
  export { ScorecardsContent };
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardContent.esm.js","sources":["../../../src/components/ScorecardsContent/ScorecardContent.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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Content, Page, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport Alert from '@material-ui/lab/Alert';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\nimport { Check } from '@backstage-community/plugin-tech-insights-common';\n\nconst useStyles = makeStyles(() => ({\n contentScorecards: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport const ScorecardsContent = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n filter?: (check: Check) => boolean;\n}) => {\n const { title, description, checksId, filter } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { namespace, kind, name } = getCompoundEntityRef(entity);\n const { value, loading, error } = useAsync(\n async () => await api.runChecks({ namespace, kind, name }, checksId),\n );\n\n const filteredValues =\n !filter || !value ? value : value.filter(val => filter(val.check));\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n return (\n <Page themeId=\"home\">\n <Content className={classes.contentScorecards}>\n <ScorecardInfo\n title={title}\n description={description}\n entity={entity}\n checkResults={filteredValues || []}\n />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA4BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,iBAAmB,EAAA;AAAA,IACjB,WAAa,EAAA,CAAA;AAAA,IACb,YAAc,EAAA;AAAA;AAElB,CAAE,CAAA,CAAA;AAEW,MAAA,iBAAA,GAAoB,CAAC,KAK5B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,WAAa,EAAA,QAAA,EAAU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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 useAsync from 'react-use/esm/useAsync';\nimport { Content, Page, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport Alert from '@material-ui/lab/Alert';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\nimport { Check } from '@backstage-community/plugin-tech-insights-common';\n\nconst useStyles = makeStyles(() => ({\n contentScorecards: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport const ScorecardsContent = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n filter?: (check: Check) => boolean;\n dense?: boolean;\n}) => {\n const { title, description, checksId, filter, dense } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { namespace, kind, name } = getCompoundEntityRef(entity);\n const { value, loading, error } = useAsync(\n async () => await api.runChecks({ namespace, kind, name }, checksId),\n );\n\n const filteredValues =\n !filter || !value ? value : value.filter(val => filter(val.check));\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n return (\n <Page themeId=\"home\">\n <Content className={classes.contentScorecards}>\n <ScorecardInfo\n title={title}\n description={description}\n entity={entity}\n checkResults={filteredValues || []}\n dense={dense}\n />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAA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AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAA,EAAc,kBAAkB,EAAC;AAAA,MACjC;AAAA;AAAA,KAEJ,CACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,40 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
4
+ import { InfoCard, Gauge } from '@backstage/core-components';
5
+ import { ScorecardInfo } from '../ScorecardsInfo/ScorecardInfo.esm.js';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import Grid from '@material-ui/core/Grid';
8
+
9
+ const ScorecardsGauge = (props) => {
10
+ const { checkResults, entity, title, description, noWarning, expanded } = props;
11
+ const api = useApi(techInsightsApiRef);
12
+ const types = [...new Set(checkResults.map(({ check }) => check.type))];
13
+ const checkResultRenderers = api.getCheckResultRenderers(types);
14
+ const checkResultsWithRenderer = checkResults.map((result) => ({
15
+ result,
16
+ renderer: checkResultRenderers.find(
17
+ (renderer) => renderer.type === result.check.type
18
+ )
19
+ }));
20
+ const succeeded = checkResultsWithRenderer.filter(
21
+ ({ result, renderer }) => !renderer?.isFailed?.(result)
22
+ ).length;
23
+ const progress = succeeded / checkResults.length;
24
+ return /* @__PURE__ */ jsxs(InfoCard, { title, subheader: description, children: [
25
+ /* @__PURE__ */ jsx(Grid, { container: true, justifyContent: "center", children: /* @__PURE__ */ jsx(Grid, { item: true, style: { width: "160px", marginBottom: "1em" }, children: /* @__PURE__ */ jsx(Gauge, { value: progress, size: "small" }) }) }),
26
+ /* @__PURE__ */ jsx(
27
+ ScorecardInfo,
28
+ {
29
+ title: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Checks" }),
30
+ checkResults,
31
+ entity,
32
+ noWarning,
33
+ expanded
34
+ }
35
+ )
36
+ ] });
37
+ };
38
+
39
+ export { ScorecardsGauge };
40
+ //# sourceMappingURL=ScorecardsGauge.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardsGauge.esm.js","sources":["../../../src/components/ScorecardsGauge/ScorecardsGauge.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 { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\nimport { Gauge, InfoCard } from '@backstage/core-components';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\n\nexport const ScorecardsGauge = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n title: string;\n description?: string;\n noWarning?: boolean;\n expanded?: boolean;\n}) => {\n const { checkResults, entity, title, description, noWarning, expanded } =\n 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 const progress = succeeded / checkResults.length;\n\n return (\n <InfoCard title={title} subheader={description}>\n <Grid container justifyContent=\"center\">\n <Grid item style={{ width: '160px', marginBottom: '1em' }}>\n <Gauge value={progress} size=\"small\" />\n </Grid>\n </Grid>\n <ScorecardInfo\n title={<Typography variant=\"h6\">Checks</Typography>}\n chec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AAA,EAAc,KAAM,EAAA,EACtD,QAAC,kBAAA,GAAA,CAAA,KAAA,EAAA,EAAM,OAAO,QAAU,EAAA,IAAA,EAAK,OAAQ,EAAA,CAAA,EACvC,CACF,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,KAAO,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,MAAK,QAAM,EAAA,QAAA,EAAA,CAAA;AAAA,QACtC,YAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardsGauge } from './ScorecardsGauge.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import Grid from '@material-ui/core/Grid';
3
3
  import Typography from '@material-ui/core/Typography';
4
4
  import { makeStyles } from '@material-ui/core/styles';
@@ -21,27 +21,50 @@ const useStyles = makeStyles((theme) => ({
21
21
  },
22
22
  accordionHeaderContent: {
23
23
  margin: `${theme.spacing(2)}px 0 !important`
24
+ },
25
+ accordionDetails: {
26
+ margin: 0,
27
+ paddingBottom: 0
24
28
  }
25
29
  }));
26
- const infoCard = (title, description, classes, element, expanded, summary) => /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Accordion, { defaultExpanded: expanded }, /* @__PURE__ */ React.createElement(
27
- AccordionSummary,
28
- {
29
- expandIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
30
- className: classes.accordionHeader,
31
- classes: {
32
- content: classes.accordionHeaderContent
30
+ const infoAccordion = (title, children, classes, expanded, summary) => /* @__PURE__ */ jsxs(Accordion, { defaultExpanded: expanded, children: [
31
+ /* @__PURE__ */ jsx(
32
+ AccordionSummary,
33
+ {
34
+ expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
35
+ className: classes.accordionHeader,
36
+ classes: {
37
+ content: classes.accordionHeaderContent
38
+ },
39
+ children: /* @__PURE__ */ jsxs(Grid, { container: true, justifyContent: "space-between", alignItems: "center", children: [
40
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: title }) }),
41
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { children: summary }) })
42
+ ] })
33
43
  }
34
- },
35
- /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, title)), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, null, summary)))
36
- ), /* @__PURE__ */ React.createElement(AccordionDetails, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, description && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
37
- Typography,
38
- {
39
- className: classes.subheader,
40
- variant: "body1",
41
- gutterBottom: true
42
- },
43
- /* @__PURE__ */ React.createElement(MarkdownContent, { content: description })
44
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, element)))));
44
+ ),
45
+ /* @__PURE__ */ jsx(AccordionDetails, { classes: { root: classes.accordionDetails }, children })
46
+ ] });
47
+ const infoDetails = (description, classes, element) => {
48
+ return /* @__PURE__ */ jsxs(Grid, { container: true, children: [
49
+ description && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
50
+ Typography,
51
+ {
52
+ className: classes.subheader,
53
+ variant: "body1",
54
+ gutterBottom: true,
55
+ children: /* @__PURE__ */ jsx(MarkdownContent, { content: description })
56
+ }
57
+ ) }),
58
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: element })
59
+ ] });
60
+ };
61
+ const infoCard = (title, description, classes, element, expanded, summary) => /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: infoAccordion(
62
+ title,
63
+ infoDetails(description, classes, element),
64
+ classes,
65
+ expanded,
66
+ summary
67
+ ) });
45
68
  const ScorecardInfo = (props) => {
46
69
  const {
47
70
  checkResults,
@@ -49,7 +72,8 @@ const ScorecardInfo = (props) => {
49
72
  entity,
50
73
  description,
51
74
  noWarning,
52
- expanded = true
75
+ expanded = true,
76
+ dense
53
77
  } = props;
54
78
  const classes = useStyles();
55
79
  const api = useApi(techInsightsApiRef);
@@ -59,7 +83,7 @@ const ScorecardInfo = (props) => {
59
83
  title,
60
84
  description,
61
85
  classes,
62
- /* @__PURE__ */ React.createElement(Alert, { severity: "info" }, "All checks passed, or no checks have been performed yet"),
86
+ /* @__PURE__ */ jsx(Alert, { severity: "info", children: "All checks passed, or no checks have been performed yet" }),
63
87
  expanded
64
88
  );
65
89
  }
@@ -67,7 +91,7 @@ const ScorecardInfo = (props) => {
67
91
  title,
68
92
  description,
69
93
  classes,
70
- /* @__PURE__ */ React.createElement(Alert, { severity: "warning" }, "No checks have any data yet."),
94
+ /* @__PURE__ */ jsx(Alert, { severity: "warning", children: "No checks have any data yet." }),
71
95
  expanded
72
96
  );
73
97
  }
@@ -75,7 +99,15 @@ const ScorecardInfo = (props) => {
75
99
  title,
76
100
  description,
77
101
  classes,
78
- /* @__PURE__ */ React.createElement(ScorecardsList, { checkResults, entity }),
102
+ /* @__PURE__ */ jsx(
103
+ ScorecardsList,
104
+ {
105
+ checkResults,
106
+ entity,
107
+ hideDescription: true,
108
+ dense
109
+ }
110
+ ),
79
111
  expanded,
80
112
  `${checkResults.filter((checkResult) => !api.isCheckResultFailed(checkResult)).length}/${checkResults.length}`
81
113
  );
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardInfo.esm.js","sources":["../../../src/components/ScorecardsInfo/ScorecardInfo.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 React, { ReactNode } from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { ScorecardsList } from '../ScorecardsList';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Entity } from '@backstage/catalog-model';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\n\nconst useStyles = makeStyles(theme => ({\n subheader: {\n paddingLeft: theme.spacing(0.5),\n },\n accordionHeader: {\n borderBottom: `1px solid ${theme.palette.border}`,\n },\n accordionHeaderContent: {\n margin: `${theme.spacing(2)}px 0 !important`,\n },\n}));\n\nconst infoCard = (\n title: React.ReactNode,\n description: string | undefined,\n classes: ReturnType<typeof useStyles>,\n element: React.ReactElement,\n expanded: boolean,\n summary?: string,\n) => (\n <Grid item xs={12}>\n <Accordion defaultExpanded={expanded}>\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n className={classes.accordionHeader}\n classes={{\n content: classes.accordionHeaderContent,\n }}\n >\n <Grid container justifyContent=\"space-between\" alignItems=\"center\">\n <Grid item>\n <Typography variant=\"h5\">{title}</Typography>\n </Grid>\n <Grid item>\n <Typography>{summary}</Typography>\n </Grid>\n </Grid>\n </AccordionSummary>\n <AccordionDetails>\n <Grid container>\n {description && (\n <Grid item xs={12}>\n <Typography\n className={classes.subheader}\n variant=\"body1\"\n gutterBottom\n >\n <MarkdownContent content={description} />\n </Typography>\n </Grid>\n )}\n <Grid item xs={12}>\n {element}\n </Grid>\n </Grid>\n </AccordionDetails>\n </Accordion>\n </Grid>\n);\n\nexport const ScorecardInfo = (props: {\n checkResults: CheckResult[];\n title: ReactNode;\n entity: Entity;\n description?: string;\n noWarning?: boolean;\n expanded?: boolean;\n}) => {\n const {\n checkResults,\n title,\n entity,\n description,\n noWarning,\n expanded = true,\n } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n if (!checkResults.length) {\n if (noWarning) {\n return infoCard(\n title,\n description,\n classes,\n <Alert severity=\"info\">\n All checks passed, or no checks have been performed yet\n </Alert>,\n expanded,\n );\n }\n return infoCard(\n title,\n description,\n classes,\n <Alert severity=\"warning\">No checks have any data yet.</Alert>,\n expanded,\n );\n }\n\n return infoCard(\n title,\n description,\n classes,\n <ScorecardsList checkResults={checkResults} entity={entity} />,\n expanded,\n `${\n checkResults.filter(checkResult => !api.isCheckResultFailed(checkResult))\n .length\n }/${checkResults.length}`,\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,GAAG;AAAA,GAChC;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,YAAc,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,MAAM,CAAA;AAAA,GACjD;AAAA,EACA,sBAAwB,EAAA;AAAA,IACtB,MAAQ,EAAA,CAAA,EAAG,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAC,CAAA,eAAA;AAAA;AAE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5D,QAAA;AAAA,IACA,CACE,EAAA,YAAA,CAAa,MAAO,CAAA,CAAA,WAAA,KAAe,CAAC,GAAA,CAAI,mBAAoB,CAAA,WAAW,CAAC,CAAA,CACrE,MACL,CAAA,CAAA,EAAI,aAAa,MAAM,CAAA;AAAA,GACzB;AACF;;;;"}
1
+ {"version":3,"file":"ScorecardInfo.esm.js","sources":["../../../src/components/ScorecardsInfo/ScorecardInfo.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 { ReactElement, ReactNode } from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { ScorecardsList } from '../ScorecardsList';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Entity } from '@backstage/catalog-model';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';\n\nconst useStyles = makeStyles(theme => ({\n subheader: {\n paddingLeft: theme.spacing(0.5),\n },\n accordionHeader: {\n borderBottom: `1px solid ${theme.palette.border}`,\n },\n accordionHeaderContent: {\n margin: `${theme.spacing(2)}px 0 !important`,\n },\n accordionDetails: {\n margin: 0,\n paddingBottom: 0,\n },\n}));\n\nconst infoAccordion = (\n title: ReactNode,\n children: ReactNode,\n classes: ReturnType<typeof useStyles>,\n expanded: boolean,\n summary?: string,\n) => (\n <Accordion defaultExpanded={expanded}>\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n className={classes.accordionHeader}\n classes={{\n content: classes.accordionHeaderContent,\n }}\n >\n <Grid container justifyContent=\"space-between\" alignItems=\"center\">\n <Grid item>\n <Typography variant=\"h5\">{title}</Typography>\n </Grid>\n <Grid item>\n <Typography>{summary}</Typography>\n </Grid>\n </Grid>\n </AccordionSummary>\n <AccordionDetails classes={{ root: classes.accordionDetails }}>\n {children}\n </AccordionDetails>\n </Accordion>\n);\n\nconst infoDetails = (\n description: string | undefined,\n classes: ReturnType<typeof useStyles>,\n element: ReactElement,\n) => {\n return (\n <Grid container>\n {description && (\n <Grid item xs={12}>\n <Typography\n className={classes.subheader}\n variant=\"body1\"\n gutterBottom\n >\n <MarkdownContent content={description} />\n </Typography>\n </Grid>\n )}\n <Grid item xs={12}>\n {element}\n </Grid>\n </Grid>\n );\n};\n\nconst infoCard = (\n title: ReactNode,\n description: string | undefined,\n classes: ReturnType<typeof useStyles>,\n element: ReactElement,\n expanded: boolean,\n summary?: string,\n) => (\n <Grid item xs={12}>\n {infoAccordion(\n title,\n infoDetails(description, classes, element),\n classes,\n expanded,\n summary,\n )}\n </Grid>\n);\n\nexport const ScorecardInfo = (props: {\n checkResults: CheckResult[];\n title: ReactNode;\n entity?: Entity;\n description?: string;\n noWarning?: boolean;\n expanded?: boolean;\n dense?: boolean;\n}) => {\n const {\n checkResults,\n title,\n entity,\n description,\n noWarning,\n expanded = true,\n dense,\n } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n if (!checkResults.length) {\n if (noWarning) {\n return infoCard(\n title,\n description,\n classes,\n <Alert severity=\"info\">\n All checks passed, or no checks have been performed yet\n </Alert>,\n expanded,\n );\n }\n return infoCard(\n title,\n description,\n classes,\n <Alert severity=\"warning\">No checks have any data yet.</Alert>,\n expanded,\n );\n }\n\n return infoCard(\n title,\n description,\n classes,\n <ScorecardsList\n checkResults={checkResults}\n entity={entity}\n hideDescription\n dense={dense}\n />,\n expanded,\n `${\n checkResults.filter(checkResult => !api.isCheckResultFailed(checkResult))\n .length\n }/${checkResults.length}`,\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,GAAG;AAAA,GAChC;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,YAAc,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,MAAM,CAAA;AAAA,GACjD;AAAA,EACA,sBAAwB,EAAA;AAAA,IACtB,MAAQ,EAAA,CAAA,EAAG,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAC,CAAA,eAAA;AAAA,GAC7B;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,MAAQ,EAAA,CAAA;AAAA,IACR,aAAe,EAAA;AAAA;AAEnB,CAAE,CAAA,CAAA;AAEF,MAAM,aAAA,GAAgB,CACpB,KAAA,EACA,QACA,EAAA,OAAA,EACA,UACA,OAEA,qBAAA,IAAA,CAAC,SAAU,EAAA,EAAA,eAAA,EAAiB,QAC1B,EAAA,QAAA,EAAA;AAAA,kBAAA,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,UAAA,sBAAa,cAAe,EAAA,EAAA,CAAA;AAAA,MAC5B,WAAW,OAAQ,CAAA,eAAA;AAAA,MACnB,OAAS,EAAA;AAAA,QACP,SAAS,OAAQ,CAAA;AAAA,OACnB;AAAA,MAEA,+BAAC,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,cAAe,EAAA,eAAA,EAAgB,YAAW,QACxD,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IACR,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AM,CAAA;AAAA,GACzB;AACF;;;;"}
@@ -1,47 +1,57 @@
1
- import React from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useApi } from '@backstage/core-plugin-api';
3
3
  import List from '@material-ui/core/List';
4
4
  import ListItem from '@material-ui/core/ListItem';
5
- import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
6
5
  import ListItemText from '@material-ui/core/ListItemText';
7
6
  import { makeStyles } from '@material-ui/core/styles';
8
7
  import { MarkdownContent } from '@backstage/core-components';
9
8
  import { techInsightsApiRef, ResultCheckIcon } from '@backstage-community/plugin-tech-insights-react';
9
+ import Tooltip from '@material-ui/core/Tooltip';
10
10
 
11
11
  const useStyles = makeStyles((theme) => ({
12
12
  listItemText: {
13
13
  paddingRight: theme.spacing(0.5)
14
14
  }
15
15
  }));
16
+ const itemTooltip = (children, title, enabled) => enabled ? /* @__PURE__ */ jsx(Tooltip, { title, children }) : children;
16
17
  const ScorecardsList = (props) => {
17
- const { checkResults, entity } = props;
18
+ const { checkResults, entity, dense, hideDescription } = props;
18
19
  const classes = useStyles();
19
20
  const api = useApi(techInsightsApiRef);
20
21
  const types = [...new Set(checkResults.map(({ check }) => check.type))];
21
22
  const checkResultRenderers = api.getCheckResultRenderers(types);
22
- return /* @__PURE__ */ React.createElement(List, null, checkResults.map((result, index) => {
23
+ return /* @__PURE__ */ jsx(List, { dense, disablePadding: true, children: checkResults.map((result, index) => {
23
24
  const checkResultRenderer = checkResultRenderers.find(
24
- (renderer) => renderer.type === result.check.type
25
+ (renderer2) => renderer2.type === result.check.type
25
26
  );
26
- const description = checkResultRenderer?.description;
27
- return /* @__PURE__ */ React.createElement(ListItem, { key: result.check.id }, /* @__PURE__ */ React.createElement(
28
- ListItemText,
29
- {
30
- key: index,
31
- primary: result.check.name,
32
- secondary: description ? description(result) : /* @__PURE__ */ React.createElement(MarkdownContent, { content: result.check.description }),
33
- className: classes.listItemText
34
- }
35
- ), /* @__PURE__ */ React.createElement(
36
- ResultCheckIcon,
37
- {
38
- result,
39
- entity,
40
- component: ListItemSecondaryAction,
41
- checkResultRenderer
42
- }
43
- ));
44
- }));
27
+ const renderer = checkResultRenderer?.description;
28
+ const description = renderer ? renderer(result) : /* @__PURE__ */ jsx(MarkdownContent, { content: result.check.description });
29
+ return itemTooltip(
30
+ /* @__PURE__ */ jsxs(ListItem, { disableGutters: true, children: [
31
+ /* @__PURE__ */ jsx(
32
+ ListItemText,
33
+ {
34
+ primary: result.check.name,
35
+ ...!props.hideDescription ? {
36
+ secondary: description
37
+ } : {},
38
+ className: classes.listItemText
39
+ },
40
+ index
41
+ ),
42
+ /* @__PURE__ */ jsx(
43
+ ResultCheckIcon,
44
+ {
45
+ result,
46
+ entity,
47
+ checkResultRenderer
48
+ }
49
+ )
50
+ ] }, result.check.id),
51
+ description,
52
+ hideDescription
53
+ );
54
+ }) });
45
55
  };
46
56
 
47
57
  export { ScorecardsList };
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardsList.esm.js","sources":["../../../src/components/ScorecardsList/ScorecardsList.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 React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n ResultCheckIcon,\n techInsightsApiRef,\n} from '@backstage-community/plugin-tech-insights-react';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\n\nexport const ScorecardsList = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n}) => {\n const { checkResults, entity } = props;\n\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List>\n {checkResults.map((result, index) => {\n const checkResultRenderer = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n );\n\n const description = checkResultRenderer?.description;\n\n return (\n <ListItem key={result.check.id}>\n <ListItemText\n key={index}\n primary={result.check.name}\n secondary={\n description ? (\n description(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n )\n }\n className={classes.listItemText}\n />\n <ResultCheckIcon\n result={result}\n entity={entity}\n component={ListItemSecondaryAction}\n checkResultRenderer={checkResultRenderer}\n />\n </ListItem>\n );\n })}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,YAAc,EAAA;AAAA,IACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,GAAG;AAAA;AAEnC,CAAE,CAAA,CAAA;AAEW,MAAA,cAAA,GAAiB,CAAC,KAGzB,KAAA;AACJ,EAAM,MAAA,EAAE,YAAc,EAAA,MAAA,EAAW,GAAA,KAAA;AAEjC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA;AAErC,EAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,YAAa,CAAA,GAAA,CAAI,CAAC,EAAE,KAAM,EAAA,KAAM,KAAM,CAAA,IAAI,CAAC,CAAC,CAAA;AACtE,EAAM,MAAA,oBAAA,GAAuB,GAAI,CAAA,uBAAA,CAAwB,KAAK,CAAA;AAE9D,EAAA,2CACG,IACE,EAAA,IAAA,EAAA,YAAA,CAAa,GAAI,CAAA,CAAC,QAAQ,KAAU,KAAA;AACnC,IAAA,MAAM,sBAAsB,oBAAqB,CAAA,IAAA;AAAA,MAC/C,CAAY,QAAA,KAAA,QAAA,CAAS,IAAS,KAAA,MAAA,CAAO,KAAM,CAAA;AAAA,KAC7C;AAEA,IAAA,MAAM,cAAc,mBAAqB,EAAA,WAAA;AAEzC,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,GAAK,EAAA,MAAA,CAAO,MAAM,EAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,GAAK,EAAA,KAAA;AAAA,QACL,OAAA,EAAS,OAAO,KAAM,CAAA,IAAA;AAAA,QACtB,SAAA,EACE,WACE,GAAA,WAAA,CAAY,MAAM,CAAA,uCAEjB,eAAgB,EAAA,EAAA,OAAA,EAAS,MAAO,CAAA,KAAA,CAAM,WAAa,EAAA,CAAA;AAAA,QAGxD,WAAW,OAAQ,CAAA;AAAA;AAAA,KAErB,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,MAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAW,EAAA,uBAAA;AAAA,QACX;AAAA;AAAA,KAEJ,CAAA;AAAA,GAEH,CACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ScorecardsList.esm.js","sources":["../../../src/components/ScorecardsList/ScorecardsList.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 { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n ResultCheckIcon,\n techInsightsApiRef,\n} from '@backstage-community/plugin-tech-insights-react';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\nconst itemTooltip = (\n children: React.ReactElement,\n title: string | NonNullable<React.ReactNode>,\n enabled?: boolean,\n) => (enabled ? <Tooltip title={title}>{children}</Tooltip> : children);\n\nexport const ScorecardsList = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n dense?: boolean;\n hideDescription?: boolean;\n}) => {\n const { checkResults, entity, dense, hideDescription } = props;\n\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List dense={dense} disablePadding>\n {checkResults.map((result, index) => {\n const checkResultRenderer = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n );\n const renderer = checkResultRenderer?.description;\n const description = renderer ? (\n renderer(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n );\n\n return itemTooltip(\n <ListItem key={result.check.id} disableGutters>\n <ListItemText\n key={index}\n primary={result.check.name}\n {...(!props.hideDescription\n ? {\n secondary: description,\n }\n : {})}\n className={classes.listItemText}\n />\n <ResultCheckIcon\n result={result}\n entity={entity}\n checkResultRenderer={checkResultRenderer}\n />\n </ListItem>,\n description,\n hideDescription,\n );\n })}\n </List>\n );\n};\n"],"names":["renderer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OAAA,WAAA;AAAA,sBACL,IAAA,CAAC,QAA+B,EAAA,EAAA,cAAA,EAAc,IAC5C,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YAEC,OAAA,EAAS,OAAO,KAAM,CAAA,IAAA;AAAA,YACrB,GAAI,CAAC,KAAA,CAAM,eACR,GAAA;AAAA,cACE,SAAW,EAAA;AAAA,gBAEb,EAAC;AAAA,YACL,WAAW,OAAQ,CAAA;AAAA,WAAA;AAAA,UAPd;AAAA,SAQP;AAAA,wBACA,GAAA;AAAA,UAAC,eAAA;AAAA,UAAA;AAAA,YACC,MAAA;AAAA,YACA,MAAA;AAAA,YACA;AAAA;AAAA;AACF,OAfa,EAAA,EAAA,MAAA,CAAO,MAAM,EAgB5B,CAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACF;AAAA,GACD,CACH,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import Typography from '@material-ui/core/Typography';
3
3
  import Autocomplete from '@material-ui/lab/Autocomplete';
4
4
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
@@ -31,16 +31,16 @@ const FixedWidthFormControlLabel = withStyles((_theme) => ({
31
31
  width: "90%"
32
32
  }
33
33
  }))(FormControlLabel);
34
- const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
35
- const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
34
+ const icon = /* @__PURE__ */ jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
35
+ const checkedIcon = /* @__PURE__ */ jsx(CheckBoxIcon, { fontSize: "small" });
36
36
  function RenderOptionLabel(props) {
37
37
  const classes = useStyles();
38
38
  const { check, isSelected } = props;
39
- return /* @__PURE__ */ React.createElement(Box, { className: classes.fullWidth }, /* @__PURE__ */ React.createElement(
39
+ return /* @__PURE__ */ jsx(Box, { className: classes.fullWidth, children: /* @__PURE__ */ jsx(
40
40
  FixedWidthFormControlLabel,
41
41
  {
42
42
  className: classes.fullWidth,
43
- control: /* @__PURE__ */ React.createElement(
43
+ control: /* @__PURE__ */ jsx(
44
44
  Checkbox,
45
45
  {
46
46
  icon,
@@ -49,9 +49,9 @@ function RenderOptionLabel(props) {
49
49
  }
50
50
  ),
51
51
  onClick: (event) => event.preventDefault(),
52
- label: /* @__PURE__ */ React.createElement(Tooltip, { title: check.id }, /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Box, { className: classes.boxLabel }, /* @__PURE__ */ React.createElement(Typography, { noWrap: true }, check.name))))
52
+ label: /* @__PURE__ */ jsx(Tooltip, { title: check.id, children: /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx(Box, { className: classes.boxLabel, children: /* @__PURE__ */ jsx(Typography, { noWrap: true, children: check.name }) }) }) })
53
53
  }
54
- ));
54
+ ) });
55
55
  }
56
56
  const withResultsOptions = [
57
57
  { label: "Yes", value: true },
@@ -64,44 +64,53 @@ const Filters = (props) => {
64
64
  return api.getAllChecks();
65
65
  }, [api]);
66
66
  if (error) {
67
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
67
+ return /* @__PURE__ */ jsx(ErrorPanel, { error });
68
68
  }
69
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button", component: "label" }, "Checks", /* @__PURE__ */ React.createElement(
70
- Autocomplete,
71
- {
72
- multiple: true,
73
- disableCloseOnSelect: true,
74
- options: value ?? [],
75
- loading,
76
- getOptionLabel: (o) => o.name,
77
- onChange: (_, changedChecks) => {
78
- checksChanged(changedChecks);
79
- },
80
- filterOptions: (x) => x,
81
- renderOption: (check, { selected }) => {
82
- return /* @__PURE__ */ React.createElement(RenderOptionLabel, { check, isSelected: selected });
83
- },
84
- size: "small",
85
- popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
86
- renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
87
- }
88
- ))), /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button", component: "label" }, "Only with results", /* @__PURE__ */ React.createElement(
89
- Autocomplete,
90
- {
91
- defaultValue: withResultsOptions[0],
92
- options: withResultsOptions,
93
- getOptionLabel: (o) => o.label,
94
- onChange: (_, selectedItem) => {
95
- if (selectedItem) {
96
- withResultsChanged(selectedItem.value);
69
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ /* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsxs(Typography, { variant: "button", component: "label", children: [
71
+ "Checks",
72
+ /* @__PURE__ */ jsx(
73
+ Autocomplete,
74
+ {
75
+ multiple: true,
76
+ disableCloseOnSelect: true,
77
+ options: value ?? [],
78
+ loading,
79
+ getOptionLabel: (o) => o.name,
80
+ onChange: (_, changedChecks) => {
81
+ checksChanged(changedChecks);
82
+ },
83
+ filterOptions: (x) => x,
84
+ renderOption: (check, { selected }) => {
85
+ return /* @__PURE__ */ jsx(RenderOptionLabel, { check, isSelected: selected });
86
+ },
87
+ size: "small",
88
+ popupIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
89
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, variant: "outlined" })
97
90
  }
98
- },
99
- disableClearable: true,
100
- size: "small",
101
- popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
102
- renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
103
- }
104
- ))));
91
+ )
92
+ ] }) }),
93
+ /* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsxs(Typography, { variant: "button", component: "label", children: [
94
+ "Only with results",
95
+ /* @__PURE__ */ jsx(
96
+ Autocomplete,
97
+ {
98
+ defaultValue: withResultsOptions[0],
99
+ options: withResultsOptions,
100
+ getOptionLabel: (o) => o.label,
101
+ onChange: (_, selectedItem) => {
102
+ if (selectedItem) {
103
+ withResultsChanged(selectedItem.value);
104
+ }
105
+ },
106
+ disableClearable: true,
107
+ size: "small",
108
+ popupIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
109
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, variant: "outlined" })
110
+ }
111
+ )
112
+ ] }) })
113
+ ] });
105
114
  };
106
115
 
107
116
  export { Filters };
@@ -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 React from 'react';\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":";;;;;;;;;;;;;;;;;AAkCA,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,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AACxD,MAAM,WAAc,mBAAA,KAAA,CAAA,aAAA,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,u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I,EAAA,CAAA,EAAA,sCACb,UAAW,EAAA,EAAA,OAAA,EAAQ,QAAS,EAAA,SAAA,EAAU,WAAQ,mBAE7C,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAc,mBAAmB,CAAC,CAAA;AAAA,MAClC,OAAS,EAAA,kBAAA;AAAA,MACT,cAAA,EAAgB,OAAK,CAAE,CAAA,KAAA;AAAA,MACvB,QAAA,EAAU,CAAC,CAAA,EAAW,YAAiB,KAAA;AACrC,QAAA,IAAI,YAAc,EAAA;AAChB,UAAA,kBAAA,CAAmB,aAAa,KAAK,CAAA;AAAA;AACvC,OACF;AAAA,MACA,gBAAgB,EAAA,IAAA;AAAA,MAChB,IAAK,EAAA,OAAA;AAAA,MACL,SAAA,sCAAY,cAAe,EAAA,IAAA,CAAA;AAAA,MAC3B,aAAa,CAAU,MAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA,GAErE,CACF,CACF,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\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;AACx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,MAAA,qBAAA,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA;AACnE,KAAA,EACF,CACF,EAAA,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,mBAAmB,CAAC,CAAA;AAAA,UAClC,OAAS,EAAA,kBAAA;AAAA,UACT,cAAA,EAAgB,OAAK,CAAE,CAAA,KAAA;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,4 +1,5 @@
1
- import React, { useState, useMemo } from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useMemo } from 'react';
2
3
  import { ErrorPanel, Page, Header, HeaderLabel, Content, Table } from '@backstage/core-components';
3
4
  import { useApi } from '@backstage/core-plugin-api';
4
5
  import useAsync from 'react-use/lib/useAsync';
@@ -8,8 +9,9 @@ import Grid from '@material-ui/core/Grid';
8
9
  import { Filters } from './Filters.esm.js';
9
10
  import { ExportCsv } from '@material-table/exporters';
10
11
  import { techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
12
+ import { ScorecardsBadge } from '../ScorecardsBadge/ScorecardsBadge.esm.js';
11
13
 
12
- const ScorecardsPage = () => {
14
+ const ScorecardsPage = (props) => {
13
15
  const api = useApi(techInsightsApiRef);
14
16
  const [filterSelectedChecks, setFilterSelectedChecks] = useState([]);
15
17
  const [filterWithResults, setFilterWithResults] = useState(true);
@@ -20,7 +22,10 @@ const ScorecardsPage = () => {
20
22
  label: "Export CSV",
21
23
  exportFunc: (cols, datas) => ExportCsv(cols, datas, "tech-insights")
22
24
  }
23
- ]
25
+ ],
26
+ pageSize: props.badge ? 15 : 5,
27
+ pageSizeOptions: props.badge ? [15, 30, 100] : [5, 10, 20],
28
+ padding: `${props.dense ? "dense" : "default"}`
24
29
  };
25
30
  const { value, loading, error } = useAsync(async () => {
26
31
  const checks = await api.getAllChecks();
@@ -35,12 +40,12 @@ const ScorecardsPage = () => {
35
40
  {
36
41
  field: "entity",
37
42
  title: "Entity",
38
- render: (row) => /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: row.entity })
43
+ render: (row) => /* @__PURE__ */ jsx(EntityRefLink, { entityRef: row.entity })
39
44
  },
40
45
  {
41
46
  field: "results",
42
47
  title: "Results",
43
- render: (row) => /* @__PURE__ */ React.createElement(ScorecardsList, { checkResults: row.results }),
48
+ render: (row) => props.badge ? /* @__PURE__ */ jsx(ScorecardsBadge, { checkResults: row.results }) : /* @__PURE__ */ jsx(ScorecardsList, { checkResults: row.results, dense: props.dense }),
44
49
  export: false
45
50
  }
46
51
  ];
@@ -56,25 +61,34 @@ const ScorecardsPage = () => {
56
61
  });
57
62
  });
58
63
  return columns;
59
- }, [value, filterSelectedChecks]);
64
+ }, [props, value, filterSelectedChecks]);
60
65
  if (error) {
61
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
66
+ return /* @__PURE__ */ jsx(ErrorPanel, { error });
62
67
  }
63
- return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title: "Tech insights" }, /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Entities", value: value?.result.length ?? 0 }), /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Checks", value: value?.checks.length ?? 0 })), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, style: { width: "300px" } }, /* @__PURE__ */ React.createElement(
64
- Filters,
65
- {
66
- checksChanged: (checks) => setFilterSelectedChecks(checks),
67
- withResultsChanged: (withResults) => setFilterWithResults(withResults)
68
- }
69
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(
70
- Table,
71
- {
72
- columns: tableColumns,
73
- data: value?.result ?? [],
74
- isLoading: loading,
75
- options: tableOptions
76
- }
77
- )))));
68
+ return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
69
+ /* @__PURE__ */ jsxs(Header, { title: "Tech insights", children: [
70
+ /* @__PURE__ */ jsx(HeaderLabel, { label: "Entities", value: value?.result.length ?? 0 }),
71
+ /* @__PURE__ */ jsx(HeaderLabel, { label: "Checks", value: value?.checks.length ?? 0 })
72
+ ] }),
73
+ /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Grid, { container: true, children: [
74
+ /* @__PURE__ */ jsx(Grid, { item: true, style: { width: "300px" }, children: /* @__PURE__ */ jsx(
75
+ Filters,
76
+ {
77
+ checksChanged: (checks) => setFilterSelectedChecks(checks),
78
+ withResultsChanged: (withResults) => setFilterWithResults(withResults)
79
+ }
80
+ ) }),
81
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(
82
+ Table,
83
+ {
84
+ columns: tableColumns,
85
+ data: value?.result ?? [],
86
+ isLoading: loading,
87
+ options: tableOptions
88
+ }
89
+ ) })
90
+ ] }) })
91
+ ] });
78
92
  };
79
93
 
80
94
  export { ScorecardsPage };
@@ -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 React, { 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';\n\nexport const ScorecardsPage = () => {\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 };\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,\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 => <ScorecardsList checkResults={row.results} />,\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 }, [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":";;;;;;;;;;;AAwCO,MAAM,iBAAiB,MAAM;AAClC,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;AAA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A,oBAAA,CAAqB,WAAW;AAAA;AAAA,GAGtC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACX,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAA,EAAM,KAAO,EAAA,MAAA,IAAU,EAAC;AAAA,MACxB,SAAW,EAAA,OAAA;AAAA,MACX,OAAS,EAAA;AAAA;AAAA,GAEb,CACF,CACF,CACF,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\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,\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,EAAE,CAAA;AAAA,IACzD,OAAS,EAAA,CAAA,EAAG,KAAM,CAAA,KAAA,GAAQ,UAAU,SAAS,CAAA;AAAA,GAC/C;AAEA,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,YAAY;AACrD,IAAM,MAAA,MAAA,GAAS,MAAM,GAAA,CAAI,YAAa,EAAA;AACtC,IAAA,MAAM,SAAS,MAAM,GAAA,CAAI,aAAc,CAAA,IAAI,oBAAoB,CAAA;AAE/D,IAAO,OAAA;AAAA,MACL,MAAA;AAAA,MACA,MAAA,EAAQ,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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,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import * as _backstage_community_plugin_tech_insights_react from '@backstage-community/plugin-tech-insights-react';
3
3
  export { BooleanCheck, CheckResultRenderer, ResultCheckIconBaseComponentProps, ResultCheckIconProps, ResultLinksMenuInfo, TechInsightsApi, TechInsightsClient, jsonRulesEngineCheckResultRenderer, techInsightsApiRef } from '@backstage-community/plugin-tech-insights-react';
4
- import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import * as _backstage_catalog_model from '@backstage/catalog-model';
5
6
  import * as react from 'react';
6
7
  import * as _backstage_community_plugin_tech_insights_common from '@backstage-community/plugin-tech-insights-common';
7
8
  export { Check, InsightFacts } from '@backstage-community/plugin-tech-insights-common';
@@ -19,18 +20,24 @@ declare const techInsightsPlugin: _backstage_core_plugin_api.BackstagePlugin<{
19
20
  declare const ScorecardInfo: (props: {
20
21
  checkResults: _backstage_community_plugin_tech_insights_common.CheckResult[];
21
22
  title: react.ReactNode;
22
- entity: _backstage_catalog_model_index.Entity;
23
+ entity?: _backstage_catalog_model.Entity | undefined;
23
24
  description?: string | undefined;
24
25
  noWarning?: boolean | undefined;
25
26
  expanded?: boolean | undefined;
26
- }) => react.JSX.Element;
27
+ dense?: boolean | undefined;
28
+ }) => react_jsx_runtime.JSX.Element;
27
29
  /**
28
30
  * @public
29
31
  */
30
32
  declare const ScorecardsList: (props: {
31
33
  checkResults: _backstage_community_plugin_tech_insights_common.CheckResult[];
32
- entity?: _backstage_catalog_model_index.Entity | undefined;
33
- }) => react.JSX.Element;
34
+ /**
35
+ * @public
36
+ */
37
+ entity?: _backstage_catalog_model.Entity | undefined;
38
+ dense?: boolean | undefined;
39
+ hideDescription?: boolean | undefined;
40
+ }) => react_jsx_runtime.JSX.Element;
34
41
  /**
35
42
  * @public
36
43
  */
@@ -39,7 +46,8 @@ declare const EntityTechInsightsScorecardContent: (props: {
39
46
  description?: string | undefined;
40
47
  checksId?: string[] | undefined;
41
48
  filter?: ((check: _backstage_community_plugin_tech_insights_common.Check) => boolean) | undefined;
42
- }) => react.JSX.Element;
49
+ dense?: boolean | undefined;
50
+ }) => react_jsx_runtime.JSX.Element;
43
51
  /**
44
52
  * @public
45
53
  */
@@ -50,24 +58,28 @@ declare const EntityTechInsightsScorecardCard: (props: {
50
58
  filter?: ((check: _backstage_community_plugin_tech_insights_common.Check) => boolean) | undefined;
51
59
  onlyFailed?: boolean | undefined;
52
60
  expanded?: boolean | undefined;
53
- }) => react.JSX.Element;
61
+ gauge?: boolean | undefined;
62
+ }) => react_jsx_runtime.JSX.Element;
54
63
  /**
55
64
  * @public
56
65
  */
57
- declare const TechInsightsScorecardPage: () => react.JSX.Element;
66
+ declare const TechInsightsScorecardPage: (props: {
67
+ badge?: boolean | undefined;
68
+ dense?: boolean | undefined;
69
+ }) => react_jsx_runtime.JSX.Element;
58
70
  /**
59
71
  * @public
60
72
  * @deprecated Use `ResultCheckIcon` from `@backstage-community/plugin-tech-insights-react` instead
61
73
  */
62
- declare const TechInsightsCheckIcon: <P extends _backstage_community_plugin_tech_insights_react.ResultCheckIconBaseComponentProps>(props: _backstage_community_plugin_tech_insights_react.ResultCheckIconProps<P>) => react.JSX.Element;
74
+ 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;
63
75
  /**
64
76
  * @public
65
77
  * @deprecated Use `ResultLinksMenu` from `@backstage-community/plugin-tech-insights-react` instead
66
78
  */
67
79
  declare const TechInsightsLinksMenu: (props: react.PropsWithChildren<{
68
80
  result: _backstage_community_plugin_tech_insights_common.CheckResult;
69
- entity?: _backstage_catalog_model_index.Entity | undefined;
81
+ entity?: _backstage_catalog_model.Entity | undefined;
70
82
  setMenu(opener: _backstage_community_plugin_tech_insights_react.ResultLinksMenuInfo | undefined): void;
71
- }>) => react.JSX.Element | null;
83
+ }>) => react_jsx_runtime.JSX.Element | null;
72
84
 
73
85
  export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsCheckIcon, TechInsightsLinksMenu, TechInsightsScorecardPage, techInsightsPlugin };
@@ -31,6 +31,22 @@ const ScorecardsList = techInsightsPlugin.provide(
31
31
  }
32
32
  })
33
33
  );
34
+ techInsightsPlugin.provide(
35
+ createComponentExtension({
36
+ name: "ScorecardBadge",
37
+ component: {
38
+ lazy: () => import('./components/ScorecardsBadge/index.esm.js').then((m) => m.ScorecardsBadge)
39
+ }
40
+ })
41
+ );
42
+ techInsightsPlugin.provide(
43
+ createComponentExtension({
44
+ name: "ScorecardGauge",
45
+ component: {
46
+ lazy: () => import('./components/ScorecardsGauge/index.esm.js').then((m) => m.ScorecardsGauge)
47
+ }
48
+ })
49
+ );
34
50
  const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(
35
51
  createRoutableExtension({
36
52
  name: "EntityTechInsightsScorecardContent",
@@ -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 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\n/**\n * @public\n * @deprecated Use `ResultCheckIcon` from `@backstage-community/plugin-tech-insights-react` instead\n */\nexport const TechInsightsCheckIcon = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsCheckIcon',\n component: {\n lazy: () =>\n import('@backstage-community/plugin-tech-insights-react').then(\n m => m.ResultCheckIcon,\n ),\n },\n }),\n);\n\n/**\n * @public\n * @deprecated Use `ResultLinksMenu` from `@backstage-community/plugin-tech-insights-react` instead\n */\nexport const TechInsightsLinksMenu = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsLinksMenu',\n component: {\n lazy: () =>\n import('@backstage-community/plugin-tech-insights-react').then(\n m => m.ResultLinksMenu,\n ),\n },\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,CAAC,EAAE,YAAc,EAAA,WAAA,EACxB,KAAA,IAAI,kBAAmB,CAAA,EAAE,YAAc,EAAA,WAAA,EAAa;AAAA,KACvD;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA;AAEV,CAAC;AAKM,MAAM,gBAAgB,kBAAmB,CAAA,OAAA;AAAA,EAC9C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,eAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa;AAAA;AACnE,GACD;AACH;AAKO,MAAM,iBAAiB,kBAAmB,CAAA,OAAA;AAAA,EAC/C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,0C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AA;AAAA;AACT;AACJ,GACD;AACH;;;;"}
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\n/**\n * @public\n * @deprecated Use `ResultCheckIcon` from `@backstage-community/plugin-tech-insights-react` instead\n */\nexport const TechInsightsCheckIcon = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsCheckIcon',\n component: {\n lazy: () =>\n import('@backstage-community/plugin-tech-insights-react').then(\n m => m.ResultCheckIcon,\n ),\n },\n }),\n);\n\n/**\n * @public\n * @deprecated Use `ResultLinksMenu` from `@backstage-community/plugin-tech-insights-react` instead\n */\nexport const TechInsightsLinksMenu = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsLinksMenu',\n component: {\n lazy: () =>\n import('@backstage-community/plugin-tech-insights-react').then(\n m => m.ResultLinksMenu,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AAgCO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA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"name": "@backstage-community/plugin-tech-insights",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "tech-insights",
@@ -42,13 +42,13 @@
42
42
  "test": "backstage-cli package test"
43
43
  },
44
44
  "dependencies": {
45
- "@backstage-community/plugin-tech-insights-common": "^0.6.0",
46
- "@backstage-community/plugin-tech-insights-react": "^1.1.1",
47
- "@backstage/catalog-model": "^1.7.3",
48
- "@backstage/core-components": "^0.16.3",
49
- "@backstage/core-plugin-api": "^1.10.3",
45
+ "@backstage-community/plugin-tech-insights-common": "^0.7.0",
46
+ "@backstage-community/plugin-tech-insights-react": "^1.2.0",
47
+ "@backstage/catalog-model": "^1.7.4",
48
+ "@backstage/core-components": "^0.17.2",
49
+ "@backstage/core-plugin-api": "^1.10.7",
50
50
  "@backstage/errors": "^1.2.7",
51
- "@backstage/plugin-catalog-react": "^1.15.1",
51
+ "@backstage/plugin-catalog-react": "^1.18.0",
52
52
  "@backstage/types": "^1.2.1",
53
53
  "@material-table/exporters": "^1.2.19",
54
54
  "@material-ui/core": "^4.12.2",
@@ -58,8 +58,8 @@
58
58
  "react-use": "^17.2.4"
59
59
  },
60
60
  "devDependencies": {
61
- "@backstage/cli": "^0.29.6",
62
- "@backstage/dev-utils": "^1.1.6",
61
+ "@backstage/cli": "^0.32.1",
62
+ "@backstage/dev-utils": "^1.1.10",
63
63
  "@testing-library/dom": "^10.0.0",
64
64
  "@testing-library/jest-dom": "^6.0.0",
65
65
  "@testing-library/react": "^15.0.0",
@@ -75,8 +75,8 @@
75
75
  },
76
76
  "typesVersions": {
77
77
  "*": {
78
- "index": [
79
- "dist/index.d.ts"
78
+ "package.json": [
79
+ "package.json"
80
80
  ]
81
81
  }
82
82
  },