@backstage-community/plugin-sonarqube 0.7.18 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/api/SonarQubeClient.esm.js +113 -0
  3. package/dist/api/SonarQubeClient.esm.js.map +1 -0
  4. package/dist/components/SonarQubeCard/MetricInsights.esm.js +171 -0
  5. package/dist/components/SonarQubeCard/MetricInsights.esm.js.map +1 -0
  6. package/dist/components/SonarQubeCard/Percentage.esm.js +29 -0
  7. package/dist/components/SonarQubeCard/Percentage.esm.js.map +1 -0
  8. package/dist/components/SonarQubeCard/Rating.esm.js +81 -0
  9. package/dist/components/SonarQubeCard/Rating.esm.js.map +1 -0
  10. package/dist/components/SonarQubeCard/RatingCard.esm.js +46 -0
  11. package/dist/components/SonarQubeCard/RatingCard.esm.js.map +1 -0
  12. package/dist/components/SonarQubeCard/SonarQubeCard.esm.js +111 -0
  13. package/dist/components/SonarQubeCard/SonarQubeCard.esm.js.map +1 -0
  14. package/dist/components/SonarQubeCard/Value.esm.js +19 -0
  15. package/dist/components/SonarQubeCard/Value.esm.js.map +1 -0
  16. package/dist/components/SonarQubeCard/index.esm.js +2 -0
  17. package/dist/components/SonarQubeCard/index.esm.js.map +1 -0
  18. package/dist/{esm/index-B-NIU3rT.esm.js → components/SonarQubeContentPage/SonarQubeContentPage.esm.js} +3 -19
  19. package/dist/components/SonarQubeContentPage/SonarQubeContentPage.esm.js.map +1 -0
  20. package/dist/components/SonarQubeContentPage/index.esm.js +2 -0
  21. package/dist/components/SonarQubeContentPage/index.esm.js.map +1 -0
  22. package/dist/components/SonarQubeTable/Columns.esm.js +147 -0
  23. package/dist/components/SonarQubeTable/Columns.esm.js.map +1 -0
  24. package/dist/components/SonarQubeTable/SonarQubeTable.esm.js +38 -0
  25. package/dist/components/SonarQubeTable/SonarQubeTable.esm.js.map +1 -0
  26. package/dist/components/SonarQubeTable/types.esm.js +10 -0
  27. package/dist/components/SonarQubeTable/types.esm.js.map +1 -0
  28. package/dist/components/index.esm.js +15 -0
  29. package/dist/components/index.esm.js.map +1 -0
  30. package/dist/index.d.ts +22 -1
  31. package/dist/index.esm.js +5 -490
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/plugin.esm.js +41 -0
  34. package/dist/plugin.esm.js.map +1 -0
  35. package/package.json +17 -11
  36. package/dist/esm/index-B-NIU3rT.esm.js.map +0 -1
  37. package/dist/esm/index-CwJaLZxM.esm.js +0 -22
  38. package/dist/esm/index-CwJaLZxM.esm.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SonarQubeCard.esm.js","sources":["../../../src/components/SonarQubeCard/SonarQubeCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n sonarQubeApiRef,\n useProjectInfo,\n SONARQUBE_PROJECT_KEY_ANNOTATION,\n} from '@backstage-community/plugin-sonarqube-react';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n EmptyState,\n InfoCard,\n InfoCardVariants,\n Progress,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n BugReportRatingCard,\n CodeSmellsRatingCard,\n CoverageRatingCard,\n DuplicationsRatingCard,\n HotspotsReviewed,\n LastAnalyzedRatingCard,\n QualityBadge,\n VulnerabilitiesRatingCard,\n} from './MetricInsights';\nimport { DuplicationRating } from '../SonarQubeTable/types';\n\nconst useStyles = makeStyles(theme => ({\n header: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n action: {\n margin: 0,\n },\n lastAnalyzed: {\n color: theme.palette.text.secondary,\n },\n}));\n\n/** @public */\nexport const SonarQubeCard = (props: {\n variant?: InfoCardVariants;\n duplicationRatings?: DuplicationRating[];\n missingAnnotationReadMoreUrl?: string;\n}) => {\n const { variant = 'gridItem', missingAnnotationReadMoreUrl } = props;\n const { entity } = useEntity();\n const sonarQubeApi = useApi(sonarQubeApiRef);\n\n const { projectKey: projectTitle, projectInstance } = useProjectInfo(entity);\n\n const { value: summaryFinding, loading } = useAsync(\n async () =>\n sonarQubeApi.getFindingSummary({\n componentKey: projectTitle,\n projectInstance: projectInstance,\n }),\n [sonarQubeApi, projectTitle],\n );\n\n const deepLink =\n !loading && summaryFinding?.metrics\n ? {\n title: 'View more',\n link: summaryFinding.projectUrl,\n }\n : undefined;\n\n const classes = useStyles();\n return (\n <InfoCard\n title=\"Code Quality\"\n deepLink={deepLink}\n variant={variant}\n headerProps={{\n action: !loading && summaryFinding?.metrics && (\n <QualityBadge value={summaryFinding} />\n ),\n classes: {\n root: classes.header,\n action: classes.action,\n },\n }}\n >\n {loading && <Progress />}\n\n {!loading && !projectTitle && (\n <MissingAnnotationEmptyState\n annotation={SONARQUBE_PROJECT_KEY_ANNOTATION}\n readMoreUrl={missingAnnotationReadMoreUrl}\n />\n )}\n\n {!loading && projectTitle && !summaryFinding?.metrics && (\n <EmptyState\n missing=\"info\"\n title=\"No information to display\"\n description={`There is no SonarQube project with key '${projectTitle}'.`}\n />\n )}\n\n {!loading && summaryFinding?.metrics && (\n <>\n <Grid\n item\n container\n direction=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n style={{ height: '100%' }}\n spacing={0}\n >\n <Grid item container justifyContent=\"space-around\">\n <BugReportRatingCard value={summaryFinding} title=\"Bugs\" />\n <VulnerabilitiesRatingCard\n value={summaryFinding}\n title=\"Vulnerabilities\"\n />\n <CodeSmellsRatingCard\n value={summaryFinding}\n title=\"Code Smells\"\n />\n <HotspotsReviewed\n value={summaryFinding}\n title=\"Hotspots Reviewed\"\n />\n <div style={{ width: '100%' }} />\n <CoverageRatingCard value={summaryFinding} title=\"Coverage\" />\n <DuplicationsRatingCard\n value={summaryFinding}\n title=\"Duplications\"\n />\n </Grid>\n <Grid item className={classes.lastAnalyzed}>\n <LastAnalyzedRatingCard value={summaryFinding} />\n </Grid>\n </Grid>\n </>\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAgDA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,GAAG,CAAA;AAAA,GACrC;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,CAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,GAC5B;AACF,CAAE,CAAA,CAAA,CAAA;AAGW,MAAA,aAAA,GAAgB,CAAC,KAIxB,KAAA;AACJ,EAAA,MAAM,EAAE,OAAA,GAAU,UAAY,EAAA,4BAAA,EAAiC,GAAA,KAAA,CAAA;AAC/D,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,YAAA,GAAe,OAAO,eAAe,CAAA,CAAA;AAE3C,EAAA,MAAM,EAAE,UAAY,EAAA,YAAA,EAAc,eAAgB,EAAA,GAAI,eAAe,MAAM,CAAA,CAAA;AAE3E,EAAA,MAAM,EAAE,KAAA,EAAO,cAAgB,EAAA,OAAA,EAAY,GAAA,QAAA;AAAA,IACzC,YACE,aAAa,iBAAkB,CAAA;AAAA,MAC7B,YAAc,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,CAAA,aAAA;AAAA,QAAC,sBAAA;AAAA,QAAA;AAAA,UACC,KAAO,EAAA,cAAA;AAAA,UACP,KAAM,EAAA,cAAA;AAAA,SAAA;AAAA,OAEV,CAAA;AAAA,sBACA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,SAAA,EAAW,OAAQ,CAAA,YAAA,EAAA,kBAC3B,KAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,EAAuB,KAAO,EAAA,cAAA,EAAgB,CACjD,CAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,19 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ import Typography from '@material-ui/core/Typography';
3
+ import React from 'react';
4
+
5
+ const useStyles = makeStyles((theme) => {
6
+ return {
7
+ value: {
8
+ fontSize: "1.5rem",
9
+ fontWeight: theme.typography.fontWeightMedium
10
+ }
11
+ };
12
+ });
13
+ const Value = (props) => {
14
+ const classes = useStyles();
15
+ return /* @__PURE__ */ React.createElement(Typography, { component: "span", className: classes.value }, props.value);
16
+ };
17
+
18
+ export { Value };
19
+ //# sourceMappingURL=Value.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Value.esm.js","sources":["../../../src/components/SonarQubeCard/Value.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => {\n return {\n value: {\n fontSize: '1.5rem',\n fontWeight: theme.typography.fontWeightMedium,\n },\n };\n});\n\nexport const Value = (props: { value?: string }) => {\n const classes = useStyles();\n return (\n <Typography component=\"span\" className={classes.value}>\n {props.value}\n </Typography>\n );\n};\n"],"names":[],"mappings":";;;;AAoBA,MAAM,SAAA,GAAY,WAAW,CAAS,KAAA,KAAA;AACpC,EAAO,OAAA;AAAA,IACL,KAAO,EAAA;AAAA,MACL,QAAU,EAAA,QAAA;AAAA,MACV,UAAA,EAAY,MAAM,UAAW,CAAA,gBAAA;AAAA,KAC/B;AAAA,GACF,CAAA;AACF,CAAC,CAAA,CAAA;AAEY,MAAA,KAAA,GAAQ,CAAC,KAA8B,KAAA;AAClD,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,SAAU,EAAA,MAAA,EAAO,WAAW,OAAQ,CAAA,KAAA,EAAA,EAC7C,MAAM,KACT,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { SonarQubeCard } from './SonarQubeCard.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,29 +1,13 @@
1
1
  import { Content, ContentHeader, SupportButton } from '@backstage/core-components';
2
2
  import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
3
3
  import React from 'react';
4
- import { SonarQubeCard } from '../index.esm.js';
4
+ import { SonarQubeCard } from '../SonarQubeCard/SonarQubeCard.esm.js';
5
5
  import { isSonarQubeAvailable, SONARQUBE_PROJECT_KEY_ANNOTATION } from '@backstage-community/plugin-sonarqube-react';
6
- import 'cross-fetch';
7
- import '@material-ui/core/Chip';
8
- import '@material-ui/core/Grid';
9
- import '@material-ui/core/styles';
10
- import '@material-ui/icons/BugReport';
11
- import '@material-ui/icons/Lock';
12
- import '@material-ui/icons/LockOpen';
13
- import '@material-ui/icons/Security';
14
- import '@material-ui/icons/SentimentVeryDissatisfied';
15
- import '@material-ui/icons/SentimentVerySatisfied';
16
- import 'react-use/esm/useAsync';
17
- import 'rc-progress';
18
- import '@material-ui/core/Avatar';
19
- import '@material-ui/core/Typography';
20
- import '@backstage/core-plugin-api';
21
- import 'luxon';
22
6
 
23
7
  const SonarQubeContentPage = (props) => {
24
8
  const { entity } = useEntity();
25
9
  const { title, supportTitle, missingAnnotationReadMoreUrl } = props;
26
- return isSonarQubeAvailable(entity) ? /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: title != null ? title : "SonarQube Dashboard" }, supportTitle && /* @__PURE__ */ React.createElement(SupportButton, null, supportTitle)), /* @__PURE__ */ React.createElement(
10
+ return isSonarQubeAvailable(entity) ? /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: title ?? "SonarQube Dashboard" }, supportTitle && /* @__PURE__ */ React.createElement(SupportButton, null, supportTitle)), /* @__PURE__ */ React.createElement(
27
11
  SonarQubeCard,
28
12
  {
29
13
  missingAnnotationReadMoreUrl
@@ -38,4 +22,4 @@ const SonarQubeContentPage = (props) => {
38
22
  };
39
23
 
40
24
  export { SonarQubeContentPage };
41
- //# sourceMappingURL=index-B-NIU3rT.esm.js.map
25
+ //# sourceMappingURL=SonarQubeContentPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SonarQubeContentPage.esm.js","sources":["../../../src/components/SonarQubeContentPage/SonarQubeContentPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {\n Content,\n ContentHeader,\n SupportButton,\n} from '@backstage/core-components';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { SonarQubeCard } from '../SonarQubeCard';\nimport {\n isSonarQubeAvailable,\n SONARQUBE_PROJECT_KEY_ANNOTATION,\n} from '@backstage-community/plugin-sonarqube-react';\n\n/** @public */\nexport type SonarQubeContentPageProps = {\n title?: string;\n supportTitle?: string;\n missingAnnotationReadMoreUrl?: string;\n};\n\nexport const SonarQubeContentPage = (props: SonarQubeContentPageProps) => {\n const { entity } = useEntity();\n const { title, supportTitle, missingAnnotationReadMoreUrl } = props;\n\n return isSonarQubeAvailable(entity) ? (\n <Content>\n <ContentHeader title={title ?? 'SonarQube Dashboard'}>\n {supportTitle && <SupportButton>{supportTitle}</SupportButton>}\n </ContentHeader>\n <SonarQubeCard\n missingAnnotationReadMoreUrl={missingAnnotationReadMoreUrl}\n />\n </Content>\n ) : (\n <MissingAnnotationEmptyState\n annotation={SONARQUBE_PROJECT_KEY_ANNOTATION}\n readMoreUrl={missingAnnotationReadMoreUrl}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAuCa,MAAA,oBAAA,GAAuB,CAAC,KAAqC,KAAA;AACxE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,YAAc,EAAA,4BAAA,EAAiC,GAAA,KAAA,CAAA;AAE9D,EAAA,OAAO,oBAAqB,CAAA,MAAM,CAChC,mBAAA,KAAA,CAAA,aAAA,CAAC,+BACE,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,KAAO,EAAA,KAAA,IAAS,yBAC5B,YAAgB,oBAAA,KAAA,CAAA,aAAA,CAAC,aAAe,EAAA,IAAA,EAAA,YAAa,CAChD,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,4BAAA;AAAA,KAAA;AAAA,GAEJ,CAEA,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,MACZ,WAAa,EAAA,4BAAA;AAAA,KAAA;AAAA,GACf,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { SonarQubeContentPage } from './SonarQubeContentPage.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,147 @@
1
+ import React from 'react';
2
+ import { Link } from '@backstage/core-components';
3
+ import { EntityPeekAheadPopover, EntityRefLink } from '@backstage/plugin-catalog-react';
4
+ import IconButton from '@material-ui/core/IconButton';
5
+ import LinkIcon from '@material-ui/icons/Link';
6
+ import { QualityBadge, LastAnalyzedRatingCard, NoSonarQubeCard, BugReportRatingCard, VulnerabilitiesRatingCard, CodeSmellsRatingCard, HotspotsReviewed, CoverageRatingCard, DuplicationsRatingCard } from '../SonarQubeCard/MetricInsights.esm.js';
7
+
8
+ const EntityLink = ({
9
+ entityRef,
10
+ title,
11
+ url,
12
+ kind,
13
+ namespace
14
+ }) => {
15
+ return /* @__PURE__ */ React.createElement(
16
+ "span",
17
+ {
18
+ style: {
19
+ display: "flex",
20
+ alignItems: "center",
21
+ padding: "0",
22
+ margin: "0"
23
+ }
24
+ },
25
+ /* @__PURE__ */ React.createElement(EntityPeekAheadPopover, { entityRef }, /* @__PURE__ */ React.createElement(
26
+ EntityRefLink,
27
+ {
28
+ entityRef: {
29
+ kind,
30
+ namespace,
31
+ name: entityRef.split("/")[1]
32
+ }
33
+ }
34
+ )),
35
+ /* @__PURE__ */ React.createElement(Link, { to: url, title, target: "_blank" }, /* @__PURE__ */ React.createElement(
36
+ IconButton,
37
+ {
38
+ "aria-label": "link",
39
+ color: "inherit",
40
+ style: {
41
+ display: "flex",
42
+ alignItems: "center",
43
+ padding: "0",
44
+ paddingLeft: "10px",
45
+ margin: "0"
46
+ }
47
+ },
48
+ /* @__PURE__ */ React.createElement(LinkIcon, null)
49
+ ))
50
+ );
51
+ };
52
+ const getColumns = () => {
53
+ return [
54
+ {
55
+ title: "Component",
56
+ field: "resolved.name",
57
+ type: "string",
58
+ highlight: true,
59
+ align: "center",
60
+ width: "25%",
61
+ cellStyle: {
62
+ wordBreak: "inherit",
63
+ padding: "10px 20px"
64
+ },
65
+ render: ({ resolved }) => {
66
+ if (!resolved?.name) {
67
+ return null;
68
+ }
69
+ const scoreCardComponentUrl = `/catalog/default/component/${resolved?.name}/${resolved?.isSonarQubeAnnotationEnabled ? "scorecard" : ""}`;
70
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
71
+ EntityLink,
72
+ {
73
+ entityRef: `component:default/${resolved?.name}`,
74
+ title: "View Component details",
75
+ url: scoreCardComponentUrl,
76
+ kind: "component",
77
+ namespace: "default"
78
+ }
79
+ ));
80
+ }
81
+ },
82
+ {
83
+ title: "Quality Gate",
84
+ field: "resolved?.findings?.metrics.alert_status",
85
+ type: "string",
86
+ align: "center",
87
+ sorting: false,
88
+ width: "35%",
89
+ render: ({ resolved, id }) => {
90
+ if (resolved?.findings?.metrics) {
91
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(QualityBadge, { value: resolved?.findings }), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement(LastAnalyzedRatingCard, { value: resolved?.findings }));
92
+ }
93
+ return /* @__PURE__ */ React.createElement(NoSonarQubeCard, { value: resolved, sonarQubeComponentKey: id });
94
+ }
95
+ },
96
+ {
97
+ title: "Bugs",
98
+ field: "resolved.findings.metrics.bugs",
99
+ align: "center",
100
+ type: "numeric",
101
+ width: "5%",
102
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(BugReportRatingCard, { value: resolved?.findings })
103
+ },
104
+ {
105
+ title: "Vulnerabilities",
106
+ field: "resolved.findings.metrics.vulnerabilities",
107
+ align: "center",
108
+ width: "5%",
109
+ type: "numeric",
110
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(VulnerabilitiesRatingCard, { value: resolved?.findings })
111
+ },
112
+ {
113
+ title: "Code Smells",
114
+ field: "resolved.findings.metrics.code_smells",
115
+ align: "center",
116
+ type: "numeric",
117
+ width: "5%",
118
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(CodeSmellsRatingCard, { value: resolved?.findings })
119
+ },
120
+ {
121
+ title: "Hotspots Reviewed",
122
+ field: "resolved.findings.metrics.security_hotspots_reviewed",
123
+ align: "center",
124
+ type: "numeric",
125
+ width: "5%",
126
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(HotspotsReviewed, { value: resolved?.findings })
127
+ },
128
+ {
129
+ title: "Coverage",
130
+ field: "resolved.findings.metrics.coverage",
131
+ align: "center",
132
+ type: "numeric",
133
+ width: "10%",
134
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(CoverageRatingCard, { value: resolved?.findings })
135
+ },
136
+ {
137
+ title: "Duplications",
138
+ field: "resolved.findings.metrics.duplicated_lines_density",
139
+ type: "numeric",
140
+ width: "10%",
141
+ render: ({ resolved }) => resolved?.findings?.metrics && /* @__PURE__ */ React.createElement(DuplicationsRatingCard, { value: resolved?.findings })
142
+ }
143
+ ];
144
+ };
145
+
146
+ export { getColumns };
147
+ //# sourceMappingURL=Columns.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Columns.esm.js","sources":["../../../src/components/SonarQubeTable/Columns.tsx"],"sourcesContent":["import React from 'react';\nimport { Link, TableColumn } from '@backstage/core-components';\nimport {\n EntityPeekAheadPopover,\n EntityRefLink,\n} from '@backstage/plugin-catalog-react';\nimport IconButton from '@material-ui/core/IconButton';\nimport LinkIcon from '@material-ui/icons/Link';\nimport {\n BugReportRatingCard,\n CodeSmellsRatingCard,\n CoverageRatingCard,\n DuplicationsRatingCard,\n HotspotsReviewed,\n LastAnalyzedRatingCard,\n NoSonarQubeCard,\n QualityBadge,\n VulnerabilitiesRatingCard,\n} from '../SonarQubeCard/MetricInsights';\nimport { EntityLinkProps, SonarQubeTableRow } from './types';\n\nconst EntityLink = ({\n entityRef,\n title,\n url,\n kind,\n namespace,\n}: EntityLinkProps) => {\n return (\n <span\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: '0',\n margin: '0',\n }}\n >\n <EntityPeekAheadPopover entityRef={entityRef}>\n <EntityRefLink\n entityRef={{\n kind: kind,\n namespace: namespace,\n name: entityRef.split('/')[1],\n }}\n />\n </EntityPeekAheadPopover>\n <Link to={url} title={title} target=\"_blank\">\n <IconButton\n aria-label=\"link\"\n color=\"inherit\"\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: '0',\n paddingLeft: '10px',\n margin: '0',\n }}\n >\n <LinkIcon />\n </IconButton>\n </Link>\n </span>\n );\n};\n\nexport const getColumns = (): TableColumn<SonarQubeTableRow>[] => {\n return [\n {\n title: 'Component',\n field: 'resolved.name',\n type: 'string',\n highlight: true,\n align: 'center',\n width: '25%',\n cellStyle: {\n wordBreak: 'inherit',\n padding: '10px 20px',\n },\n render: ({ resolved }) => {\n if (!resolved?.name) {\n return null;\n }\n const scoreCardComponentUrl = `/catalog/default/component/${\n resolved?.name\n }/${resolved?.isSonarQubeAnnotationEnabled ? 'scorecard' : ''}`;\n return (\n <>\n <EntityLink\n entityRef={`component:default/${resolved?.name}`}\n title=\"View Component details\"\n url={scoreCardComponentUrl}\n kind=\"component\"\n namespace=\"default\"\n />\n </>\n );\n },\n },\n {\n title: 'Quality Gate',\n field: 'resolved?.findings?.metrics.alert_status',\n type: 'string',\n align: 'center',\n sorting: false,\n width: '35%',\n render: ({ resolved, id }) => {\n if (resolved?.findings?.metrics) {\n return (\n <div>\n <QualityBadge value={resolved?.findings} />\n <br />\n <LastAnalyzedRatingCard value={resolved?.findings} />\n </div>\n );\n }\n return <NoSonarQubeCard value={resolved} sonarQubeComponentKey={id} />;\n },\n },\n {\n title: 'Bugs',\n field: 'resolved.findings.metrics.bugs',\n align: 'center',\n type: 'numeric',\n width: '5%',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <BugReportRatingCard value={resolved?.findings} />\n ),\n },\n {\n title: 'Vulnerabilities',\n field: 'resolved.findings.metrics.vulnerabilities',\n align: 'center',\n width: '5%',\n type: 'numeric',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <VulnerabilitiesRatingCard value={resolved?.findings} />\n ),\n },\n {\n title: 'Code Smells',\n field: 'resolved.findings.metrics.code_smells',\n align: 'center',\n type: 'numeric',\n width: '5%',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <CodeSmellsRatingCard value={resolved?.findings} />\n ),\n },\n {\n title: 'Hotspots Reviewed',\n field: 'resolved.findings.metrics.security_hotspots_reviewed',\n align: 'center',\n type: 'numeric',\n width: '5%',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <HotspotsReviewed value={resolved?.findings} />\n ),\n },\n {\n title: 'Coverage',\n field: 'resolved.findings.metrics.coverage',\n align: 'center',\n type: 'numeric',\n width: '10%',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <CoverageRatingCard value={resolved?.findings} />\n ),\n },\n {\n title: 'Duplications',\n field: 'resolved.findings.metrics.duplicated_lines_density',\n type: 'numeric',\n width: '10%',\n render: ({ resolved }) =>\n resolved?.findings?.metrics && (\n <DuplicationsRatingCard value={resolved?.findings} />\n ),\n },\n ];\n};\n"],"names":[],"mappings":";;;;;;;AAqBA,MAAM,aAAa,CAAC;AAAA,EAClB,SAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AACF,CAAuB,KAAA;AACrB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAA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A,mBAAA;AAAA,MACP,KAAO,EAAA,sDAAA;AAAA,MACP,KAAO,EAAA,QAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,IAAA;AAAA,MACP,MAAQ,EAAA,CAAC,EAAE,QAAA,EACT,KAAA,QAAA,EAAU,QAAU,EAAA,OAAA,oBACjB,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,KAAO,EAAA,QAAA,EAAU,QAAU,EAAA,CAAA;AAAA,KAEnD;AAAA,IACA;AAAA,MACE,KAAO,EAAA,UAAA;AAAA,MACP,KAAO,EAAA,oCAAA;AAAA,MACP,KAAO,EAAA,QAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,KAAA;AAAA,MACP,MAAQ,EAAA,CAAC,EAAE,QAAA,EACT,KAAA,QAAA,EAAU,QAAU,EAAA,OAAA,oBACjB,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EAAmB,KAAO,EAAA,QAAA,EAAU,QAAU,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,KAAO,EAAA,cAAA;AAAA,MACP,KAAO,EAAA,oDAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,KAAA;AAAA,MACP,MAAQ,EAAA,CAAC,EAAE,QAAA,EACT,KAAA,QAAA,EAAU,QAAU,EAAA,OAAA,oBACjB,KAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,EAAuB,KAAO,EAAA,QAAA,EAAU,QAAU,EAAA,CAAA;AAAA,KAEzD;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import Box from '@material-ui/core/Box';
3
+ import { ErrorPanel, Table } from '@backstage/core-components';
4
+ import { getColumns } from './Columns.esm.js';
5
+
6
+ const SonarQubeTable = ({
7
+ tableContent,
8
+ title,
9
+ options,
10
+ emptyContent,
11
+ localization
12
+ }) => {
13
+ if (!tableContent) {
14
+ return /* @__PURE__ */ React.createElement(ErrorPanel, { error: Error("Table could not be rendered") });
15
+ }
16
+ return /* @__PURE__ */ React.createElement(
17
+ Box,
18
+ {
19
+ sx: {
20
+ overflow: "auto"
21
+ }
22
+ },
23
+ /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
24
+ Table,
25
+ {
26
+ title: /* @__PURE__ */ React.createElement("div", null, `(${tableContent.length}) ${title}`),
27
+ options,
28
+ data: tableContent || [],
29
+ columns: getColumns(),
30
+ emptyContent,
31
+ localization
32
+ }
33
+ ))
34
+ );
35
+ };
36
+
37
+ export { SonarQubeTable };
38
+ //# sourceMappingURL=SonarQubeTable.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SonarQubeTable.esm.js","sources":["../../../src/components/SonarQubeTable/SonarQubeTable.tsx"],"sourcesContent":["import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport { ErrorPanel, Table } from '@backstage/core-components';\nimport { getColumns } from './Columns';\n\n/**\n * @public\n */\nexport type SonarQubeTableProps = {\n tableContent: any[] | undefined;\n title?: string;\n options?: any | undefined;\n emptyContent?: React.ReactNode;\n localization?: any;\n};\n/**\n * @public\n */\nexport const SonarQubeTable = ({\n tableContent,\n title,\n options,\n emptyContent,\n localization,\n}: SonarQubeTableProps) => {\n if (!tableContent) {\n return <ErrorPanel error={Error('Table could not be rendered')} />;\n }\n return (\n <Box\n sx={{\n overflow: 'auto',\n }}\n >\n <div>\n <Table\n title={<div>{`(${tableContent.length}) ${title}`}</div>}\n options={options}\n data={tableContent || []}\n columns={getColumns()}\n emptyContent={emptyContent}\n localization={localization}\n />\n </div>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;AAkBO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AACF,CAA2B,KAAA;AACzB,EAAA,IAAI,CAAC,YAAc,EAAA;AACjB,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,KAAO,EAAA,KAAA,CAAM,6BAA6B,CAAG,EAAA,CAAA,CAAA;AAAA,GAClE;AACA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,KAAA;AAAA,wCAEC,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,KAAA,sCAAQ,KAAK,EAAA,IAAA,EAAA,CAAA,CAAA,EAAI,aAAa,MAAM,CAAA,EAAA,EAAK,KAAK,CAAG,CAAA,CAAA;AAAA,QACjD,OAAA;AAAA,QACA,IAAA,EAAM,gBAAgB,EAAC;AAAA,QACvB,SAAS,UAAW,EAAA;AAAA,QACpB,YAAA;AAAA,QACA,YAAA;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,10 @@
1
+ const defaultDuplicationRatings = [
2
+ { greaterThan: 0, rating: "1.0" },
3
+ { greaterThan: 3, rating: "2.0" },
4
+ { greaterThan: 5, rating: "3.0" },
5
+ { greaterThan: 10, rating: "4.0" },
6
+ { greaterThan: 20, rating: "5.0" }
7
+ ];
8
+
9
+ export { defaultDuplicationRatings };
10
+ //# sourceMappingURL=types.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.esm.js","sources":["../../../src/components/SonarQubeTable/types.ts"],"sourcesContent":["import { FindingSummary } from '@backstage-community/plugin-sonarqube-react';\n\nexport interface SonarQubeTableRow {\n resolved: {\n name: string;\n isSonarQubeAnnotationEnabled?: boolean;\n findings?: FindingSummary;\n };\n id: string;\n}\n\nexport interface EntityLinkProps {\n entityRef: string;\n title: string;\n url: string;\n kind: string;\n namespace: string;\n}\n\n/** @public */\nexport type DuplicationRating = {\n greaterThan: number;\n rating: '1.0' | '2.0' | '3.0' | '4.0' | '5.0';\n};\n\nexport const defaultDuplicationRatings: DuplicationRating[] = [\n { greaterThan: 0, rating: '1.0' },\n { greaterThan: 3, rating: '2.0' },\n { greaterThan: 5, rating: '3.0' },\n { greaterThan: 10, rating: '4.0' },\n { greaterThan: 20, rating: '5.0' },\n];\n"],"names":[],"mappings":"AAyBO,MAAM,yBAAiD,GAAA;AAAA,EAC5D,EAAE,WAAA,EAAa,CAAG,EAAA,MAAA,EAAQ,KAAM,EAAA;AAAA,EAChC,EAAE,WAAA,EAAa,CAAG,EAAA,MAAA,EAAQ,KAAM,EAAA;AAAA,EAChC,EAAE,WAAA,EAAa,CAAG,EAAA,MAAA,EAAQ,KAAM,EAAA;AAAA,EAChC,EAAE,WAAA,EAAa,EAAI,EAAA,MAAA,EAAQ,KAAM,EAAA;AAAA,EACjC,EAAE,WAAA,EAAa,EAAI,EAAA,MAAA,EAAQ,KAAM,EAAA;AACnC;;;;"}
@@ -0,0 +1,15 @@
1
+ import { isSonarQubeAvailable as isSonarQubeAvailable$1, SONARQUBE_PROJECT_KEY_ANNOTATION as SONARQUBE_PROJECT_KEY_ANNOTATION$1 } from '@backstage-community/plugin-sonarqube-react';
2
+ export { SonarQubeCard } from './SonarQubeCard/SonarQubeCard.esm.js';
3
+ import 'react';
4
+ import '@material-ui/core/Box';
5
+ import '@backstage/core-components';
6
+ import '@backstage/plugin-catalog-react';
7
+ import '@material-ui/core/IconButton';
8
+ import '@material-ui/icons/Link';
9
+ import './SonarQubeCard/MetricInsights.esm.js';
10
+
11
+ const isSonarQubeAvailable = isSonarQubeAvailable$1;
12
+ const SONARQUBE_PROJECT_KEY_ANNOTATION = SONARQUBE_PROJECT_KEY_ANNOTATION$1;
13
+
14
+ export { SONARQUBE_PROJECT_KEY_ANNOTATION, isSonarQubeAvailable };
15
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/components/index.ts"],"sourcesContent":["/*\n * Copyright 2020 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 {\n isSonarQubeAvailable as NonDeprecatedIsSonarQubeAvailable,\n SONARQUBE_PROJECT_KEY_ANNOTATION as NON_DEPRECATED_SONARQUBE_PROJECT_KEY_ANNOTATION,\n} from '@backstage-community/plugin-sonarqube-react';\n\nexport { SonarQubeCard } from './SonarQubeCard';\nexport type { DuplicationRating } from './SonarQubeCard';\nexport type { SonarQubeContentPageProps } from './SonarQubeContentPage';\nexport * from './SonarQubeTable';\n/**\n * @public\n *\n * @deprecated use the same type from `@backstage-community/plugin-sonarqube-react` instead\n */\nexport const isSonarQubeAvailable = NonDeprecatedIsSonarQubeAvailable;\n\n/**\n * @public\n *\n * @deprecated use the same type from `@backstage-community/plugin-sonarqube-react` instead\n */\nexport const SONARQUBE_PROJECT_KEY_ANNOTATION =\n NON_DEPRECATED_SONARQUBE_PROJECT_KEY_ANNOTATION;\n"],"names":["NonDeprecatedIsSonarQubeAvailable","NON_DEPRECATED_SONARQUBE_PROJECT_KEY_ANNOTATION"],"mappings":";;;;;;;;;;AA8BO,MAAM,oBAAuB,GAAAA,uBAAA;AAO7B,MAAM,gCACX,GAAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -21,6 +21,11 @@ declare class SonarQubeClient implements SonarQubeApi {
21
21
  componentKey?: string;
22
22
  projectInstance?: string;
23
23
  }): Promise<FindingSummary | undefined>;
