@backstage-community/plugin-sonarqube 0.7.17 → 0.7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +22 -0
- package/dist/esm/{index-D3iMIkzq.esm.js → index-B-NIU3rT.esm.js} +10 -4
- package/dist/esm/index-B-NIU3rT.esm.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +5 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/index-D3iMIkzq.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @backstage-community/plugin-sonarqube
|
|
2
2
|
|
|
3
|
+
## 0.7.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c9ceb6e: Added optional `missingAnnotationReadMoreUrl` prop to `SonarQubeContentPage` and `SonarQubeCard` to allow configurable links to documentation.
|
|
8
|
+
- 842559f: Updated dependency `rc-progress` to `4.0.0`.
|
|
9
|
+
|
|
3
10
|
## 0.7.17
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -33,6 +33,28 @@ yarn --cwd packages/app add @backstage-community/plugin-sonarqube
|
|
|
33
33
|
);
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
The "Read more" link that shows in the MissingAnnotationEmptyState is also configurable.
|
|
37
|
+
|
|
38
|
+
```diff
|
|
39
|
+
// packages/app/src/components/catalog/EntityPage.tsx
|
|
40
|
+
+ import { EntitySonarQubeCard } from '@backstage-community/plugin-sonarqube';
|
|
41
|
+
|
|
42
|
+
+ const MISSING_ANNOTATION_READ_MORE_URL = 'https://backstage.io/docs/features/software-catalog/descriptor';
|
|
43
|
+
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
const overviewContent = (
|
|
47
|
+
<Grid container spacing={3} alignItems="stretch">
|
|
48
|
+
<Grid item md={6}>
|
|
49
|
+
<EntityAboutCard variant="gridItem" />
|
|
50
|
+
</Grid>
|
|
51
|
+
+ <Grid item md={6}>
|
|
52
|
+
+ <EntitySonarQubeCard variant="gridItem" readMoreUrl={MISSING_ANNOTATION_READ_MORE_URL} />
|
|
53
|
+
+ </Grid>
|
|
54
|
+
</Grid>
|
|
55
|
+
);
|
|
56
|
+
```
|
|
57
|
+
|
|
36
58
|
3. Run the following commands in the root folder of the project to install and compile the changes.
|
|
37
59
|
|
|
38
60
|
```yaml
|
|
@@ -22,14 +22,20 @@ import 'luxon';
|
|
|
22
22
|
|
|
23
23
|
const SonarQubeContentPage = (props) => {
|
|
24
24
|
const { entity } = useEntity();
|
|
25
|
-
const { title, supportTitle } = 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(
|
|
25
|
+
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(
|
|
27
|
+
SonarQubeCard,
|
|
28
|
+
{
|
|
29
|
+
missingAnnotationReadMoreUrl
|
|
30
|
+
}
|
|
31
|
+
)) : /* @__PURE__ */ React.createElement(
|
|
27
32
|
MissingAnnotationEmptyState,
|
|
28
33
|
{
|
|
29
|
-
annotation: SONARQUBE_PROJECT_KEY_ANNOTATION
|
|
34
|
+
annotation: SONARQUBE_PROJECT_KEY_ANNOTATION,
|
|
35
|
+
readMoreUrl: missingAnnotationReadMoreUrl
|
|
30
36
|
}
|
|
31
37
|
);
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
export { SonarQubeContentPage };
|
|
35
|
-
//# sourceMappingURL=index-
|
|
41
|
+
//# sourceMappingURL=index-B-NIU3rT.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B-NIU3rT.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,IAAA,IAAA,GAAA,KAAA,GAAS,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;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,12 +32,14 @@ type DuplicationRating = {
|
|
|
32
32
|
declare const SonarQubeCard: (props: {
|
|
33
33
|
variant?: InfoCardVariants;
|
|
34
34
|
duplicationRatings?: DuplicationRating[];
|
|
35
|
+
missingAnnotationReadMoreUrl?: string;
|
|
35
36
|
}) => React__default.JSX.Element;
|
|
36
37
|
|
|
37
38
|
/** @public */
|
|
38
39
|
type SonarQubeContentPageProps = {
|
|
39
40
|
title?: string;
|
|
40
41
|
supportTitle?: string;
|
|
42
|
+
missingAnnotationReadMoreUrl?: string;
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
/**
|
|
@@ -59,6 +61,7 @@ declare const sonarQubePlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}
|
|
|
59
61
|
declare const EntitySonarQubeCard: (props: {
|
|
60
62
|
variant?: _backstage_core_components.InfoCardVariants | undefined;
|
|
61
63
|
duplicationRatings?: DuplicationRating[] | undefined;
|
|
64
|
+
missingAnnotationReadMoreUrl?: string | undefined;
|
|
62
65
|
}) => React.JSX.Element;
|
|
63
66
|
/** @public */
|
|
64
67
|
declare const EntitySonarQubeContentPage: (props: SonarQubeContentPageProps) => React.JSX.Element;
|
package/dist/index.esm.js
CHANGED
|
@@ -294,7 +294,8 @@ const defaultDuplicationRatings = [
|
|
|
294
294
|
const SonarQubeCard = (props) => {
|
|
295
295
|
const {
|
|
296
296
|
variant = "gridItem",
|
|
297
|
-
duplicationRatings = defaultDuplicationRatings
|
|
297
|
+
duplicationRatings = defaultDuplicationRatings,
|
|
298
|
+
missingAnnotationReadMoreUrl
|
|
298
299
|
} = props;
|
|
299
300
|
const { entity } = useEntity();
|
|
300
301
|
const sonarQubeApi = useApi(sonarQubeApiRef);
|
|
@@ -355,7 +356,8 @@ const SonarQubeCard = (props) => {
|
|
|
355
356
|
!loading && !projectTitle && /* @__PURE__ */ React.createElement(
|
|
356
357
|
MissingAnnotationEmptyState,
|
|
357
358
|
{
|
|
358
|
-
annotation: SONARQUBE_PROJECT_KEY_ANNOTATION$1
|
|
359
|
+
annotation: SONARQUBE_PROJECT_KEY_ANNOTATION$1,
|
|
360
|
+
readMoreUrl: missingAnnotationReadMoreUrl
|
|
359
361
|
}
|
|
360
362
|
),
|
|
361
363
|
!loading && projectTitle && !value && /* @__PURE__ */ React.createElement(
|
|
@@ -478,7 +480,7 @@ const EntitySonarQubeContentPage = sonarQubePlugin.provide(
|
|
|
478
480
|
createComponentExtension({
|
|
479
481
|
name: "EntitySonarQubeContentPage",
|
|
480
482
|
component: {
|
|
481
|
-
lazy: () => import('./esm/index-
|
|
483
|
+
lazy: () => import('./esm/index-B-NIU3rT.esm.js').then(
|
|
482
484
|
(m) => m.SonarQubeContentPage
|
|
483
485
|
)
|
|
484
486
|
}
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/api/SonarQubeClient.ts","../src/components/SonarQubeCard/Percentage.tsx","../src/components/SonarQubeCard/Rating.tsx","../src/components/SonarQubeCard/RatingCard.tsx","../src/components/SonarQubeCard/Value.tsx","../src/components/SonarQubeCard/SonarQubeCard.tsx","../src/components/index.ts","../src/plugin.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 fetch from 'cross-fetch';\nimport {\n FindingSummary,\n Metrics,\n SonarQubeApi,\n} from '@backstage-community/plugin-sonarqube-react';\nimport { InstanceUrlWrapper, FindingsWrapper } from './types';\nimport { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport class SonarQubeClient implements SonarQubeApi {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const { token: idToken } = await this.identityApi.getCredentials();\n\n const apiUrl = `${await this.discoveryApi.getBaseUrl('sonarqube')}`;\n const response = await fetch(\n `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n ...(idToken && { Authorization: `Bearer ${idToken}` }),\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n return undefined;\n }\n\n async getFindingSummary({\n componentKey,\n projectInstance,\n }: {\n componentKey?: string;\n projectInstance?: string;\n } = {}): Promise<FindingSummary | undefined> {\n if (!componentKey) {\n return undefined;\n }\n\n const instanceKey = projectInstance || '';\n\n const metrics: Metrics = {\n alert_status: undefined,\n bugs: undefined,\n reliability_rating: undefined,\n vulnerabilities: undefined,\n security_rating: undefined,\n security_hotspots_reviewed: undefined,\n security_review_rating: undefined,\n code_smells: undefined,\n sqale_rating: undefined,\n coverage: undefined,\n duplicated_lines_density: undefined,\n };\n\n const baseUrlWrapper = await this.callApi<InstanceUrlWrapper>(\n 'instanceUrl',\n {\n instanceKey,\n },\n );\n let baseUrl = baseUrlWrapper?.instanceUrl;\n if (!baseUrl) {\n return undefined;\n }\n // ensure trailing slash for later on\n if (!baseUrl.endsWith('/')) {\n baseUrl += '/';\n }\n\n const findings = await this.callApi<FindingsWrapper>('findings', {\n componentKey,\n instanceKey,\n });\n if (!findings) {\n return undefined;\n }\n\n findings.measures.forEach(m => {\n metrics[m.metric] = m.value;\n });\n\n return {\n lastAnalysis: findings.analysisDate,\n metrics,\n projectUrl: `${baseUrl}dashboard?id=${encodeURIComponent(componentKey)}`,\n getIssuesUrl: identifier =>\n `${baseUrl}project/issues?id=${encodeURIComponent(\n componentKey,\n )}&types=${identifier.toLocaleUpperCase('en-US')}&resolved=false`,\n getComponentMeasuresUrl: identifier =>\n `${baseUrl}component_measures?id=${encodeURIComponent(\n componentKey,\n )}&metric=${identifier.toLocaleLowerCase(\n 'en-US',\n )}&resolved=false&view=list`,\n getSecurityHotspotsUrl: () =>\n `${baseUrl}${\n baseUrl === 'https://sonarcloud.io/' ? 'project/' : ''\n }security_hotspots?id=${encodeURIComponent(componentKey)}`,\n };\n }\n}\n","/*\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 { useTheme } from '@material-ui/core/styles';\nimport { Circle } from 'rc-progress';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n height: theme.spacing(3),\n width: theme.spacing(3),\n },\n}));\n\nexport const Percentage = ({ value }: { value?: string }) => {\n const classes = useStyles();\n const theme = useTheme();\n\n return (\n <Circle\n strokeLinecap=\"butt\"\n percent={+(value || 0)}\n strokeWidth={16}\n strokeColor={theme.palette.status.ok}\n trailColor={theme.palette.status.error}\n trailWidth={16}\n className={classes.root}\n />\n );\n};\n","/*\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 Avatar from '@material-ui/core/Avatar';\nimport { lighten, makeStyles } from '@material-ui/core/styles';\nimport { CSSProperties } from '@material-ui/styles/withStyles';\nimport React, { useMemo } from 'react';\n\nconst useStyles = makeStyles(theme => {\n const commonCardRating: CSSProperties = {\n height: theme.spacing(3),\n width: theme.spacing(3),\n color: theme.palette.common.white,\n };\n\n return {\n ratingDefault: {\n ...commonCardRating,\n background: theme.palette.status.aborted,\n },\n ratingA: {\n ...commonCardRating,\n background: theme.palette.status.ok,\n },\n ratingB: {\n ...commonCardRating,\n background: lighten(theme.palette.status.ok, 0.5),\n },\n ratingC: {\n ...commonCardRating,\n background: theme.palette.status.pending,\n },\n ratingD: {\n ...commonCardRating,\n background: theme.palette.status.warning,\n },\n ratingE: {\n ...commonCardRating,\n background: theme.palette.error.main,\n },\n };\n});\n\nexport const Rating = ({\n rating,\n hideValue,\n}: {\n rating?: string;\n hideValue?: boolean;\n}) => {\n const classes = useStyles();\n\n const ratingProp = useMemo(() => {\n switch (rating) {\n case '1.0':\n return {\n name: 'A',\n className: classes.ratingA,\n };\n\n case '2.0':\n return {\n name: 'B',\n className: classes.ratingB,\n };\n\n case '3.0':\n return {\n name: 'C',\n className: classes.ratingC,\n };\n\n case '4.0':\n return {\n name: 'D',\n className: classes.ratingD,\n };\n\n case '5.0':\n return {\n name: 'E',\n className: classes.ratingE,\n };\n\n default:\n return {\n name: '',\n className: classes.ratingDefault,\n };\n }\n }, [classes, rating]);\n\n return (\n <Avatar className={ratingProp.className}>\n {!hideValue && ratingProp.name}\n </Avatar>\n );\n};\n","/*\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 { Link } from '@backstage/core-components';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React, { ReactNode } from 'react';\n\nconst useStyles = makeStyles(theme => {\n return {\n root: {\n margin: theme.spacing(1, 0),\n minWidth: '140px',\n },\n upper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n cardTitle: {\n textAlign: 'center',\n },\n wrapIcon: {\n display: 'inline-flex',\n verticalAlign: 'baseline',\n },\n left: {\n display: 'flex',\n },\n right: {\n display: 'flex',\n marginLeft: theme.spacing(0.5),\n },\n };\n});\n\nexport const RatingCard = ({\n leftSlot,\n rightSlot,\n title,\n titleIcon,\n link,\n}: {\n leftSlot: ReactNode;\n rightSlot: ReactNode;\n title: string;\n titleIcon?: ReactNode;\n link: string;\n}) => {\n const classes = useStyles();\n\n return (\n <Link to={link} color=\"inherit\" underline=\"none\">\n <Grid item className={classes.root}>\n <Grid item className={classes.upper}>\n <Grid item className={classes.left}>\n {leftSlot}\n </Grid>\n <Grid item className={classes.right}>\n {rightSlot}\n </Grid>\n </Grid>\n <Grid item className={classes.cardTitle}>\n <Typography variant=\"body1\" className={classes.wrapIcon}>\n {titleIcon} {title}\n </Typography>\n </Grid>\n </Grid>\n </Link>\n );\n};\n","/*\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","/*\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} from '@backstage-community/plugin-sonarqube-react';\nimport { SONARQUBE_PROJECT_KEY_ANNOTATION } from '@backstage-community/plugin-sonarqube-react';\nimport Chip from '@material-ui/core/Chip';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport BugReport from '@material-ui/icons/BugReport';\nimport Lock from '@material-ui/icons/Lock';\nimport LockOpen from '@material-ui/icons/LockOpen';\nimport Security from '@material-ui/icons/Security';\nimport SentimentVeryDissatisfied from '@material-ui/icons/SentimentVeryDissatisfied';\nimport SentimentVerySatisfied from '@material-ui/icons/SentimentVerySatisfied';\nimport React, { useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Percentage } from './Percentage';\nimport { Rating } from './Rating';\nimport { RatingCard } from './RatingCard';\nimport { Value } from './Value';\nimport {\n EmptyState,\n InfoCard,\n InfoCardVariants,\n Progress,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { DateTime } from 'luxon';\n\nconst useStyles = makeStyles(theme => ({\n badgeLabel: {\n color: theme.palette.common.white,\n },\n badgeError: {\n margin: 0,\n backgroundColor: theme.palette.error.main,\n },\n badgeSuccess: {\n margin: 0,\n backgroundColor: theme.palette.success.main,\n },\n badgeUnknown: {\n backgroundColor: theme.palette.grey[500],\n },\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 type DuplicationRating = {\n greaterThan: number;\n rating: '1.0' | '2.0' | '3.0' | '4.0' | '5.0';\n};\n\nconst 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\n/** @public */\nexport const SonarQubeCard = (props: {\n variant?: InfoCardVariants;\n duplicationRatings?: DuplicationRating[];\n}) => {\n const {\n variant = 'gridItem',\n duplicationRatings = defaultDuplicationRatings,\n } = props;\n const { entity } = useEntity();\n const sonarQubeApi = useApi(sonarQubeApiRef);\n\n const { projectKey: projectTitle, projectInstance } = useProjectInfo(entity);\n\n const { value, loading } = useAsync(\n async () =>\n sonarQubeApi.getFindingSummary({\n componentKey: projectTitle,\n projectInstance: projectInstance,\n }),\n [sonarQubeApi, projectTitle],\n );\n\n const deepLink =\n !loading && value\n ? {\n title: 'View more',\n link: value.projectUrl,\n }\n : undefined;\n\n const classes = useStyles();\n let gateLabel = 'Not computed';\n let gateColor = classes.badgeUnknown;\n\n if (value?.metrics.alert_status) {\n const gatePassed = value.metrics.alert_status === 'OK';\n gateLabel = gatePassed ? 'Gate passed' : 'Gate failed';\n gateColor = gatePassed ? classes.badgeSuccess : classes.badgeError;\n }\n\n const qualityBadge = !loading && value && (\n <Chip\n label={gateLabel}\n classes={{ root: gateColor, label: classes.badgeLabel }}\n />\n );\n\n const duplicationRating = useMemo(() => {\n if (loading || !value || !value.metrics.duplicated_lines_density) {\n return '';\n }\n\n let rating = '';\n\n for (const r of duplicationRatings) {\n if (+value.metrics.duplicated_lines_density >= r.greaterThan) {\n rating = r.rating;\n }\n }\n\n return rating;\n }, [loading, value, duplicationRatings]);\n\n return (\n <InfoCard\n title=\"Code Quality\"\n deepLink={deepLink}\n variant={variant}\n headerProps={{\n action: qualityBadge,\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 />\n )}\n\n {!loading && projectTitle && !value && (\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 && value && (\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 <RatingCard\n titleIcon={<BugReport />}\n title=\"Bugs\"\n link={value.getIssuesUrl('BUG')}\n leftSlot={<Value value={value.metrics.bugs} />}\n rightSlot={<Rating rating={value.metrics.reliability_rating} />}\n />\n <RatingCard\n titleIcon={\n value.metrics.vulnerabilities === '0' ? (\n <Lock />\n ) : (\n <LockOpen />\n )\n }\n title=\"Vulnerabilities\"\n link={value.getIssuesUrl('VULNERABILITY')}\n leftSlot={<Value value={value.metrics.vulnerabilities} />}\n rightSlot={<Rating rating={value.metrics.security_rating} />}\n />\n <RatingCard\n titleIcon={\n value.metrics.code_smells === '0' ? (\n <SentimentVerySatisfied />\n ) : (\n <SentimentVeryDissatisfied />\n )\n }\n title=\"Code Smells\"\n link={value.getIssuesUrl('CODE_SMELL')}\n leftSlot={<Value value={value.metrics.code_smells} />}\n rightSlot={<Rating rating={value.metrics.sqale_rating} />}\n />\n {value.metrics.security_review_rating && (\n <RatingCard\n titleIcon={<Security />}\n title=\"Hotspots Reviewed\"\n link={value.getSecurityHotspotsUrl()}\n leftSlot={\n <Value\n value={\n value.metrics.security_hotspots_reviewed\n ? `${value.metrics.security_hotspots_reviewed}%`\n : '—'\n }\n />\n }\n rightSlot={\n <Rating rating={value.metrics.security_review_rating} />\n }\n />\n )}\n <div style={{ width: '100%' }} />\n <RatingCard\n link={value.getComponentMeasuresUrl('COVERAGE')}\n title=\"Coverage\"\n leftSlot={<Percentage value={value.metrics.coverage} />}\n rightSlot={\n <Value\n value={\n value.metrics.coverage !== undefined\n ? `${value.metrics.coverage}%`\n : '—'\n }\n />\n }\n />\n <RatingCard\n title=\"Duplications\"\n link={value.getComponentMeasuresUrl('DUPLICATED_LINES_DENSITY')}\n leftSlot={<Rating rating={duplicationRating} hideValue />}\n rightSlot={\n <Value value={`${value.metrics.duplicated_lines_density}%`} />\n }\n />\n </Grid>\n <Grid item className={classes.lastAnalyzed}>\n Last analyzed on{' '}\n {DateTime.fromISO(value.lastAnalysis).toLocaleString(\n DateTime.DATETIME_MED,\n )}\n </Grid>\n </Grid>\n </>\n )}\n </InfoCard>\n );\n};\n","/*\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';\n\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","/*\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 { SonarQubeClient } from './api';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';\n\n/** @public */\nexport const sonarQubePlugin = createPlugin({\n id: 'sonarqube',\n apis: [\n createApiFactory({\n api: sonarQubeApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, identityApi }) =>\n new SonarQubeClient({\n discoveryApi,\n identityApi,\n }),\n }),\n ],\n});\n\n/** @public */\nexport const EntitySonarQubeCard = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeCard',\n component: {\n lazy: () =>\n import('./components/SonarQubeCard').then(m => m.SonarQubeCard),\n },\n }),\n);\n\n/** @public */\nexport const EntitySonarQubeContentPage = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeContentPage',\n component: {\n lazy: () =>\n import('./components/SonarQubeContentPage').then(\n m => m.SonarQubeContentPage,\n ),\n },\n }),\n);\n"],"names":["useStyles","SONARQUBE_PROJECT_KEY_ANNOTATION","NonDeprecatedIsSonarQubeAvailable","NON_DEPRECATED_SONARQUBE_PROJECT_KEY_ANNOTATION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,eAAwC,CAAA;AAAA,EAInD,YAAY,OAGT,EAAA;AANH,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA;AACA,IAAA,aAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AAME,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,cAAc,OAAQ,CAAA,WAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,MAAc,OACZ,CAAA,IAAA,EACA,KACwB,EAAA;AACxB,IAAA,MAAM,EAAE,KAAO,E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CAAE,CAAA,cAAA;AAAA,QACpC,QAAS,CAAA,YAAA;AAAA,OAEb,CAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ,CAAA;AAEJ;;AC3PO,MAAM,oBAAuB,GAAAC,uBAAA;AAO7B,MAAM,gCACX,GAAAC;;ACXK,MAAM,kBAAkB,YAAa,CAAA;AAAA,EAC1C,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,WAAa,EAAA,cAAA;AAAA,OACf;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,WAAY,EAAA,KACpC,IAAI,eAAgB,CAAA;AAAA,QAClB,YAAA;AAAA,QACA,WAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,sBAAsB,eAAgB,CAAA,OAAA;AAAA,EACjD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,qBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6BAA4B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,KAClE;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,6BAA6B,eAAgB,CAAA,OAAA;AAAA,EACxD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,4BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,6BAAmC,CAAE,CAAA,IAAA;AAAA,QAC1C,OAAK,CAAE,CAAA,oBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/api/SonarQubeClient.ts","../src/components/SonarQubeCard/Percentage.tsx","../src/components/SonarQubeCard/Rating.tsx","../src/components/SonarQubeCard/RatingCard.tsx","../src/components/SonarQubeCard/Value.tsx","../src/components/SonarQubeCard/SonarQubeCard.tsx","../src/components/index.ts","../src/plugin.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 fetch from 'cross-fetch';\nimport {\n FindingSummary,\n Metrics,\n SonarQubeApi,\n} from '@backstage-community/plugin-sonarqube-react';\nimport { InstanceUrlWrapper, FindingsWrapper } from './types';\nimport { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport class SonarQubeClient implements SonarQubeApi {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const { token: idToken } = await this.identityApi.getCredentials();\n\n const apiUrl = `${await this.discoveryApi.getBaseUrl('sonarqube')}`;\n const response = await fetch(\n `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n ...(idToken && { Authorization: `Bearer ${idToken}` }),\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n return undefined;\n }\n\n async getFindingSummary({\n componentKey,\n projectInstance,\n }: {\n componentKey?: string;\n projectInstance?: string;\n } = {}): Promise<FindingSummary | undefined> {\n if (!componentKey) {\n return undefined;\n }\n\n const instanceKey = projectInstance || '';\n\n const metrics: Metrics = {\n alert_status: undefined,\n bugs: undefined,\n reliability_rating: undefined,\n vulnerabilities: undefined,\n security_rating: undefined,\n security_hotspots_reviewed: undefined,\n security_review_rating: undefined,\n code_smells: undefined,\n sqale_rating: undefined,\n coverage: undefined,\n duplicated_lines_density: undefined,\n };\n\n const baseUrlWrapper = await this.callApi<InstanceUrlWrapper>(\n 'instanceUrl',\n {\n instanceKey,\n },\n );\n let baseUrl = baseUrlWrapper?.instanceUrl;\n if (!baseUrl) {\n return undefined;\n }\n // ensure trailing slash for later on\n if (!baseUrl.endsWith('/')) {\n baseUrl += '/';\n }\n\n const findings = await this.callApi<FindingsWrapper>('findings', {\n componentKey,\n instanceKey,\n });\n if (!findings) {\n return undefined;\n }\n\n findings.measures.forEach(m => {\n metrics[m.metric] = m.value;\n });\n\n return {\n lastAnalysis: findings.analysisDate,\n metrics,\n projectUrl: `${baseUrl}dashboard?id=${encodeURIComponent(componentKey)}`,\n getIssuesUrl: identifier =>\n `${baseUrl}project/issues?id=${encodeURIComponent(\n componentKey,\n )}&types=${identifier.toLocaleUpperCase('en-US')}&resolved=false`,\n getComponentMeasuresUrl: identifier =>\n `${baseUrl}component_measures?id=${encodeURIComponent(\n componentKey,\n )}&metric=${identifier.toLocaleLowerCase(\n 'en-US',\n )}&resolved=false&view=list`,\n getSecurityHotspotsUrl: () =>\n `${baseUrl}${\n baseUrl === 'https://sonarcloud.io/' ? 'project/' : ''\n }security_hotspots?id=${encodeURIComponent(componentKey)}`,\n };\n }\n}\n","/*\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 { useTheme } from '@material-ui/core/styles';\nimport { Circle } from 'rc-progress';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n height: theme.spacing(3),\n width: theme.spacing(3),\n },\n}));\n\nexport const Percentage = ({ value }: { value?: string }) => {\n const classes = useStyles();\n const theme = useTheme();\n\n return (\n <Circle\n strokeLinecap=\"butt\"\n percent={+(value || 0)}\n strokeWidth={16}\n strokeColor={theme.palette.status.ok}\n trailColor={theme.palette.status.error}\n trailWidth={16}\n className={classes.root}\n />\n );\n};\n","/*\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 Avatar from '@material-ui/core/Avatar';\nimport { lighten, makeStyles } from '@material-ui/core/styles';\nimport { CSSProperties } from '@material-ui/styles/withStyles';\nimport React, { useMemo } from 'react';\n\nconst useStyles = makeStyles(theme => {\n const commonCardRating: CSSProperties = {\n height: theme.spacing(3),\n width: theme.spacing(3),\n color: theme.palette.common.white,\n };\n\n return {\n ratingDefault: {\n ...commonCardRating,\n background: theme.palette.status.aborted,\n },\n ratingA: {\n ...commonCardRating,\n background: theme.palette.status.ok,\n },\n ratingB: {\n ...commonCardRating,\n background: lighten(theme.palette.status.ok, 0.5),\n },\n ratingC: {\n ...commonCardRating,\n background: theme.palette.status.pending,\n },\n ratingD: {\n ...commonCardRating,\n background: theme.palette.status.warning,\n },\n ratingE: {\n ...commonCardRating,\n background: theme.palette.error.main,\n },\n };\n});\n\nexport const Rating = ({\n rating,\n hideValue,\n}: {\n rating?: string;\n hideValue?: boolean;\n}) => {\n const classes = useStyles();\n\n const ratingProp = useMemo(() => {\n switch (rating) {\n case '1.0':\n return {\n name: 'A',\n className: classes.ratingA,\n };\n\n case '2.0':\n return {\n name: 'B',\n className: classes.ratingB,\n };\n\n case '3.0':\n return {\n name: 'C',\n className: classes.ratingC,\n };\n\n case '4.0':\n return {\n name: 'D',\n className: classes.ratingD,\n };\n\n case '5.0':\n return {\n name: 'E',\n className: classes.ratingE,\n };\n\n default:\n return {\n name: '',\n className: classes.ratingDefault,\n };\n }\n }, [classes, rating]);\n\n return (\n <Avatar className={ratingProp.className}>\n {!hideValue && ratingProp.name}\n </Avatar>\n );\n};\n","/*\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 { Link } from '@backstage/core-components';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React, { ReactNode } from 'react';\n\nconst useStyles = makeStyles(theme => {\n return {\n root: {\n margin: theme.spacing(1, 0),\n minWidth: '140px',\n },\n upper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n cardTitle: {\n textAlign: 'center',\n },\n wrapIcon: {\n display: 'inline-flex',\n verticalAlign: 'baseline',\n },\n left: {\n display: 'flex',\n },\n right: {\n display: 'flex',\n marginLeft: theme.spacing(0.5),\n },\n };\n});\n\nexport const RatingCard = ({\n leftSlot,\n rightSlot,\n title,\n titleIcon,\n link,\n}: {\n leftSlot: ReactNode;\n rightSlot: ReactNode;\n title: string;\n titleIcon?: ReactNode;\n link: string;\n}) => {\n const classes = useStyles();\n\n return (\n <Link to={link} color=\"inherit\" underline=\"none\">\n <Grid item className={classes.root}>\n <Grid item className={classes.upper}>\n <Grid item className={classes.left}>\n {leftSlot}\n </Grid>\n <Grid item className={classes.right}>\n {rightSlot}\n </Grid>\n </Grid>\n <Grid item className={classes.cardTitle}>\n <Typography variant=\"body1\" className={classes.wrapIcon}>\n {titleIcon} {title}\n </Typography>\n </Grid>\n </Grid>\n </Link>\n );\n};\n","/*\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","/*\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} from '@backstage-community/plugin-sonarqube-react';\nimport { SONARQUBE_PROJECT_KEY_ANNOTATION } from '@backstage-community/plugin-sonarqube-react';\nimport Chip from '@material-ui/core/Chip';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport BugReport from '@material-ui/icons/BugReport';\nimport Lock from '@material-ui/icons/Lock';\nimport LockOpen from '@material-ui/icons/LockOpen';\nimport Security from '@material-ui/icons/Security';\nimport SentimentVeryDissatisfied from '@material-ui/icons/SentimentVeryDissatisfied';\nimport SentimentVerySatisfied from '@material-ui/icons/SentimentVerySatisfied';\nimport React, { useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Percentage } from './Percentage';\nimport { Rating } from './Rating';\nimport { RatingCard } from './RatingCard';\nimport { Value } from './Value';\nimport {\n EmptyState,\n InfoCard,\n InfoCardVariants,\n Progress,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { DateTime } from 'luxon';\n\nconst useStyles = makeStyles(theme => ({\n badgeLabel: {\n color: theme.palette.common.white,\n },\n badgeError: {\n margin: 0,\n backgroundColor: theme.palette.error.main,\n },\n badgeSuccess: {\n margin: 0,\n backgroundColor: theme.palette.success.main,\n },\n badgeUnknown: {\n backgroundColor: theme.palette.grey[500],\n },\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 type DuplicationRating = {\n greaterThan: number;\n rating: '1.0' | '2.0' | '3.0' | '4.0' | '5.0';\n};\n\nconst 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\n/** @public */\nexport const SonarQubeCard = (props: {\n variant?: InfoCardVariants;\n duplicationRatings?: DuplicationRating[];\n missingAnnotationReadMoreUrl?: string;\n}) => {\n const {\n variant = 'gridItem',\n duplicationRatings = defaultDuplicationRatings,\n missingAnnotationReadMoreUrl,\n } = props;\n const { entity } = useEntity();\n const sonarQubeApi = useApi(sonarQubeApiRef);\n\n const { projectKey: projectTitle, projectInstance } = useProjectInfo(entity);\n\n const { value, loading } = useAsync(\n async () =>\n sonarQubeApi.getFindingSummary({\n componentKey: projectTitle,\n projectInstance: projectInstance,\n }),\n [sonarQubeApi, projectTitle],\n );\n\n const deepLink =\n !loading && value\n ? {\n title: 'View more',\n link: value.projectUrl,\n }\n : undefined;\n\n const classes = useStyles();\n let gateLabel = 'Not computed';\n let gateColor = classes.badgeUnknown;\n\n if (value?.metrics.alert_status) {\n const gatePassed = value.metrics.alert_status === 'OK';\n gateLabel = gatePassed ? 'Gate passed' : 'Gate failed';\n gateColor = gatePassed ? classes.badgeSuccess : classes.badgeError;\n }\n\n const qualityBadge = !loading && value && (\n <Chip\n label={gateLabel}\n classes={{ root: gateColor, label: classes.badgeLabel }}\n />\n );\n\n const duplicationRating = useMemo(() => {\n if (loading || !value || !value.metrics.duplicated_lines_density) {\n return '';\n }\n\n let rating = '';\n\n for (const r of duplicationRatings) {\n if (+value.metrics.duplicated_lines_density >= r.greaterThan) {\n rating = r.rating;\n }\n }\n\n return rating;\n }, [loading, value, duplicationRatings]);\n\n return (\n <InfoCard\n title=\"Code Quality\"\n deepLink={deepLink}\n variant={variant}\n headerProps={{\n action: qualityBadge,\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 && !value && (\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 && value && (\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 <RatingCard\n titleIcon={<BugReport />}\n title=\"Bugs\"\n link={value.getIssuesUrl('BUG')}\n leftSlot={<Value value={value.metrics.bugs} />}\n rightSlot={<Rating rating={value.metrics.reliability_rating} />}\n />\n <RatingCard\n titleIcon={\n value.metrics.vulnerabilities === '0' ? (\n <Lock />\n ) : (\n <LockOpen />\n )\n }\n title=\"Vulnerabilities\"\n link={value.getIssuesUrl('VULNERABILITY')}\n leftSlot={<Value value={value.metrics.vulnerabilities} />}\n rightSlot={<Rating rating={value.metrics.security_rating} />}\n />\n <RatingCard\n titleIcon={\n value.metrics.code_smells === '0' ? (\n <SentimentVerySatisfied />\n ) : (\n <SentimentVeryDissatisfied />\n )\n }\n title=\"Code Smells\"\n link={value.getIssuesUrl('CODE_SMELL')}\n leftSlot={<Value value={value.metrics.code_smells} />}\n rightSlot={<Rating rating={value.metrics.sqale_rating} />}\n />\n {value.metrics.security_review_rating && (\n <RatingCard\n titleIcon={<Security />}\n title=\"Hotspots Reviewed\"\n link={value.getSecurityHotspotsUrl()}\n leftSlot={\n <Value\n value={\n value.metrics.security_hotspots_reviewed\n ? `${value.metrics.security_hotspots_reviewed}%`\n : '—'\n }\n />\n }\n rightSlot={\n <Rating rating={value.metrics.security_review_rating} />\n }\n />\n )}\n <div style={{ width: '100%' }} />\n <RatingCard\n link={value.getComponentMeasuresUrl('COVERAGE')}\n title=\"Coverage\"\n leftSlot={<Percentage value={value.metrics.coverage} />}\n rightSlot={\n <Value\n value={\n value.metrics.coverage !== undefined\n ? `${value.metrics.coverage}%`\n : '—'\n }\n />\n }\n />\n <RatingCard\n title=\"Duplications\"\n link={value.getComponentMeasuresUrl('DUPLICATED_LINES_DENSITY')}\n leftSlot={<Rating rating={duplicationRating} hideValue />}\n rightSlot={\n <Value value={`${value.metrics.duplicated_lines_density}%`} />\n }\n />\n </Grid>\n <Grid item className={classes.lastAnalyzed}>\n Last analyzed on{' '}\n {DateTime.fromISO(value.lastAnalysis).toLocaleString(\n DateTime.DATETIME_MED,\n )}\n </Grid>\n </Grid>\n </>\n )}\n </InfoCard>\n );\n};\n","/*\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';\n\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","/*\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 { SonarQubeClient } from './api';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';\n\n/** @public */\nexport const sonarQubePlugin = createPlugin({\n id: 'sonarqube',\n apis: [\n createApiFactory({\n api: sonarQubeApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, identityApi }) =>\n new SonarQubeClient({\n discoveryApi,\n identityApi,\n }),\n }),\n ],\n});\n\n/** @public */\nexport const EntitySonarQubeCard = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeCard',\n component: {\n lazy: () =>\n import('./components/SonarQubeCard').then(m => m.SonarQubeCard),\n },\n }),\n);\n\n/** @public */\nexport const EntitySonarQubeContentPage = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeContentPage',\n component: {\n lazy: () =>\n import('./components/SonarQubeContentPage').then(\n m => m.SonarQubeContentPage,\n ),\n },\n }),\n);\n"],"names":["useStyles","SONARQUBE_PROJECT_KEY_ANNOTATION","NonDeprecatedIsSonarQubeAvailable","NON_DEPRECATED_SONARQUBE_PROJECT_KEY_ANNOTATION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,eAAwC,CAAA;AAAA,EAInD,YAAY,OAGT,EAAA;AANH,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA;AACA,IAAA,aAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AAME,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,cAAc,OAAQ,CAAA,WAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,MAAc,OACZ,CAAA,IAAA,EACA,KACwB,EAAA;AACxB,IAAA,MAAM,EAAE,KAAO,EAAA,OAAA,KAAY,MAAM,IAAA,CAAK,YAAY,cAAe,EAAA,CAAA;AAEjE,IAAA,MAAM,SAAS,CAAG,EAAA,MAAM,KAAK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b,CAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ,CAAA;AAEJ;;AC9PO,MAAM,oBAAuB,GAAAC,uBAAA;AAO7B,MAAM,gCACX,GAAAC;;ACXK,MAAM,kBAAkB,YAAa,CAAA;AAAA,EAC1C,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,WAAa,EAAA,cAAA;AAAA,OACf;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,WAAY,EAAA,KACpC,IAAI,eAAgB,CAAA;AAAA,QAClB,YAAA;AAAA,QACA,WAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,sBAAsB,eAAgB,CAAA,OAAA;AAAA,EACjD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,qBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6BAA4B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,KAClE;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,6BAA6B,eAAgB,CAAA,OAAA;AAAA,EACxD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,4BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,6BAAmC,CAAE,CAAA,IAAA;AAAA,QAC1C,OAAK,CAAE,CAAA,oBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-sonarqube",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
52
52
|
"cross-fetch": "^4.0.0",
|
|
53
53
|
"luxon": "^3.0.0",
|
|
54
|
-
"rc-progress": "
|
|
54
|
+
"rc-progress": "4.0.0",
|
|
55
55
|
"react-use": "^17.2.4"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-D3iMIkzq.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};\n\nexport const SonarQubeContentPage = (props: SonarQubeContentPageProps) => {\n const { entity } = useEntity();\n const { title, supportTitle } = props;\n\n return isSonarQubeAvailable(entity) ? (\n <Content>\n <ContentHeader title={title ?? 'SonarQube Dashboard'}>\n {supportTitle && <SupportButton>{supportTitle}</SupportButton>}\n </ContentHeader>\n <SonarQubeCard />\n </Content>\n ) : (\n <MissingAnnotationEmptyState\n annotation={SONARQUBE_PROJECT_KEY_ANNOTATION}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsCa,MAAA,oBAAA,GAAuB,CAAC,KAAqC,KAAA;AACxE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,EAAE,KAAO,EAAA,YAAA,EAAiB,GAAA,KAAA,CAAA;AAEhC,EAAA,OAAO,qBAAqB,MAAM,CAAA,uCAC/B,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAc,KAAO,EAAA,KAAA,IAAA,IAAA,GAAA,KAAA,GAAS,yBAC5B,YAAgB,oBAAA,KAAA,CAAA,aAAA,CAAC,qBAAe,YAAa,CAChD,mBACC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,CACjB,CAEA,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,KAAA;AAAA,GACd,CAAA;AAEJ;;;;"}
|