@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
package/dist/index.esm.js CHANGED
@@ -1,491 +1,6 @@
1
- import fetch from 'cross-fetch';
2
- import { sonarQubeApiRef, useProjectInfo, SONARQUBE_PROJECT_KEY_ANNOTATION as SONARQUBE_PROJECT_KEY_ANNOTATION$1, isSonarQubeAvailable as isSonarQubeAvailable$1 } from '@backstage-community/plugin-sonarqube-react';
3
- import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
4
- import Chip from '@material-ui/core/Chip';
5
- import Grid from '@material-ui/core/Grid';
6
- import { makeStyles, useTheme, lighten } from '@material-ui/core/styles';
7
- import BugReport from '@material-ui/icons/BugReport';
8
- import Lock from '@material-ui/icons/Lock';
9
- import LockOpen from '@material-ui/icons/LockOpen';
10
- import Security from '@material-ui/icons/Security';
11
- import SentimentVeryDissatisfied from '@material-ui/icons/SentimentVeryDissatisfied';
12
- import SentimentVerySatisfied from '@material-ui/icons/SentimentVerySatisfied';
13
- import React, { useMemo } from 'react';
14
- import useAsync from 'react-use/esm/useAsync';
15
- import { Circle } from 'rc-progress';
16
- import Avatar from '@material-ui/core/Avatar';
17
- import { Link, InfoCard, Progress, EmptyState } from '@backstage/core-components';
18
- import Typography from '@material-ui/core/Typography';
19
- import { useApi, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createComponentExtension } from '@backstage/core-plugin-api';
20
- import { DateTime } from 'luxon';
21
-
22
- var __defProp = Object.defineProperty;
23
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24
- var __publicField = (obj, key, value) => {
25
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
- return value;
27
- };
28
- class SonarQubeClient {
29
- constructor(options) {
30
- __publicField(this, "discoveryApi");
31
- __publicField(this, "identityApi");
32
- this.discoveryApi = options.discoveryApi;
33
- this.identityApi = options.identityApi;
34
- }
35
- async callApi(path, query) {
36
- const { token: idToken } = await this.identityApi.getCredentials();
37
- const apiUrl = `${await this.discoveryApi.getBaseUrl("sonarqube")}`;
38
- const response = await fetch(
39
- `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,
40
- {
41
- headers: {
42
- "Content-Type": "application/json",
43
- ...idToken && { Authorization: `Bearer ${idToken}` }
44
- }
45
- }
46
- );
47
- if (response.status === 200) {
48
- return await response.json();
49
- }
50
- return void 0;
51
- }
52
- async getFindingSummary({
53
- componentKey,
54
- projectInstance
55
- } = {}) {
56
- if (!componentKey) {
57
- return void 0;
58
- }
59
- const instanceKey = projectInstance || "";
60
- const metrics = {
61
- alert_status: void 0,
62
- bugs: void 0,
63
- reliability_rating: void 0,
64
- vulnerabilities: void 0,
65
- security_rating: void 0,
66
- security_hotspots_reviewed: void 0,
67
- security_review_rating: void 0,
68
- code_smells: void 0,
69
- sqale_rating: void 0,
70
- coverage: void 0,
71
- duplicated_lines_density: void 0
72
- };
73
- const baseUrlWrapper = await this.callApi(
74
- "instanceUrl",
75
- {
76
- instanceKey
77
- }
78
- );
79
- let baseUrl = baseUrlWrapper == null ? void 0 : baseUrlWrapper.instanceUrl;
80
- if (!baseUrl) {
81
- return void 0;
82
- }
83
- if (!baseUrl.endsWith("/")) {
84
- baseUrl += "/";
85
- }
86
- const findings = await this.callApi("findings", {
87
- componentKey,
88
- instanceKey
89
- });
90
- if (!findings) {
91
- return void 0;
92
- }
93
- findings.measures.forEach((m) => {
94
- metrics[m.metric] = m.value;
95
- });
96
- return {
97
- lastAnalysis: findings.analysisDate,
98
- metrics,
99
- projectUrl: `${baseUrl}dashboard?id=${encodeURIComponent(componentKey)}`,
100
- getIssuesUrl: (identifier) => `${baseUrl}project/issues?id=${encodeURIComponent(
101
- componentKey
102
- )}&types=${identifier.toLocaleUpperCase("en-US")}&resolved=false`,
103
- getComponentMeasuresUrl: (identifier) => `${baseUrl}component_measures?id=${encodeURIComponent(
104
- componentKey
105
- )}&metric=${identifier.toLocaleLowerCase(
106
- "en-US"
107
- )}&resolved=false&view=list`,
108
- getSecurityHotspotsUrl: () => `${baseUrl}${baseUrl === "https://sonarcloud.io/" ? "project/" : ""}security_hotspots?id=${encodeURIComponent(componentKey)}`
109
- };
110
- }
111
- }
112
-
113
- const useStyles$4 = makeStyles((theme) => ({
114
- root: {
115
- height: theme.spacing(3),
116
- width: theme.spacing(3)
117
- }
118
- }));
119
- const Percentage = ({ value }) => {
120
- const classes = useStyles$4();
121
- const theme = useTheme();
122
- return /* @__PURE__ */ React.createElement(
123
- Circle,
124
- {
125
- strokeLinecap: "butt",
126
- percent: +(value || 0),
127
- strokeWidth: 16,
128
- strokeColor: theme.palette.status.ok,
129
- trailColor: theme.palette.status.error,
130
- trailWidth: 16,
131
- className: classes.root
132
- }
133
- );
134
- };
135
-
136
- const useStyles$3 = makeStyles((theme) => {
137
- const commonCardRating = {
138
- height: theme.spacing(3),
139
- width: theme.spacing(3),
140
- color: theme.palette.common.white
141
- };
142
- return {
143
- ratingDefault: {
144
- ...commonCardRating,
145
- background: theme.palette.status.aborted
146
- },
147
- ratingA: {
148
- ...commonCardRating,
149
- background: theme.palette.status.ok
150
- },
151
- ratingB: {
152
- ...commonCardRating,
153
- background: lighten(theme.palette.status.ok, 0.5)
154
- },
155
- ratingC: {
156
- ...commonCardRating,
157
- background: theme.palette.status.pending
158
- },
159
- ratingD: {
160
- ...commonCardRating,
161
- background: theme.palette.status.warning
162
- },
163
- ratingE: {
164
- ...commonCardRating,
165
- background: theme.palette.error.main
166
- }
167
- };
168
- });
169
- const Rating = ({
170
- rating,
171
- hideValue
172
- }) => {
173
- const classes = useStyles$3();
174
- const ratingProp = useMemo(() => {
175
- switch (rating) {
176
- case "1.0":
177
- return {
178
- name: "A",
179
- className: classes.ratingA
180
- };
181
- case "2.0":
182
- return {
183
- name: "B",
184
- className: classes.ratingB
185
- };
186
- case "3.0":
187
- return {
188
- name: "C",
189
- className: classes.ratingC
190
- };
191
- case "4.0":
192
- return {
193
- name: "D",
194
- className: classes.ratingD
195
- };
196
- case "5.0":
197
- return {
198
- name: "E",
199
- className: classes.ratingE
200
- };
201
- default:
202
- return {
203
- name: "",
204
- className: classes.ratingDefault
205
- };
206
- }
207
- }, [classes, rating]);
208
- return /* @__PURE__ */ React.createElement(Avatar, { className: ratingProp.className }, !hideValue && ratingProp.name);
209
- };
210
-
211
- const useStyles$2 = makeStyles((theme) => {
212
- return {
213
- root: {
214
- margin: theme.spacing(1, 0),
215
- minWidth: "140px"
216
- },
217
- upper: {
218
- display: "flex",
219
- justifyContent: "center",
220
- alignItems: "center"
221
- },
222
- cardTitle: {
223
- textAlign: "center"
224
- },
225
- wrapIcon: {
226
- display: "inline-flex",
227
- verticalAlign: "baseline"
228
- },
229
- left: {
230
- display: "flex"
231
- },
232
- right: {
233
- display: "flex",
234
- marginLeft: theme.spacing(0.5)
235
- }
236
- };
237
- });
238
- const RatingCard = ({
239
- leftSlot,
240
- rightSlot,
241
- title,
242
- titleIcon,
243
- link
244
- }) => {
245
- const classes = useStyles$2();
246
- return /* @__PURE__ */ React.createElement(Link, { to: link, color: "inherit", underline: "none" }, /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.root }, /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.upper }, /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.left }, leftSlot), /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.right }, rightSlot)), /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.cardTitle }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", className: classes.wrapIcon }, titleIcon, " ", title))));
247
- };
248
-
249
- const useStyles$1 = makeStyles((theme) => {
250
- return {
251
- value: {
252
- fontSize: "1.5rem",
253
- fontWeight: theme.typography.fontWeightMedium
254
- }
255
- };
256
- });
257
- const Value = (props) => {
258
- const classes = useStyles$1();
259
- return /* @__PURE__ */ React.createElement(Typography, { component: "span", className: classes.value }, props.value);
260
- };
261
-
262
- const useStyles = makeStyles((theme) => ({
263
- badgeLabel: {
264
- color: theme.palette.common.white
265
- },
266
- badgeError: {
267
- margin: 0,
268
- backgroundColor: theme.palette.error.main
269
- },
270
- badgeSuccess: {
271
- margin: 0,
272
- backgroundColor: theme.palette.success.main
273
- },
274
- badgeUnknown: {
275
- backgroundColor: theme.palette.grey[500]
276
- },
277
- header: {
278
- padding: theme.spacing(2, 2, 2, 2.5)
279
- },
280
- action: {
281
- margin: 0
282
- },
283
- lastAnalyzed: {
284
- color: theme.palette.text.secondary
285
- }
286
- }));
287
- const defaultDuplicationRatings = [
288
- { greaterThan: 0, rating: "1.0" },
289
- { greaterThan: 3, rating: "2.0" },
290
- { greaterThan: 5, rating: "3.0" },
291
- { greaterThan: 10, rating: "4.0" },
292
- { greaterThan: 20, rating: "5.0" }
293
- ];
294
- const SonarQubeCard = (props) => {
295
- const {
296
- variant = "gridItem",
297
- duplicationRatings = defaultDuplicationRatings,
298
- missingAnnotationReadMoreUrl
299
- } = props;
300
- const { entity } = useEntity();
301
- const sonarQubeApi = useApi(sonarQubeApiRef);
302
- const { projectKey: projectTitle, projectInstance } = useProjectInfo(entity);
303
- const { value, loading } = useAsync(
304
- async () => sonarQubeApi.getFindingSummary({
305
- componentKey: projectTitle,
306
- projectInstance
307
- }),
308
- [sonarQubeApi, projectTitle]
309
- );
310
- const deepLink = !loading && value ? {
311
- title: "View more",
312
- link: value.projectUrl
313
- } : void 0;
314
- const classes = useStyles();
315
- let gateLabel = "Not computed";
316
- let gateColor = classes.badgeUnknown;
317
- if (value == null ? void 0 : value.metrics.alert_status) {
318
- const gatePassed = value.metrics.alert_status === "OK";
319
- gateLabel = gatePassed ? "Gate passed" : "Gate failed";
320
- gateColor = gatePassed ? classes.badgeSuccess : classes.badgeError;
321
- }
322
- const qualityBadge = !loading && value && /* @__PURE__ */ React.createElement(
323
- Chip,
324
- {
325
- label: gateLabel,
326
- classes: { root: gateColor, label: classes.badgeLabel }
327
- }
328
- );
329
- const duplicationRating = useMemo(() => {
330
- if (loading || !value || !value.metrics.duplicated_lines_density) {
331
- return "";
332
- }
333
- let rating = "";
334
- for (const r of duplicationRatings) {
335
- if (+value.metrics.duplicated_lines_density >= r.greaterThan) {
336
- rating = r.rating;
337
- }
338
- }
339
- return rating;
340
- }, [loading, value, duplicationRatings]);
341
- return /* @__PURE__ */ React.createElement(
342
- InfoCard,
343
- {
344
- title: "Code Quality",
345
- deepLink,
346
- variant,
347
- headerProps: {
348
- action: qualityBadge,
349
- classes: {
350
- root: classes.header,
351
- action: classes.action
352
- }
353
- }
354
- },
355
- loading && /* @__PURE__ */ React.createElement(Progress, null),
356
- !loading && !projectTitle && /* @__PURE__ */ React.createElement(
357
- MissingAnnotationEmptyState,
358
- {
359
- annotation: SONARQUBE_PROJECT_KEY_ANNOTATION$1,
360
- readMoreUrl: missingAnnotationReadMoreUrl
361
- }
362
- ),
363
- !loading && projectTitle && !value && /* @__PURE__ */ React.createElement(
364
- EmptyState,
365
- {
366
- missing: "info",
367
- title: "No information to display",
368
- description: `There is no SonarQube project with key '${projectTitle}'.`
369
- }
370
- ),
371
- !loading && value && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
372
- Grid,
373
- {
374
- item: true,
375
- container: true,
376
- direction: "column",
377
- justifyContent: "space-between",
378
- alignItems: "center",
379
- style: { height: "100%" },
380
- spacing: 0
381
- },
382
- /* @__PURE__ */ React.createElement(Grid, { item: true, container: true, justifyContent: "space-around" }, /* @__PURE__ */ React.createElement(
383
- RatingCard,
384
- {
385
- titleIcon: /* @__PURE__ */ React.createElement(BugReport, null),
386
- title: "Bugs",
387
- link: value.getIssuesUrl("BUG"),
388
- leftSlot: /* @__PURE__ */ React.createElement(Value, { value: value.metrics.bugs }),
389
- rightSlot: /* @__PURE__ */ React.createElement(Rating, { rating: value.metrics.reliability_rating })
390
- }
391
- ), /* @__PURE__ */ React.createElement(
392
- RatingCard,
393
- {
394
- titleIcon: value.metrics.vulnerabilities === "0" ? /* @__PURE__ */ React.createElement(Lock, null) : /* @__PURE__ */ React.createElement(LockOpen, null),
395
- title: "Vulnerabilities",
396
- link: value.getIssuesUrl("VULNERABILITY"),
397
- leftSlot: /* @__PURE__ */ React.createElement(Value, { value: value.metrics.vulnerabilities }),
398
- rightSlot: /* @__PURE__ */ React.createElement(Rating, { rating: value.metrics.security_rating })
399
- }
400
- ), /* @__PURE__ */ React.createElement(
401
- RatingCard,
402
- {
403
- titleIcon: value.metrics.code_smells === "0" ? /* @__PURE__ */ React.createElement(SentimentVerySatisfied, null) : /* @__PURE__ */ React.createElement(SentimentVeryDissatisfied, null),
404
- title: "Code Smells",
405
- link: value.getIssuesUrl("CODE_SMELL"),
406
- leftSlot: /* @__PURE__ */ React.createElement(Value, { value: value.metrics.code_smells }),
407
- rightSlot: /* @__PURE__ */ React.createElement(Rating, { rating: value.metrics.sqale_rating })
408
- }
409
- ), value.metrics.security_review_rating && /* @__PURE__ */ React.createElement(
410
- RatingCard,
411
- {
412
- titleIcon: /* @__PURE__ */ React.createElement(Security, null),
413
- title: "Hotspots Reviewed",
414
- link: value.getSecurityHotspotsUrl(),
415
- leftSlot: /* @__PURE__ */ React.createElement(
416
- Value,
417
- {
418
- value: value.metrics.security_hotspots_reviewed ? `${value.metrics.security_hotspots_reviewed}%` : "\u2014"
419
- }
420
- ),
421
- rightSlot: /* @__PURE__ */ React.createElement(Rating, { rating: value.metrics.security_review_rating })
422
- }
423
- ), /* @__PURE__ */ React.createElement("div", { style: { width: "100%" } }), /* @__PURE__ */ React.createElement(
424
- RatingCard,
425
- {
426
- link: value.getComponentMeasuresUrl("COVERAGE"),
427
- title: "Coverage",
428
- leftSlot: /* @__PURE__ */ React.createElement(Percentage, { value: value.metrics.coverage }),
429
- rightSlot: /* @__PURE__ */ React.createElement(
430
- Value,
431
- {
432
- value: value.metrics.coverage !== void 0 ? `${value.metrics.coverage}%` : "\u2014"
433
- }
434
- )
435
- }
436
- ), /* @__PURE__ */ React.createElement(
437
- RatingCard,
438
- {
439
- title: "Duplications",
440
- link: value.getComponentMeasuresUrl("DUPLICATED_LINES_DENSITY"),
441
- leftSlot: /* @__PURE__ */ React.createElement(Rating, { rating: duplicationRating, hideValue: true }),
442
- rightSlot: /* @__PURE__ */ React.createElement(Value, { value: `${value.metrics.duplicated_lines_density}%` })
443
- }
444
- )),
445
- /* @__PURE__ */ React.createElement(Grid, { item: true, className: classes.lastAnalyzed }, "Last analyzed on", " ", DateTime.fromISO(value.lastAnalysis).toLocaleString(
446
- DateTime.DATETIME_MED
447
- ))
448
- ))
449
- );
450
- };
451
-
452
- const isSonarQubeAvailable = isSonarQubeAvailable$1;
453
- const SONARQUBE_PROJECT_KEY_ANNOTATION = SONARQUBE_PROJECT_KEY_ANNOTATION$1;
454
-
455
- const sonarQubePlugin = createPlugin({
456
- id: "sonarqube",
457
- apis: [
458
- createApiFactory({
459
- api: sonarQubeApiRef,
460
- deps: {
461
- discoveryApi: discoveryApiRef,
462
- identityApi: identityApiRef
463
- },
464
- factory: ({ discoveryApi, identityApi }) => new SonarQubeClient({
465
- discoveryApi,
466
- identityApi
467
- })
468
- })
469
- ]
470
- });
471
- const EntitySonarQubeCard = sonarQubePlugin.provide(
472
- createComponentExtension({
473
- name: "EntitySonarQubeCard",
474
- component: {
475
- lazy: () => import('./esm/index-CwJaLZxM.esm.js').then((m) => m.SonarQubeCard)
476
- }
477
- })
478
- );
479
- const EntitySonarQubeContentPage = sonarQubePlugin.provide(
480
- createComponentExtension({
481
- name: "EntitySonarQubeContentPage",
482
- component: {
483
- lazy: () => import('./esm/index-B-NIU3rT.esm.js').then(
484
- (m) => m.SonarQubeContentPage
485
- )
486
- }
487
- })
488
- );
489
-
490
- export { EntitySonarQubeCard, EntitySonarQubeContentPage, SONARQUBE_PROJECT_KEY_ANNOTATION, SonarQubeCard, SonarQubeClient, isSonarQubeAvailable, sonarQubePlugin };
1
+ export { SonarQubeClient } from './api/SonarQubeClient.esm.js';
2
+ export { SONARQUBE_PROJECT_KEY_ANNOTATION, isSonarQubeAvailable } from './components/index.esm.js';
3
+ export { EntitySonarQubeCard, EntitySonarQubeContentPage, sonarQubePlugin } from './plugin.esm.js';
4
+ export { SonarQubeCard } from './components/SonarQubeCard/SonarQubeCard.esm.js';
5
+ export { SonarQubeTable } from './components/SonarQubeTable/SonarQubeTable.esm.js';
491
6
  //# sourceMappingURL=index.esm.js.map
@@ -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 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.SonarQ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jD,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":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,41 @@
1
+ import { SonarQubeClient } from './api/SonarQubeClient.esm.js';
2
+ import { createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createComponentExtension } from '@backstage/core-plugin-api';
3
+ import { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';
4
+
5
+ const sonarQubePlugin = createPlugin({
6
+ id: "sonarqube",
7
+ apis: [
8
+ createApiFactory({
9
+ api: sonarQubeApiRef,
10
+ deps: {
11
+ discoveryApi: discoveryApiRef,
12
+ identityApi: identityApiRef
13
+ },
14
+ factory: ({ discoveryApi, identityApi }) => new SonarQubeClient({
15
+ discoveryApi,
16
+ identityApi
17
+ })
18
+ })
19
+ ]
20
+ });
21
+ const EntitySonarQubeCard = sonarQubePlugin.provide(
22
+ createComponentExtension({
23
+ name: "EntitySonarQubeCard",
24
+ component: {
25
+ lazy: () => import('./components/SonarQubeCard/index.esm.js').then((m) => m.SonarQubeCard)
26
+ }
27
+ })
28
+ );
29
+ const EntitySonarQubeContentPage = sonarQubePlugin.provide(
30
+ createComponentExtension({
31
+ name: "EntitySonarQubeContentPage",
32
+ component: {
33
+ lazy: () => import('./components/SonarQubeContentPage/index.esm.js').then(
34
+ (m) => m.SonarQubeContentPage
35
+ )
36
+ }
37
+ })
38
+ );
39
+
40
+ export { EntitySonarQubeCard, EntitySonarQubeContentPage, sonarQubePlugin };
41
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../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 { 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":[],"mappings":";;;;AA2BO,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,yCAA4B,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,gDAAmC,CAAE,CAAA,IAAA;AAAA,QAC1C,OAAK,CAAE,CAAA,oBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}