24
+ settledResponseOf(responses: PromiseSettledResult<any>[]): Array<any>;
25
+ getFindingSummaries(components: Array<{
26
+ projectInstance: string | undefined;
27
+ componentKey: string;
28
+ }>): Promise<Map<string, FindingSummary>>;
24
29
  }
25
30
 
26
31
  /** @public */
@@ -28,6 +33,7 @@ type DuplicationRating = {
28
33
  greaterThan: number;
29
34
  rating: '1.0' | '2.0' | '3.0' | '4.0' | '5.0';
30
35
  };
36
+
31
37
  /** @public */
32
38
  declare const SonarQubeCard: (props: {
33
39
  variant?: InfoCardVariants;
@@ -42,6 +48,21 @@ type SonarQubeContentPageProps = {
42
48
  missingAnnotationReadMoreUrl?: string;
43
49
  };
44
50
 
51
+ /**
52
+ * @public
53
+ */
54
+ type SonarQubeTableProps = {
55
+ tableContent: any[] | undefined;
56
+ title?: string;
57
+ options?: any | undefined;
58
+ emptyContent?: React__default.ReactNode;
59
+ localization?: any;
60
+ };
61
+ /**
62
+ * @public
63
+ */
64
+ declare const SonarQubeTable: ({ tableContent, title, options, emptyContent, localization, }: SonarQubeTableProps) => React__default.JSX.Element;
65
+
45
66
  /**
46
67
  * @public
47
68
  *
@@ -66,4 +87,4 @@ declare const EntitySonarQubeCard: (props: {
66
87
  /** @public */
67
88
  declare const EntitySonarQubeContentPage: (props: SonarQubeContentPageProps) => React.JSX.Element;
68
89
 
69
- export { type DuplicationRating, EntitySonarQubeCard, EntitySonarQubeContentPage, SONARQUBE_PROJECT_KEY_ANNOTATION, SonarQubeCard, SonarQubeClient, type SonarQubeContentPageProps, isSonarQubeAvailable, sonarQubePlugin };
90
+ export { type DuplicationRating, EntitySonarQubeCard, EntitySonarQubeContentPage, SONARQUBE_PROJECT_KEY_ANNOTATION, SonarQubeCard, SonarQubeClient, type SonarQubeContentPageProps, SonarQubeTable, type SonarQubeTableProps, isSonarQubeAvailable, sonarQubePlugin };