@backstage-community/plugin-tech-insights 0.3.28 → 0.3.29

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 (48) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/dist/api/TechInsightsApi.esm.js +8 -0
  4. package/dist/api/TechInsightsApi.esm.js.map +1 -0
  5. package/dist/api/TechInsightsClient.esm.js +86 -0
  6. package/dist/api/TechInsightsClient.esm.js.map +1 -0
  7. package/dist/components/BooleanCheck/BooleanCheck.esm.js +11 -0
  8. package/dist/components/BooleanCheck/BooleanCheck.esm.js.map +1 -0
  9. package/dist/components/CheckResultRenderer.esm.js +11 -0
  10. package/dist/components/CheckResultRenderer.esm.js.map +1 -0
  11. package/dist/{esm/index-Dk00aaon.esm.js → components/ScorecardsCard/ScorecardsCard.esm.js} +3 -15
  12. package/dist/components/ScorecardsCard/ScorecardsCard.esm.js.map +1 -0
  13. package/dist/components/ScorecardsCard/index.esm.js +2 -0
  14. package/dist/components/ScorecardsCard/index.esm.js.map +1 -0
  15. package/dist/{esm/index-DYpZtEuv.esm.js → components/ScorecardsContent/ScorecardContent.esm.js} +3 -13
  16. package/dist/components/ScorecardsContent/ScorecardContent.esm.js.map +1 -0
  17. package/dist/components/ScorecardsContent/index.esm.js +2 -0
  18. package/dist/components/ScorecardsContent/index.esm.js.map +1 -0
  19. package/dist/{esm/ScorecardInfo-DRy_gP7g.esm.js → components/ScorecardsInfo/ScorecardInfo.esm.js} +3 -3
  20. package/dist/components/ScorecardsInfo/ScorecardInfo.esm.js.map +1 -0
  21. package/dist/components/ScorecardsInfo/index.esm.js +2 -0
  22. package/dist/components/ScorecardsInfo/index.esm.js.map +1 -0
  23. package/dist/{esm/ScorecardsList-mU3LQTf9.esm.js → components/ScorecardsList/ScorecardsList.esm.js} +3 -3
  24. package/dist/components/ScorecardsList/ScorecardsList.esm.js.map +1 -0
  25. package/dist/components/ScorecardsList/index.esm.js +2 -0
  26. package/dist/components/ScorecardsList/index.esm.js.map +1 -0
  27. package/dist/{esm/index-Dprfu-4U.esm.js → components/ScorecardsPage/Filters.esm.js} +28 -54
  28. package/dist/components/ScorecardsPage/Filters.esm.js.map +1 -0
  29. package/dist/components/ScorecardsPage/ScorecardsPage.esm.js +61 -0
  30. package/dist/components/ScorecardsPage/ScorecardsPage.esm.js.map +1 -0
  31. package/dist/components/ScorecardsPage/index.esm.js +2 -0
  32. package/dist/components/ScorecardsPage/index.esm.js.map +1 -0
  33. package/dist/index.esm.js +5 -156
  34. package/dist/index.esm.js.map +1 -1
  35. package/dist/plugin.esm.js +56 -0
  36. package/dist/plugin.esm.js.map +1 -0
  37. package/dist/routes.esm.js +8 -0
  38. package/dist/routes.esm.js.map +1 -0
  39. package/package.json +7 -7
  40. package/dist/esm/ScorecardInfo-DRy_gP7g.esm.js.map +0 -1
  41. package/dist/esm/ScorecardsList-mU3LQTf9.esm.js.map +0 -1
  42. package/dist/esm/index-B0n7xKVB.esm.js +0 -19
  43. package/dist/esm/index-B0n7xKVB.esm.js.map +0 -1
  44. package/dist/esm/index-B5eokOBn.esm.js +0 -16
  45. package/dist/esm/index-B5eokOBn.esm.js.map +0 -1
  46. package/dist/esm/index-DYpZtEuv.esm.js.map +0 -1
  47. package/dist/esm/index-Dk00aaon.esm.js.map +0 -1
  48. package/dist/esm/index-Dprfu-4U.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @backstage-community/plugin-tech-insights
2
2
 
3
+ ## 0.3.29
4
+
5
+ ### Patch Changes
6
+
7
+ - cbad35a: Updated dependencies.
8
+ - cbad35a: Added a filter to `ScorecardsPage` to only shows entities with results.
9
+ - Updated dependencies [cbad35a]
10
+ - @backstage-community/plugin-tech-insights-common@0.2.14
11
+
3
12
  ## 0.3.28
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -87,7 +87,7 @@ const overviewContent = (
87
87
 
88
88
  ## Boolean Scorecard Example
89
89
 
90
- If you follow the [Backend Example](https://github.com/backstage/backstage/tree/master/plugins/tech-insights-backend#backend-example), once the needed facts have been generated the default boolean scorecard will look like this:
90
+ If you follow the [Backend Example](../tech-insights-backend#backend-example), once the needed facts have been generated the default boolean scorecard will look like this:
91
91
 
92
92
  ![Boolean Scorecard Example](./docs/boolean-scorecard-example.png)
93
93
 
@@ -160,7 +160,7 @@ First make the Scorecard page available as route
160
160
  ```tsx
161
161
  // packages/app/src/App.tsx
162
162
 
163
- import { TechInsightsScorecardPage } from '@backstage/plugin-tech-insights';
163
+ import { TechInsightsScorecardPage } from '@backstage-community/plugin-tech-insights';
164
164
 
165
165
  const routes = (
166
166
  <FlatRoutes>
@@ -0,0 +1,8 @@
1
+ import { createApiRef } from '@backstage/core-plugin-api';
2
+
3
+ const techInsightsApiRef = createApiRef({
4
+ id: "plugin.techinsights.service"
5
+ });
6
+
7
+ export { techInsightsApiRef };
8
+ //# sourceMappingURL=TechInsightsApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TechInsightsApi.esm.js","sources":["../../src/api/TechInsightsApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport {\n CheckResult,\n BulkCheckResponse,\n FactSchema,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { Check, InsightFacts } from './types';\nimport { CheckResultRenderer } from '../components/CheckResultRenderer';\nimport { CompoundEntityRef } from '@backstage/catalog-model';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link TechInsightsApi}\n *\n * @public\n */\nexport const techInsightsApiRef = createApiRef<TechInsightsApi>({\n id: 'plugin.techinsights.service',\n});\n\n/**\n * API client interface for the Tech Insights plugin\n *\n * @public\n */\nexport interface TechInsightsApi {\n getCheckResultRenderers: (types: string[]) => CheckResultRenderer[];\n getAllChecks(): Promise<Check[]>;\n runChecks(\n entityParams: CompoundEntityRef,\n checks?: string[],\n ): Promise<CheckResult[]>;\n runBulkChecks(\n entities: CompoundEntityRef[],\n checks?: Check[],\n ): Promise<BulkCheckResponse>;\n getFacts(entity: CompoundEntityRef, facts: string[]): Promise<InsightFacts>;\n getFactSchemas(): Promise<FactSchema[]>;\n}\n"],"names":[],"mappings":";;AA+BO,MAAM,qBAAqB,YAA8B,CAAA;AAAA,EAC9D,EAAI,EAAA,6BAAA;AACN,CAAC;;;;"}
@@ -0,0 +1,86 @@
1
+ import { ResponseError } from '@backstage/errors';
2
+ import { stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { jsonRulesEngineCheckResultRenderer } from '../components/CheckResultRenderer.esm.js';
4
+ import qs from 'qs';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __publicField = (obj, key, value) => {
9
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
10
+ return value;
11
+ };
12
+ class TechInsightsClient {
13
+ constructor(options) {
14
+ __publicField(this, "discoveryApi");
15
+ __publicField(this, "identityApi");
16
+ __publicField(this, "renderers");
17
+ this.discoveryApi = options.discoveryApi;
18
+ this.identityApi = options.identityApi;
19
+ this.renderers = options.renderers;
20
+ }
21
+ async getFacts(entity, facts) {
22
+ const query = qs.stringify({
23
+ entity: stringifyEntityRef(entity),
24
+ ids: facts
25
+ });
26
+ return await this.api(`/facts/latest?${query}`);
27
+ }
28
+ getCheckResultRenderers(types) {
29
+ var _a;
30
+ const renderers = (_a = this.renderers) != null ? _a : [jsonRulesEngineCheckResultRenderer];
31
+ return renderers.filter((d) => types.includes(d.type));
32
+ }
33
+ async getAllChecks() {
34
+ return this.api("/checks");
35
+ }
36
+ async getFactSchemas() {
37
+ return this.api("/fact-schemas");
38
+ }
39
+ async runChecks(entityParams, checks) {
40
+ const { namespace, kind, name } = entityParams;
41
+ const requestBody = { checks };
42
+ return this.api(
43
+ `/checks/run/${encodeURIComponent(namespace)}/${encodeURIComponent(
44
+ kind
45
+ )}/${encodeURIComponent(name)}`,
46
+ {
47
+ method: "POST",
48
+ body: JSON.stringify(requestBody)
49
+ }
50
+ );
51
+ }
52
+ async runBulkChecks(entities, checks) {
53
+ const checkIds = checks ? checks.map((check) => check.id) : [];
54
+ const requestBody = {
55
+ entities,
56
+ checks: checkIds.length > 0 ? checkIds : void 0
57
+ };
58
+ return this.api("/checks/run", {
59
+ method: "POST",
60
+ body: JSON.stringify(requestBody)
61
+ });
62
+ }
63
+ async api(path, init) {
64
+ const url = await this.discoveryApi.getBaseUrl("tech-insights");
65
+ const { token } = await this.identityApi.getCredentials();
66
+ const headers = new Headers(init == null ? void 0 : init.headers);
67
+ if (!headers.has("content-type"))
68
+ headers.set("content-type", "application/json");
69
+ if (token && !headers.has("authorization")) {
70
+ headers.set("authorization", `Bearer ${token}`);
71
+ }
72
+ const request = new Request(`${url}${path}`, {
73
+ ...init,
74
+ headers
75
+ });
76
+ return fetch(request).then(async (response) => {
77
+ if (!response.ok) {
78
+ throw await ResponseError.fromResponse(response);
79
+ }
80
+ return response.json();
81
+ });
82
+ }
83
+ }
84
+
85
+ export { TechInsightsClient };
86
+ //# sourceMappingURL=TechInsightsClient.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TechInsightsClient.esm.js","sources":["../../src/api/TechInsightsClient.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TechInsightsApi } from './TechInsightsApi';\nimport {\n BulkCheckResponse,\n CheckResult,\n FactSchema,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { Check, InsightFacts } from './types';\nimport { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\n\nimport {\n CheckResultRenderer,\n jsonRulesEngineCheckResultRenderer,\n} from '../components/CheckResultRenderer';\nimport qs from 'qs';\n\n/** @public */\nexport class TechInsightsClient implements TechInsightsApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly identityApi: IdentityApi;\n private readonly renderers?: CheckResultRenderer[];\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n renderers?: CheckResultRenderer[];\n }) {\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n this.renderers = options.renderers;\n }\n\n async getFacts(\n entity: CompoundEntityRef,\n facts: string[],\n ): Promise<InsightFacts> {\n const query = qs.stringify({\n entity: stringifyEntityRef(entity),\n ids: facts,\n });\n return await this.api<InsightFacts>(`/facts/latest?${query}`);\n }\n\n getCheckResultRenderers(types: string[]): CheckResultRenderer[] {\n const renderers = this.renderers ?? [jsonRulesEngineCheckResultRenderer];\n return renderers.filter(d => types.includes(d.type));\n }\n\n async getAllChecks(): Promise<Check[]> {\n return this.api('/checks');\n }\n\n async getFactSchemas(): Promise<FactSchema[]> {\n return this.api('/fact-schemas');\n }\n\n async runChecks(\n entityParams: CompoundEntityRef,\n checks?: string[],\n ): Promise<CheckResult[]> {\n const { namespace, kind, name } = entityParams;\n const requestBody = { checks };\n return this.api(\n `/checks/run/${encodeURIComponent(namespace)}/${encodeURIComponent(\n kind,\n )}/${encodeURIComponent(name)}`,\n {\n method: 'POST',\n body: JSON.stringify(requestBody),\n },\n );\n }\n\n async runBulkChecks(\n entities: CompoundEntityRef[],\n checks?: Check[],\n ): Promise<BulkCheckResponse> {\n const checkIds = checks ? checks.map(check => check.id) : [];\n const requestBody = {\n entities,\n checks: checkIds.length > 0 ? checkIds : undefined,\n };\n return this.api('/checks/run', {\n method: 'POST',\n body: JSON.stringify(requestBody),\n });\n }\n\n private async api<T>(path: string, init?: RequestInit): Promise<T> {\n const url = await this.discoveryApi.getBaseUrl('tech-insights');\n const { token } = await this.identityApi.getCredentials();\n\n const headers: HeadersInit = new Headers(init?.headers);\n if (!headers.has('content-type'))\n headers.set('content-type', 'application/json');\n if (token && !headers.has('authorization')) {\n headers.set('authorization', `Bearer ${token}`);\n }\n\n const request = new Request(`${url}${path}`, {\n ...init,\n headers,\n });\n\n return fetch(request).then(async response => {\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json() as Promise<T>;\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqCO,MAAM,kBAA8C,CAAA;AAAA,EAKzD,YAAY,OAIT,EAAA;AARH,IAAiB,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AAOf,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,cAAc,OAAQ,CAAA,WAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AAAA,GAC3B;AAAA,EAEA,MAAM,QACJ,CAAA,MAAA,EACA,KACuB,EAAA;AACvB,IAAM,MAAA,KAAA,GAAQ,GAAG,SAAU,CAAA;AAAA,MACzB,MAAA,EAAQ,mBAAm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AA,MAC3C,GAAG,IAAA;AAAA,MACH,OAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,OAAO,KAAM,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,OAAM,QAAY,KAAA;AAC3C,MAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,QAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,QAAQ,CAAA,CAAA;AAAA,OACjD;AACA,MAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AAAA,KACtB,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
3
+ import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
4
+
5
+ const BooleanCheck = (props) => {
6
+ return !!props.checkResult.result ? /* @__PURE__ */ React.createElement(CheckCircleOutline, { color: "primary" }) : /* @__PURE__ */ React.createElement(ErrorOutlineIcon, { color: "error" });
7
+ };
8
+ const isBooleanCheckFailed = (checkResult) => !checkResult.result;
9
+
10
+ export { BooleanCheck, isBooleanCheckFailed };
11
+ //# sourceMappingURL=BooleanCheck.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BooleanCheck.esm.js","sources":["../../../src/components/BooleanCheck/BooleanCheck.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\n\n/**\n * @public\n */\nexport const BooleanCheck = (props: { checkResult: CheckResult }) => {\n return !!props.checkResult.result ? (\n <CheckCircleOutline color=\"primary\" />\n ) : (\n <ErrorOutlineIcon color=\"error\" />\n );\n};\n\n/**\n * @public\n */\nexport const isBooleanCheckFailed = (checkResult: CheckResult) =>\n !checkResult.result;\n"],"names":[],"mappings":";;;;AAwBa,MAAA,YAAA,GAAe,CAAC,KAAwC,KAAA;AACnE,EAAA,OAAO,CAAC,CAAC,KAAM,CAAA,WAAA,CAAY,MACzB,mBAAA,KAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,KAAA,EAAM,SAAU,EAAA,CAAA,mBAEnC,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,OAAM,OAAQ,EAAA,CAAA,CAAA;AAEpC,EAAA;AAKO,MAAM,oBAAuB,GAAA,CAAC,WACnC,KAAA,CAAC,WAAY,CAAA;;;;"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { BooleanCheck, isBooleanCheckFailed } from './BooleanCheck/BooleanCheck.esm.js';
3
+
4
+ const jsonRulesEngineCheckResultRenderer = {
5
+ type: "json-rules-engine",
6
+ component: (checkResult) => /* @__PURE__ */ React.createElement(BooleanCheck, { checkResult }),
7
+ isFailed: isBooleanCheckFailed
8
+ };
9
+
10
+ export { jsonRulesEngineCheckResultRenderer };
11
+ //# sourceMappingURL=CheckResultRenderer.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckResultRenderer.esm.js","sources":["../../src/components/CheckResultRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport React from 'react';\nimport { BooleanCheck, isBooleanCheckFailed } from './BooleanCheck';\n\n/**\n * Defines a react component that is responsible for rendering a result of a given type.\n *\n * @public\n */\nexport type CheckResultRenderer = {\n type: string;\n component: (check: CheckResult) => React.ReactElement;\n description?: (check: CheckResult) => string | React.ReactElement;\n isFailed?: (check: CheckResult) => boolean;\n};\n\n/**\n * Default renderer for json-rules-engine check results.\n *\n * @public\n */\nexport const jsonRulesEngineCheckResultRenderer: CheckResultRenderer = {\n type: 'json-rules-engine',\n component: (checkResult: CheckResult) => (\n <BooleanCheck checkResult={checkResult} />\n ),\n isFailed: isBooleanCheckFailed,\n};\n"],"names":[],"mappings":";;;AAqCO,MAAM,kCAA0D,GAAA;AAAA,EACrE,IAAM,EAAA,mBAAA;AAAA,EACN,SAAW,EAAA,CAAC,WACV,qBAAA,KAAA,CAAA,aAAA,CAAC,gBAAa,WAA0B,EAAA,CAAA;AAAA,EAE1C,QAAU,EAAA,oBAAA;AACZ;;;;"}
@@ -2,22 +2,10 @@ import React, { useMemo } from 'react';
2
2
  import useAsync from 'react-use/esm/useAsync';
3
3
  import { Progress, ErrorPanel } from '@backstage/core-components';
4
4
  import { useApi } from '@backstage/core-plugin-api';
5
- import { S as ScorecardInfo } from './ScorecardInfo-DRy_gP7g.esm.js';
6
- import { techInsightsApiRef } from '../index.esm.js';
5
+ import { ScorecardInfo } from '../ScorecardsInfo/ScorecardInfo.esm.js';
6
+ import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
7
7
  import { useEntity } from '@backstage/plugin-catalog-react';
8
8
  import { getCompoundEntityRef } from '@backstage/catalog-model';
9
- import '@material-ui/core/Grid';
10
- import '@material-ui/core/Typography';
11
- import '@material-ui/core/styles';
12
- import '@material-ui/lab/Alert';
13
- import './ScorecardsList-mU3LQTf9.esm.js';
14
- import '@material-ui/core/List';
15
- import '@material-ui/core/ListItem';
16
- import '@material-ui/core/ListItemText';
17
- import '@backstage/errors';
18
- import '@material-ui/icons/CheckCircleOutline';
19
- import '@material-ui/icons/ErrorOutline';
20
- import 'qs';
21
9
 
22
10
  const ScorecardsCard = (props) => {
23
11
  const { title, description, checksId, onlyFailed } = props;
@@ -59,4 +47,4 @@ const ScorecardsCard = (props) => {
59
47
  };
60
48
 
61
49
  export { ScorecardsCard };
62
- //# sourceMappingURL=index-Dk00aaon.esm.js.map
50
+ //# sourceMappingURL=ScorecardsCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardsCard.esm.js","sources":["../../../src/components/ScorecardsCard/ScorecardsCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ErrorPanel, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport { techInsightsApiRef } from '../../api/TechInsightsApi';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\nexport const ScorecardsCard = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n onlyFailed?: boolean;\n}) => {\n const { title, description, checksId, onlyFailed } = props;\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { value, loading, error } = useAsync(\n async () => await api.runChecks(getCompoundEntityRef(entity), checksId),\n [api, entity, JSON.stringify(checksId)],\n );\n\n const checkResultRenderers = useMemo(() => {\n if (!onlyFailed || !value) return {};\n\n const types = [...new Set(value.map(({ check }) => check.type))];\n const renderers = api.getCheckResultRenderers(types);\n return Object.fromEntries(\n renderers.map(renderer => [renderer.type, renderer]),\n );\n }, [api, value, onlyFailed]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const filteredValue = !onlyFailed\n ? value || []\n : (value || []).filter(val =>\n checkResultRenderers[val.check.type]?.isFailed?.(val),\n );\n\n return (\n <ScorecardInfo\n title={title}\n description={description}\n checkResults={filteredValue}\n noWarning={onlyFailed}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBa,MAAA,cAAA,GAAiB,CAAC,KAKzB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,WAAa,EAAA,QAAA,EAAU,YAAe,GAAA,KAAA,CAAA;AACrD,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAA,CAAI,UAAU,oBAAqB,CAAA,MAAM,GAAG,QAAQ,CAAA;AAAA,IACtE,CAAC,GAAK,EAAA,MAAA,EAAQ,IAAK,CAAA,SAAA,CAAU,QAAQ,CAAC,CAAA;AAAA,GACxC,CAAA;AAEA,EAAM,MAAA,oBAAA,GAAuB,QAAQ,MAAM;AACzC,IAAI,IAAA,CAAC,cAAc,CAAC,KAAA;AAAO,MAAA,OAAO,EAAC,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,KAAM,CAAA,GAAA,CAAI,CAAC,EAAE,KAAM,EAAA,KAAM,KAAM,CAAA,IAAI,CAAC,CAAC,CAAA,CAAA;AAC/D,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,uBAAA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"sourcesContent":[],"names":[],"mappings":""}
@@ -2,22 +2,12 @@ import React from 'react';
2
2
  import useAsync from 'react-use/esm/useAsync';
3
3
  import { Progress, Page, Content } from '@backstage/core-components';
4
4
  import { useApi } from '@backstage/core-plugin-api';
5
- import { S as ScorecardInfo } from './ScorecardInfo-DRy_gP7g.esm.js';
5
+ import { ScorecardInfo } from '../ScorecardsInfo/ScorecardInfo.esm.js';
6
6
  import Alert from '@material-ui/lab/Alert';
7
- import { techInsightsApiRef } from '../index.esm.js';
7
+ import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
8
8
  import { makeStyles } from '@material-ui/core/styles';
9
9
  import { useEntity } from '@backstage/plugin-catalog-react';
10
10
  import { getCompoundEntityRef } from '@backstage/catalog-model';
11
- import '@material-ui/core/Grid';
12
- import '@material-ui/core/Typography';
13
- import './ScorecardsList-mU3LQTf9.esm.js';
14
- import '@material-ui/core/List';
15
- import '@material-ui/core/ListItem';
16
- import '@material-ui/core/ListItemText';
17
- import '@backstage/errors';
18
- import '@material-ui/icons/CheckCircleOutline';
19
- import '@material-ui/icons/ErrorOutline';
20
- import 'qs';
21
11
 
22
12
  const useStyles = makeStyles(() => ({
23
13
  contentScorecards: {
@@ -49,4 +39,4 @@ const ScorecardsContent = (props) => {
49
39
  };
50
40
 
51
41
  export { ScorecardsContent };
52
- //# sourceMappingURL=index-DYpZtEuv.esm.js.map
42
+ //# sourceMappingURL=ScorecardContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardContent.esm.js","sources":["../../../src/components/ScorecardsContent/ScorecardContent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Content, Page, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport Alert from '@material-ui/lab/Alert';\nimport { techInsightsApiRef } from '../../api/TechInsightsApi';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\nconst useStyles = makeStyles(() => ({\n contentScorecards: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport const ScorecardsContent = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n}) => {\n const { title, description, checksId } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n const { namespace, kind, name } = getCompoundEntityRef(useEntity().entity);\n const { value, loading, error } = useAsync(\n async () => await api.runChecks({ namespace, kind, name }, checksId),\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n return (\n <Page themeId=\"home\">\n <Content className={classes.contentScorecards}>\n <ScorecardInfo\n title={title}\n description={description}\n checkResults={value || []}\n />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,iBAAmB,EAAA;AAAA,IACjB,WAAa,EAAA,CAAA;AAAA,IACb,YAAc,EAAA,CAAA;AAAA,GAChB;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,iBAAA,GAAoB,CAAC,KAI5B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,WAAa,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AACzC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAM,MAAA,EAAE,WAAW,IAAM,EAAA,IAAA,KAAS,oBAAqB,CAAA,SAAA,GAAY,MAAM,CAAA,CAAA;AACzE,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAI,CAAA,SAAA,CAAU,EAAE,SAAW,EAAA,IAAA,EAAM,IAAK,EAAA,EAAG,QAAQ,CAAA;AAAA,GACrE,CAAA;AAEA,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAA,EAAS,MAAM,OAAQ,CAAA,CAAA;AAAA,GAChD;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,OAAQ,EAAA,EAAA,SAAA,EAAW,QAAQ,iBAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA,EAAc,SAAS,EAAC;AAAA,KAAA;AAAA,GAE5B,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardsContent } from './ScorecardContent.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,7 +4,7 @@ import Typography from '@material-ui/core/Typography';
4
4
  import { makeStyles } from '@material-ui/core/styles';
5
5
  import { InfoCard } from '@backstage/core-components';
6
6
  import Alert from '@material-ui/lab/Alert';
7
- import { S as ScorecardsList } from './ScorecardsList-mU3LQTf9.esm.js';
7
+ import { ScorecardsList } from '../ScorecardsList/ScorecardsList.esm.js';
8
8
 
9
9
  const useStyles = makeStyles((theme) => ({
10
10
  subheader: {
@@ -40,5 +40,5 @@ const ScorecardInfo = (props) => {
40
40
  );
41
41
  };
42
42
 
43
- export { ScorecardInfo as S };
44
- //# sourceMappingURL=ScorecardInfo-DRy_gP7g.esm.js.map
43
+ export { ScorecardInfo };
44
+ //# sourceMappingURL=ScorecardInfo.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardInfo.esm.js","sources":["../../../src/components/ScorecardsInfo/ScorecardInfo.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode } from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { InfoCard } from '@backstage/core-components';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { ScorecardsList } from '../ScorecardsList';\n\nconst useStyles = makeStyles(theme => ({\n subheader: {\n fontWeight: 'bold',\n paddingLeft: theme.spacing(0.5),\n },\n}));\n\nconst infoCard = (\n title: ReactNode,\n description: string | undefined,\n className: string,\n element: JSX.Element,\n) => (\n <Grid item xs={12}>\n <InfoCard title={title}>\n {description && (\n <Typography className={className} variant=\"body1\" gutterBottom>\n {description}\n </Typography>\n )}\n <Grid item xs={12}>\n {element}\n </Grid>\n </InfoCard>\n </Grid>\n);\n\nexport const ScorecardInfo = (props: {\n checkResults: CheckResult[];\n title: ReactNode;\n description?: string;\n noWarning?: boolean;\n}) => {\n const { checkResults, title, description, noWarning } = props;\n const classes = useStyles();\n\n if (!checkResults.length) {\n if (noWarning) {\n return infoCard(\n title,\n description,\n classes.subheader,\n <Alert severity=\"info\">\n All checks passed, or no checks have been performed yet\n </Alert>,\n );\n }\n return infoCard(\n title,\n description,\n classes.subheader,\n <Alert severity=\"warning\">No checks have any data yet.</Alert>,\n );\n }\n\n return infoCard(\n title,\n description,\n classes.subheader,\n <ScorecardsList checkResults={checkResults} />,\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,UAAY,EAAA,MAAA;AAAA,IACZ,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GAChC;AACF,CAAE,CAAA,CAAA,CAAA;AAEF,MAAM,QAAW,GAAA,CACf,KACA,EAAA,WAAA,EACA,WACA,OAEA,qBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,KACP,EAAA,EAAA,WAAA,oBACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAsB,EAAA,OAAA,EAAQ,OAAQ,EAAA,YAAA,EAAY,QAC3D,WACH,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,EACZ,EAAA,EAAA,OACH,CACF,CACF,CAAA,CAAA;AAGW,MAAA,aAAA,GAAgB,CAAC,KAKxB,KAAA;AACJ,EAAA,MAAM,EAAE,YAAA,EAAc,KAAO,EAAA,WAAA,EAAa,WAAc,GAAA,KAAA,CAAA;AACxD,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EAAI,IAAA,CAAC,aAAa,MAAQ,EAAA;AACxB,IAAA,IAAI,SAAW,EAAA;AACb,MAAO,OAAA,QAAA;AAAA,QACL,KAAA;AAAA,QACA,WAAA;AAAA,QACA,OAAQ,CAAA,SAAA;AAAA,wBACP,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,MAAA,EAAA,EAAO,yDAEvB,CAAA;AAAA,OACF,CAAA;AAAA,KACF;AACA,IAAO,OAAA,QAAA;AAAA,MACL,KAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAQ,CAAA,SAAA;AAAA,sBACP,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,SAAA,EAAA,EAAU,8BAA4B,CAAA;AAAA,KACxD,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,QAAA;AAAA,IACL,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAQ,CAAA,SAAA;AAAA,oBACR,KAAA,CAAA,aAAA,CAAC,kBAAe,YAA4B,EAAA,CAAA;AAAA,GAC9C,CAAA;AACF;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardInfo } from './ScorecardInfo.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,7 +4,7 @@ import List from '@material-ui/core/List';
4
4
  import ListItem from '@material-ui/core/ListItem';
5
5
  import ListItemText from '@material-ui/core/ListItemText';
6
6
  import { makeStyles } from '@material-ui/core/styles';
7
- import { techInsightsApiRef } from '../index.esm.js';
7
+ import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
8
8
  import '@backstage/errors';
9
9
  import '@backstage/catalog-model';
10
10
  import '@material-ui/icons/CheckCircleOutline';
@@ -41,5 +41,5 @@ const ScorecardsList = (props) => {
41
41
  }));
42
42
  };
43
43
 
44
- export { ScorecardsList as S };
45
- //# sourceMappingURL=ScorecardsList-mU3LQTf9.esm.js.map
44
+ export { ScorecardsList };
45
+ //# sourceMappingURL=ScorecardsList.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardsList.esm.js","sources":["../../../src/components/ScorecardsList/ScorecardsList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { techInsightsApiRef } from '../../api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { MarkdownContent } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\n\nexport const ScorecardsList = (props: { checkResults: CheckResult[] }) => {\n const { checkResults } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List>\n {checkResults.map((result, index) => {\n const description = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n )?.description;\n\n return (\n <ListItem key={result.check.id}>\n <ListItemText\n key={index}\n primary={result.check.name}\n secondary={\n description ? (\n description(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n )\n }\n className={classes.listItemText}\n />\n {checkResultRenderers\n .find(({ type }) => type === result.check.type)\n ?.component(result) ?? (\n <Alert severity=\"error\">Unknown type.</Alert>\n )}\n </ListItem>\n );\n })}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;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AAA,CAAY,MAAM,CAAA,uCAEjB,eAAgB,EAAA,EAAA,OAAA,EAAS,MAAO,CAAA,KAAA,CAAM,WAAa,EAAA,CAAA;AAAA,QAGxD,WAAW,OAAQ,CAAA,YAAA;AAAA,OAAA;AAAA,KACrB,EAAA,CACC,gCACE,IAAK,CAAA,CAAC,EAAE,IAAK,EAAA,KAAM,SAAS,MAAO,CAAA,KAAA,CAAM,IAAI,CAD/C,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAEG,UAAU,MAFb,CAAA,KAAA,IAAA,GAAA,EAAA,uCAGE,KAAM,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,EAAA,eAAa,CAEzC,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardsList } from './ScorecardsList.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,16 +1,10 @@
1
- import React, { useState } from 'react';
2
- import { ErrorPanel, Page, Header, HeaderLabel, Content, Table } from '@backstage/core-components';
3
- import { useApi } from '@backstage/core-plugin-api';
4
- import { techInsightsApiRef } from '../index.esm.js';
1
+ import React from 'react';
2
+ import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
5
3
  import '@backstage/errors';
6
4
  import '@backstage/catalog-model';
7
5
  import '@material-ui/icons/CheckCircleOutline';
8
6
  import '@material-ui/icons/ErrorOutline';
9
7
  import 'qs';
10
- import useAsync from 'react-use/lib/useAsync';
11
- import { EntityRefLink } from '@backstage/plugin-catalog-react';
12
- import { S as ScorecardsList } from './ScorecardsList-mU3LQTf9.esm.js';
13
- import Grid from '@material-ui/core/Grid';
14
8
  import Typography from '@material-ui/core/Typography';
15
9
  import Autocomplete from '@material-ui/lab/Autocomplete';
16
10
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
@@ -22,10 +16,9 @@ import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
22
16
  import CheckBoxIcon from '@material-ui/icons/CheckBox';
23
17
  import Checkbox from '@material-ui/core/Checkbox';
24
18
  import Tooltip from '@material-ui/core/Tooltip';
25
- import '@material-ui/core/List';
26
- import '@material-ui/core/ListItem';
27
- import '@material-ui/core/ListItemText';
28
- import '@material-ui/lab/Alert';
19
+ import { useApi } from '@backstage/core-plugin-api';
20
+ import useAsync from 'react-use/lib/useAsync';
21
+ import { ErrorPanel } from '@backstage/core-components';
29
22
 
30
23
  const useStyles = makeStyles({
31
24
  fullWidth: { width: "100%" },
@@ -65,8 +58,12 @@ function RenderOptionLabel(props) {
65
58
  }
66
59
  ));
67
60
  }
61
+ const withResultsOptions = [
62
+ { label: "Yes", value: true },
63
+ { label: "No", value: false }
64
+ ];
68
65
  const Filters = (props) => {
69
- const { checksChanged } = props;
66
+ const { checksChanged, withResultsChanged } = props;
70
67
  const api = useApi(techInsightsApiRef);
71
68
  const { value, loading, error } = useAsync(async () => {
72
69
  return api.getAllChecks();
@@ -74,7 +71,7 @@ const Filters = (props) => {
74
71
  if (error) {
75
72
  return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
76
73
  }
77
- return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button", component: "label" }, "Checks", /* @__PURE__ */ React.createElement(
74
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button", component: "label" }, "Checks", /* @__PURE__ */ React.createElement(
78
75
  Autocomplete,
79
76
  {
80
77
  multiple: true,
@@ -93,47 +90,24 @@ const Filters = (props) => {
93
90
  popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
94
91
  renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
95
92
  }
96
- )));
97
- };
98
-
99
- const tableColumns = [
100
- {
101
- field: "entity",
102
- title: "Entity",
103
- render: (row) => /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: row.entity })
104
- },
105
- {
106
- field: "results",
107
- title: "Results",
108
- render: (row) => /* @__PURE__ */ React.createElement(ScorecardsList, { checkResults: row.results })
109
- }
110
- ];
111
- const ScorecardsPage = () => {
112
- var _a, _b, _c;
113
- const api = useApi(techInsightsApiRef);
114
- const [filterSelectedChecks, setFilterSelectedChecks] = useState([]);
115
- const { value, loading, error } = useAsync(async () => {
116
- const checks = await api.getAllChecks();
117
- const result = await api.runBulkChecks([], filterSelectedChecks);
118
- return { checks, result };
119
- }, [api, filterSelectedChecks]);
120
- if (error) {
121
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
122
- }
123
- return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title: "Tech insights" }, /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Entities", value: (_a = value == null ? void 0 : value.result.length) != null ? _a : 0 }), /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Checks", value: (_b = value == null ? void 0 : value.checks.length) != null ? _b : 0 })), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, style: { width: "300px" } }, /* @__PURE__ */ React.createElement(
124
- Filters,
125
- {
126
- checksChanged: (checks) => setFilterSelectedChecks(checks)
127
- }
128
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(
129
- Table,
93
+ ))), /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button", component: "label" }, "Only with results", /* @__PURE__ */ React.createElement(
94
+ Autocomplete,
130
95
  {
131
- columns: tableColumns,
132
- data: (_c = value == null ? void 0 : value.result) != null ? _c : [],
133
- isLoading: loading
96
+ defaultValue: withResultsOptions[0],
97
+ options: withResultsOptions,
98
+ getOptionLabel: (o) => o.label,
99
+ onChange: (_, selectedItem) => {
100
+ if (selectedItem) {
101
+ withResultsChanged(selectedItem.value);
102
+ }
103
+ },
104
+ disableClearable: true,
105
+ size: "small",
106
+ popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
107
+ renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
134
108
  }
135
- )))));
109
+ ))));
136
110
  };
137
111
 
138
- export { ScorecardsPage };
139
- //# sourceMappingURL=index-Dprfu-4U.esm.js.map
112
+ export { Filters };
113
+ //# sourceMappingURL=Filters.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filters.esm.js","sources":["../../../src/components/ScorecardsPage/Filters.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Check, techInsightsApiRef } from '../../api';\nimport Typography from '@material-ui/core/Typography';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport TextField from '@material-ui/core/TextField';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ErrorPanel } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n fullWidth: { width: '100%' },\n boxLabel: {\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n },\n});\n\nconst FixedWidthFormControlLabel = withStyles(_theme => ({\n label: {\n width: '100%',\n },\n root: {\n width: '90%',\n },\n}))(FormControlLabel);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\nfunction RenderOptionLabel(props: { check: Check; isSelected: boolean }) {\n const classes = useStyles();\n const { check, isSelected } = props;\n return (\n <Box className={classes.fullWidth}>\n <FixedWidthFormControlLabel\n className={classes.fullWidth}\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={isSelected}\n />\n }\n onClick={event => event.preventDefault()}\n label={\n <Tooltip title={check.id}>\n <Box display=\"flex\" alignItems=\"center\">\n <Box className={classes.boxLabel}>\n <Typography noWrap>{check.name}</Typography>\n </Box>\n </Box>\n </Tooltip>\n }\n />\n </Box>\n );\n}\n\nconst withResultsOptions = [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n];\n\n/** public **/\nexport type FiltersProps = {\n checksChanged: (checks: Check[]) => void;\n withResultsChanged: (withResults: boolean) => void;\n};\n\nexport const Filters = (props: FiltersProps) => {\n const { checksChanged, withResultsChanged } = props;\n const api = useApi(techInsightsApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return api.getAllChecks();\n }, [api]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Checks\n <Autocomplete\n multiple\n disableCloseOnSelect\n options={value ?? []}\n loading={loading}\n getOptionLabel={o => o.name}\n onChange={(_: object, changedChecks) => {\n checksChanged(changedChecks);\n }}\n filterOptions={x => x}\n renderOption={(check, { selected }) => {\n return <RenderOptionLabel check={check} isSelected={selected} />;\n }}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Only with results\n <Autocomplete\n defaultValue={withResultsOptions[0]}\n options={withResultsOptions}\n getOptionLabel={o => o.label}\n onChange={(_: object, selectedItem) => {\n if (selectedItem) {\n withResultsChanged(selectedItem.value);\n }\n }}\n disableClearable\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAA,EAAW,EAAE,KAAA,EAAO,MAAO,EAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA,QAAA;AAAA,GACZ;AACF,CAAC,CAAA,CAAA;AAED,MAAM,0BAAA,GAA6B,WAAW,CAAW,MAAA,MAAA;AAAA,EACvD,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,KAAA;AAAA,GACT;AACF,CAAA,CAAE,EAAE,gBAAgB,CAAA,CAAA;AAEpB,MAAM,IAAO,mBAAA,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA,CAAA;AACxD,MAAM,WAAc,mBAAA,KAAA,CAAA,aAAA,CAAC,YAAa,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA,CAAA;AAEnD,SAAS,kBAAkB,KAA8C,EAAA;AACvE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,KAAO,EAAA,UAAA,EAAe,GAAA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AAA,EAAQ,SAAQ,UAAW,EAAA,CAAA;AAAA,KAAA;AAAA,GAErE,CACF,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,EAAI,EAAA,CAAA,EAAG,EAAI,EAAA,CAAA,EAAA,sCACb,UAAW,EAAA,EAAA,OAAA,EAAQ,QAAS,EAAA,SAAA,EAAU,WAAQ,mBAE7C,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAc,mBAAmB,CAAC,CAAA;AAAA,MAClC,OAAS,EAAA,kBAAA;AAAA,MACT,cAAA,EAAgB,OAAK,CAAE,CAAA,KAAA;AAAA,MACvB,QAAA,EAAU,CAAC,CAAA,EAAW,YAAiB,KAAA;AACrC,QAAA,IAAI,YAAc,EAAA;AAChB,UAAA,kBAAA,CAAmB,aAAa,KAAK,CAAA,CAAA;AAAA,SACvC;AAAA,OACF;AAAA,MACA,gBAAgB,EAAA,IAAA;AAAA,MAChB,IAAK,EAAA,OAAA;AAAA,MACL,SAAA,sCAAY,cAAe,EAAA,IAAA,CAAA;AAAA,MAC3B,aAAa,CAAU,MAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA,CAAA;AAAA,KAAA;AAAA,GAErE,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,61 @@
1
+ import React, { useState } from 'react';
2
+ import { ErrorPanel, Page, Header, HeaderLabel, Content, Table } from '@backstage/core-components';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
5
+ import '@backstage/errors';
6
+ import '@backstage/catalog-model';
7
+ import '@material-ui/icons/CheckCircleOutline';
8
+ import '@material-ui/icons/ErrorOutline';
9
+ import 'qs';
10
+ import useAsync from 'react-use/lib/useAsync';
11
+ import { EntityRefLink } from '@backstage/plugin-catalog-react';
12
+ import { ScorecardsList } from '../ScorecardsList/ScorecardsList.esm.js';
13
+ import Grid from '@material-ui/core/Grid';
14
+ import { Filters } from './Filters.esm.js';
15
+
16
+ const tableColumns = [
17
+ {
18
+ field: "entity",
19
+ title: "Entity",
20
+ render: (row) => /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: row.entity })
21
+ },
22
+ {
23
+ field: "results",
24
+ title: "Results",
25
+ render: (row) => /* @__PURE__ */ React.createElement(ScorecardsList, { checkResults: row.results })
26
+ }
27
+ ];
28
+ const ScorecardsPage = () => {
29
+ var _a, _b, _c;
30
+ const api = useApi(techInsightsApiRef);
31
+ const [filterSelectedChecks, setFilterSelectedChecks] = useState([]);
32
+ const [filterWithResults, setFilterWithResults] = useState(true);
33
+ const { value, loading, error } = useAsync(async () => {
34
+ const checks = await api.getAllChecks();
35
+ const result = await api.runBulkChecks([], filterSelectedChecks);
36
+ return {
37
+ checks,
38
+ result: filterWithResults ? result.filter((response) => response.results.length > 0) : result
39
+ };
40
+ }, [api, filterSelectedChecks, filterWithResults]);
41
+ if (error) {
42
+ return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
43
+ }
44
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title: "Tech insights" }, /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Entities", value: (_a = value == null ? void 0 : value.result.length) != null ? _a : 0 }), /* @__PURE__ */ React.createElement(HeaderLabel, { label: "Checks", value: (_b = value == null ? void 0 : value.checks.length) != null ? _b : 0 })), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, style: { width: "300px" } }, /* @__PURE__ */ React.createElement(
45
+ Filters,
46
+ {
47
+ checksChanged: (checks) => setFilterSelectedChecks(checks),
48
+ withResultsChanged: (withResults) => setFilterWithResults(withResults)
49
+ }
50
+ )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(
51
+ Table,
52
+ {
53
+ columns: tableColumns,
54
+ data: (_c = value == null ? void 0 : value.result) != null ? _c : [],
55
+ isLoading: loading
56
+ }
57
+ )))));
58
+ };
59
+
60
+ export { ScorecardsPage };
61
+ //# sourceMappingURL=ScorecardsPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScorecardsPage.esm.js","sources":["../../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Check, techInsightsApiRef } from '../../api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { BulkCheckResponse } from '@backstage-community/plugin-tech-insights-common';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { ScorecardsList } from '../ScorecardsList';\nimport Grid from '@material-ui/core/Grid';\nimport { Filters } from './Filters';\n\nconst tableColumns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row => <ScorecardsList checkResults={row.results} />,\n },\n];\n\nexport const ScorecardsPage = () => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n const [filterWithResults, setFilterWithResults] = useState<boolean>(true);\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n\n return {\n checks,\n result: filterWithResults\n ? result.filter(response => response.results.length > 0)\n : result,\n };\n }, [api, filterSelectedChecks, filterWithResults]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n withResultsChanged={withResults =>\n setFilterWithResults(withResults)\n }\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAM,YAAoD,GAAA;AAAA,EACxD;AAAA,IACE,KAAO,EAAA,QAAA;AAAA,IACP,KAAO,EAAA,QAAA;AAAA,IACP,QAAQ,CAAO,GAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,SAAA,EAAW,IAAI,MAAQ,EAAA,CAAA;AAAA,GACvD;AAAA,EACA;AAAA,IACE,KAAO,EAAA,SAAA;AAAA,IACP,KAAO,EAAA,SAAA;AAAA,IACP,QAAQ,CAAO,GAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAAA,EAAA,YAAA,EAAc,IAAI,OAAS,EAAA,CAAA;AAAA,GAC5D;AACF,CAAA,CAAA;AAEO,MAAM,iBAAiB,MAAM;AAhDpC,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAiDE,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAA,MAAM,CAAC,oBAAsB,EAAA,uBAAuB,CAAI,GAAA,QAAA,CAAkB,EAAE,CAAA,CAAA;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,EAAI,MAAC,KAAO,EAAA,EAAE,KAAO,EAAA,OAAA,EACzB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAe,CAAU,MAAA,KAAA,uBAAA,CAAwB,MAAM,CAAA;AAAA,MACvD,kBAAA,EAAoB,CAClB,WAAA,KAAA,oBAAA,CAAqB,WAAW,CAAA;AAAA,KAAA;AAAA,GAGtC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACX,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAM,EAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAO,MAAP,KAAA,IAAA,GAAA,EAAA,GAAiB,EAAC;AAAA,MACxB,SAAW,EAAA,OAAA;AAAA,KAAA;AAAA,GAEf,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { ScorecardsPage } from './ScorecardsPage.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.esm.js CHANGED
@@ -1,157 +1,6 @@
1
- import { createRouteRef, createApiRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
2
- import { ResponseError } from '@backstage/errors';
3
- import { stringifyEntityRef } from '@backstage/catalog-model';
4
- import React from 'react';
5
- import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
6
- import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
7
- import qs from 'qs';
8
-
9
- const rootRouteRef = createRouteRef({
10
- id: "tech-insights"
11
- });
12
-
13
- const techInsightsApiRef = createApiRef({
14
- id: "plugin.techinsights.service"
15
- });
16
-
17
- const BooleanCheck = (props) => {
18
- return !!props.checkResult.result ? /* @__PURE__ */ React.createElement(CheckCircleOutline, { color: "primary" }) : /* @__PURE__ */ React.createElement(ErrorOutlineIcon, { color: "error" });
19
- };
20
- const isBooleanCheckFailed = (checkResult) => !checkResult.result;
21
-
22
- const jsonRulesEngineCheckResultRenderer = {
23
- type: "json-rules-engine",
24
- component: (checkResult) => /* @__PURE__ */ React.createElement(BooleanCheck, { checkResult }),
25
- isFailed: isBooleanCheckFailed
26
- };
27
-
28
- var __defProp = Object.defineProperty;
29
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
30
- var __publicField = (obj, key, value) => {
31
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
- return value;
33
- };
34
- class TechInsightsClient {
35
- constructor(options) {
36
- __publicField(this, "discoveryApi");
37
- __publicField(this, "identityApi");
38
- __publicField(this, "renderers");
39
- this.discoveryApi = options.discoveryApi;
40
- this.identityApi = options.identityApi;
41
- this.renderers = options.renderers;
42
- }
43
- async getFacts(entity, facts) {
44
- const query = qs.stringify({
45
- entity: stringifyEntityRef(entity),
46
- ids: facts
47
- });
48
- return await this.api(`/facts/latest?${query}`);
49
- }
50
- getCheckResultRenderers(types) {
51
- var _a;
52
- const renderers = (_a = this.renderers) != null ? _a : [jsonRulesEngineCheckResultRenderer];
53
- return renderers.filter((d) => types.includes(d.type));
54
- }
55
- async getAllChecks() {
56
- return this.api("/checks");
57
- }
58
- async getFactSchemas() {
59
- return this.api("/fact-schemas");
60
- }
61
- async runChecks(entityParams, checks) {
62
- const { namespace, kind, name } = entityParams;
63
- const requestBody = { checks };
64
- return this.api(
65
- `/checks/run/${encodeURIComponent(namespace)}/${encodeURIComponent(
66
- kind
67
- )}/${encodeURIComponent(name)}`,
68
- {
69
- method: "POST",
70
- body: JSON.stringify(requestBody)
71
- }
72
- );
73
- }
74
- async runBulkChecks(entities, checks) {
75
- const checkIds = checks ? checks.map((check) => check.id) : [];
76
- const requestBody = {
77
- entities,
78
- checks: checkIds.length > 0 ? checkIds : void 0
79
- };
80
- return this.api("/checks/run", {
81
- method: "POST",
82
- body: JSON.stringify(requestBody)
83
- });
84
- }
85
- async api(path, init) {
86
- const url = await this.discoveryApi.getBaseUrl("tech-insights");
87
- const { token } = await this.identityApi.getCredentials();
88
- const headers = new Headers(init == null ? void 0 : init.headers);
89
- if (!headers.has("content-type"))
90
- headers.set("content-type", "application/json");
91
- if (token && !headers.has("authorization")) {
92
- headers.set("authorization", `Bearer ${token}`);
93
- }
94
- const request = new Request(`${url}${path}`, {
95
- ...init,
96
- headers
97
- });
98
- return fetch(request).then(async (response) => {
99
- if (!response.ok) {
100
- throw await ResponseError.fromResponse(response);
101
- }
102
- return response.json();
103
- });
104
- }
105
- }
106
-
107
- const techInsightsPlugin = createPlugin({
108
- id: "tech-insights",
109
- apis: [
110
- createApiFactory({
111
- api: techInsightsApiRef,
112
- deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
113
- factory: ({ discoveryApi, identityApi }) => new TechInsightsClient({ discoveryApi, identityApi })
114
- })
115
- ],
116
- routes: {
117
- root: rootRouteRef
118
- }
119
- });
120
- const ScorecardInfo = techInsightsPlugin.provide(
121
- createRoutableExtension({
122
- name: "ScorecardInfo",
123
- component: () => import('./esm/index-B0n7xKVB.esm.js').then((m) => m.ScorecardInfo),
124
- mountPoint: rootRouteRef
125
- })
126
- );
127
- const ScorecardsList = techInsightsPlugin.provide(
128
- createRoutableExtension({
129
- name: "ScorecardsList",
130
- component: () => import('./esm/index-B5eokOBn.esm.js').then((m) => m.ScorecardsList),
131
- mountPoint: rootRouteRef
132
- })
133
- );
134
- const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(
135
- createRoutableExtension({
136
- name: "EntityTechInsightsScorecardContent",
137
- component: () => import('./esm/index-DYpZtEuv.esm.js').then((m) => m.ScorecardsContent),
138
- mountPoint: rootRouteRef
139
- })
140
- );
141
- const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(
142
- createRoutableExtension({
143
- name: "EntityTechInsightsScorecardCard",
144
- component: () => import('./esm/index-Dk00aaon.esm.js').then((m) => m.ScorecardsCard),
145
- mountPoint: rootRouteRef
146
- })
147
- );
148
- const TechInsightsScorecardPage = techInsightsPlugin.provide(
149
- createRoutableExtension({
150
- name: "TechInsightsScorecardPage",
151
- component: () => import('./esm/index-Dprfu-4U.esm.js').then((m) => m.ScorecardsPage),
152
- mountPoint: rootRouteRef
153
- })
154
- );
155
-
156
- export { BooleanCheck, EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsClient, TechInsightsScorecardPage, jsonRulesEngineCheckResultRenderer, techInsightsApiRef, techInsightsPlugin };
1
+ export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsScorecardPage, techInsightsPlugin } from './plugin.esm.js';
2
+ export { techInsightsApiRef } from './api/TechInsightsApi.esm.js';
3
+ export { TechInsightsClient } from './api/TechInsightsClient.esm.js';
4
+ export { BooleanCheck } from './components/BooleanCheck/BooleanCheck.esm.js';
5
+ export { jsonRulesEngineCheckResultRenderer } from './components/CheckResultRenderer.esm.js';
157
6
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/routes.ts","../src/api/TechInsightsApi.ts","../src/components/BooleanCheck/BooleanCheck.tsx","../src/components/CheckResultRenderer.tsx","../src/api/TechInsightsClient.ts","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'tech-insights',\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport {\n CheckResult,\n BulkCheckResponse,\n FactSchema,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { Check, InsightFacts } from './types';\nimport { CheckResultRenderer } from '../components/CheckResultRenderer';\nimport { CompoundEntityRef } from '@backstage/catalog-model';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link TechInsightsApi}\n *\n * @public\n */\nexport const techInsightsApiRef = createApiRef<TechInsightsApi>({\n id: 'plugin.techinsights.service',\n});\n\n/**\n * API client interface for the Tech Insights plugin\n *\n * @public\n */\nexport interface TechInsightsApi {\n getCheckResultRenderers: (types: string[]) => CheckResultRenderer[];\n getAllChecks(): Promise<Check[]>;\n runChecks(\n entityParams: CompoundEntityRef,\n checks?: string[],\n ): Promise<CheckResult[]>;\n runBulkChecks(\n entities: CompoundEntityRef[],\n checks?: Check[],\n ): Promise<BulkCheckResponse>;\n getFacts(entity: CompoundEntityRef, facts: string[]): Promise<InsightFacts>;\n getFactSchemas(): Promise<FactSchema[]>;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\n\n/**\n * @public\n */\nexport const BooleanCheck = (props: { checkResult: CheckResult }) => {\n return !!props.checkResult.result ? (\n <CheckCircleOutline color=\"primary\" />\n ) : (\n <ErrorOutlineIcon color=\"error\" />\n );\n};\n\n/**\n * @public\n */\nexport const isBooleanCheckFailed = (checkResult: CheckResult) =>\n !checkResult.result;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport React from 'react';\nimport { BooleanCheck, isBooleanCheckFailed } from './BooleanCheck';\n\n/**\n * Defines a react component that is responsible for rendering a result of a given type.\n *\n * @public\n */\nexport type CheckResultRenderer = {\n type: string;\n component: (check: CheckResult) => React.ReactElement;\n description?: (check: CheckResult) => string | React.ReactElement;\n isFailed?: (check: CheckResult) => boolean;\n};\n\n/**\n * Default renderer for json-rules-engine check results.\n *\n * @public\n */\nexport const jsonRulesEngineCheckResultRenderer: CheckResultRenderer = {\n type: 'json-rules-engine',\n component: (checkResult: CheckResult) => (\n <BooleanCheck checkResult={checkResult} />\n ),\n isFailed: isBooleanCheckFailed,\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TechInsightsApi } from './TechInsightsApi';\nimport {\n BulkCheckResponse,\n CheckResult,\n FactSchema,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { Check, InsightFacts } from './types';\nimport { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\n\nimport {\n CheckResultRenderer,\n jsonRulesEngineCheckResultRenderer,\n} from '../components/CheckResultRenderer';\nimport qs from 'qs';\n\n/** @public */\nexport class TechInsightsClient implements TechInsightsApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly identityApi: IdentityApi;\n private readonly renderers?: CheckResultRenderer[];\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n renderers?: CheckResultRenderer[];\n }) {\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n this.renderers = options.renderers;\n }\n\n async getFacts(\n entity: CompoundEntityRef,\n facts: string[],\n ): Promise<InsightFacts> {\n const query = qs.stringify({\n entity: stringifyEntityRef(entity),\n ids: facts,\n });\n return await this.api<InsightFacts>(`/facts/latest?${query}`);\n }\n\n getCheckResultRenderers(types: string[]): CheckResultRenderer[] {\n const renderers = this.renderers ?? [jsonRulesEngineCheckResultRenderer];\n return renderers.filter(d => types.includes(d.type));\n }\n\n async getAllChecks(): Promise<Check[]> {\n return this.api('/checks');\n }\n\n async getFactSchemas(): Promise<FactSchema[]> {\n return this.api('/fact-schemas');\n }\n\n async runChecks(\n entityParams: CompoundEntityRef,\n checks?: string[],\n ): Promise<CheckResult[]> {\n const { namespace, kind, name } = entityParams;\n const requestBody = { checks };\n return this.api(\n `/checks/run/${encodeURIComponent(namespace)}/${encodeURIComponent(\n kind,\n )}/${encodeURIComponent(name)}`,\n {\n method: 'POST',\n body: JSON.stringify(requestBody),\n },\n );\n }\n\n async runBulkChecks(\n entities: CompoundEntityRef[],\n checks?: Check[],\n ): Promise<BulkCheckResponse> {\n const checkIds = checks ? checks.map(check => check.id) : [];\n const requestBody = {\n entities,\n checks: checkIds.length > 0 ? checkIds : undefined,\n };\n return this.api('/checks/run', {\n method: 'POST',\n body: JSON.stringify(requestBody),\n });\n }\n\n private async api<T>(path: string, init?: RequestInit): Promise<T> {\n const url = await this.discoveryApi.getBaseUrl('tech-insights');\n const { token } = await this.identityApi.getCredentials();\n\n const headers: HeadersInit = new Headers(init?.headers);\n if (!headers.has('content-type'))\n headers.set('content-type', 'application/json');\n if (token && !headers.has('authorization')) {\n headers.set('authorization', `Bearer ${token}`);\n }\n\n const request = new Request(`${url}${path}`, {\n ...init,\n headers,\n });\n\n return fetch(request).then(async response => {\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json() as Promise<T>;\n });\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { rootRouteRef } from './routes';\nimport { techInsightsApiRef } from './api/TechInsightsApi';\nimport { TechInsightsClient } from './api/TechInsightsClient';\n\n/**\n * @public\n */\nexport const techInsightsPlugin = createPlugin({\n id: 'tech-insights',\n apis: [\n createApiFactory({\n api: techInsightsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new TechInsightsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * @public\n */\nexport const ScorecardInfo = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'ScorecardInfo',\n component: () =>\n import('./components/ScorecardsInfo').then(m => m.ScorecardInfo),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardsList = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'ScorecardsList',\n component: () =>\n import('./components/ScorecardsList').then(m => m.ScorecardsList),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardContent',\n component: () =>\n import('./components/ScorecardsContent').then(m => m.ScorecardsContent),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardCard',\n component: () =>\n import('./components/ScorecardsCard').then(m => m.ScorecardsCard),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsScorecardPage = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsScorecardPage',\n component: () =>\n import('./components/ScorecardsPage').then(m => m.ScorecardsPage),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;;;;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,eAAA;AACN,CAAC,CAAA;;ACYM,MAAM,qBAAqB,YAA8B,CAAA;AAAA,EAC9D,EAAI,EAAA,6BAAA;AACN,CAAC;;ACTY,MAAA,YAAA,GAAe,CAA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IACN,SAAA,EAAW,MACT,OAAO,6BAAgC,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,iBAAiB,CAAA;AAAA,IACxE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAKO,MAAM,kCAAkC,kBAAmB,CAAA,OAAA;AAAA,EAChE,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,iCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAKO,MAAM,4BAA4B,kBAAmB,CAAA,OAAA;AAAA,EAC1D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,56 @@
1
+ import { createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
2
+ import { rootRouteRef } from './routes.esm.js';
3
+ import { techInsightsApiRef } from './api/TechInsightsApi.esm.js';
4
+ import { TechInsightsClient } from './api/TechInsightsClient.esm.js';
5
+
6
+ const techInsightsPlugin = createPlugin({
7
+ id: "tech-insights",
8
+ apis: [
9
+ createApiFactory({
10
+ api: techInsightsApiRef,
11
+ deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
12
+ factory: ({ discoveryApi, identityApi }) => new TechInsightsClient({ discoveryApi, identityApi })
13
+ })
14
+ ],
15
+ routes: {
16
+ root: rootRouteRef
17
+ }
18
+ });
19
+ const ScorecardInfo = techInsightsPlugin.provide(
20
+ createRoutableExtension({
21
+ name: "ScorecardInfo",
22
+ component: () => import('./components/ScorecardsInfo/index.esm.js').then((m) => m.ScorecardInfo),
23
+ mountPoint: rootRouteRef
24
+ })
25
+ );
26
+ const ScorecardsList = techInsightsPlugin.provide(
27
+ createRoutableExtension({
28
+ name: "ScorecardsList",
29
+ component: () => import('./components/ScorecardsList/index.esm.js').then((m) => m.ScorecardsList),
30
+ mountPoint: rootRouteRef
31
+ })
32
+ );
33
+ const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(
34
+ createRoutableExtension({
35
+ name: "EntityTechInsightsScorecardContent",
36
+ component: () => import('./components/ScorecardsContent/index.esm.js').then((m) => m.ScorecardsContent),
37
+ mountPoint: rootRouteRef
38
+ })
39
+ );
40
+ const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(
41
+ createRoutableExtension({
42
+ name: "EntityTechInsightsScorecardCard",
43
+ component: () => import('./components/ScorecardsCard/index.esm.js').then((m) => m.ScorecardsCard),
44
+ mountPoint: rootRouteRef
45
+ })
46
+ );
47
+ const TechInsightsScorecardPage = techInsightsPlugin.provide(
48
+ createRoutableExtension({
49
+ name: "TechInsightsScorecardPage",
50
+ component: () => import('./components/ScorecardsPage/index.esm.js').then((m) => m.ScorecardsPage),
51
+ mountPoint: rootRouteRef
52
+ })
53
+ );
54
+
55
+ export { EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, ScorecardInfo, ScorecardsList, TechInsightsScorecardPage, techInsightsPlugin };
56
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { rootRouteRef } from './routes';\nimport { techInsightsApiRef } from './api/TechInsightsApi';\nimport { TechInsightsClient } from './api/TechInsightsClient';\n\n/**\n * @public\n */\nexport const techInsightsPlugin = createPlugin({\n id: 'tech-insights',\n apis: [\n createApiFactory({\n api: techInsightsApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({ discoveryApi, identityApi }) =>\n new TechInsightsClient({ discoveryApi, identityApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * @public\n */\nexport const ScorecardInfo = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'ScorecardInfo',\n component: () =>\n import('./components/ScorecardsInfo').then(m => m.ScorecardInfo),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardsList = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'ScorecardsList',\n component: () =>\n import('./components/ScorecardsList').then(m => m.ScorecardsList),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardContent',\n component: () =>\n import('./components/ScorecardsContent').then(m => m.ScorecardsContent),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardCard',\n component: () =>\n import('./components/ScorecardsCard').then(m => m.ScorecardsCard),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsScorecardPage = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsScorecardPage',\n component: () =>\n import('./components/ScorecardsPage').then(m => m.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EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAKO,MAAM,kCAAkC,kBAAmB,CAAA,OAAA;AAAA,EAChE,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,iCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAKO,MAAM,4BAA4B,kBAAmB,CAAA,OAAA;AAAA,EAC1D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAClE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;;;"}
@@ -0,0 +1,8 @@
1
+ import { createRouteRef } from '@backstage/core-plugin-api';
2
+
3
+ const rootRouteRef = createRouteRef({
4
+ id: "tech-insights"
5
+ });
6
+
7
+ export { rootRouteRef };
8
+ //# sourceMappingURL=routes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'tech-insights',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,eAAA;AACN,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-tech-insights",
3
- "version": "0.3.28",
3
+ "version": "0.3.29",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin"
6
6
  },
@@ -32,12 +32,12 @@
32
32
  "test": "backstage-cli package test"
33
33
  },
34
34
  "dependencies": {
35
- "@backstage-community/plugin-tech-insights-common": "^0.2.13",
36
- "@backstage/catalog-model": "^1.4.5",
37
- "@backstage/core-components": "^0.14.4",
35
+ "@backstage-community/plugin-tech-insights-common": "^0.2.14",
36
+ "@backstage/catalog-model": "^1.5.0",
37
+ "@backstage/core-components": "^0.14.7",
38
38
  "@backstage/core-plugin-api": "^1.9.2",
39
39
  "@backstage/errors": "^1.2.4",
40
- "@backstage/plugin-catalog-react": "^1.11.3",
40
+ "@backstage/plugin-catalog-react": "^1.12.0",
41
41
  "@backstage/types": "^1.1.1",
42
42
  "@material-ui/core": "^4.12.2",
43
43
  "@material-ui/icons": "^4.9.1",
@@ -47,8 +47,8 @@
47
47
  "react-use": "^17.2.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@backstage/cli": "^0.26.3",
51
- "@backstage/dev-utils": "^1.0.31",
50
+ "@backstage/cli": "^0.26.6",
51
+ "@backstage/dev-utils": "^1.0.32",
52
52
  "@testing-library/dom": "^10.0.0",
53
53
  "@testing-library/jest-dom": "^6.0.0",
54
54
  "@testing-library/react": "^15.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScorecardInfo-DRy_gP7g.esm.js","sources":["../../src/components/ScorecardsInfo/ScorecardInfo.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode } from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { InfoCard } from '@backstage/core-components';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { ScorecardsList } from '../ScorecardsList';\n\nconst useStyles = makeStyles(theme => ({\n subheader: {\n fontWeight: 'bold',\n paddingLeft: theme.spacing(0.5),\n },\n}));\n\nconst infoCard = (\n title: ReactNode,\n description: string | undefined,\n className: string,\n element: JSX.Element,\n) => (\n <Grid item xs={12}>\n <InfoCard title={title}>\n {description && (\n <Typography className={className} variant=\"body1\" gutterBottom>\n {description}\n </Typography>\n )}\n <Grid item xs={12}>\n {element}\n </Grid>\n </InfoCard>\n </Grid>\n);\n\nexport const ScorecardInfo = (props: {\n checkResults: CheckResult[];\n title: ReactNode;\n description?: string;\n noWarning?: boolean;\n}) => {\n const { checkResults, title, description, noWarning } = props;\n const classes = useStyles();\n\n if (!checkResults.length) {\n if (noWarning) {\n return infoCard(\n title,\n description,\n classes.subheader,\n <Alert severity=\"info\">\n All checks passed, or no checks have been performed yet\n </Alert>,\n );\n }\n return infoCard(\n title,\n description,\n classes.subheader,\n <Alert severity=\"warning\">No checks have any data yet.</Alert>,\n );\n }\n\n return infoCard(\n title,\n description,\n classes.subheader,\n <ScorecardsList checkResults={checkResults} />,\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,UAAY,EAAA,MAAA;AAAA,IACZ,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GAChC;AACF,CAAE,CAAA,CAAA,CAAA;AAEF,MAAM,QAAW,GAAA,CACf,KACA,EAAA,WAAA,EACA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AAAA,GAC9C,CAAA;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScorecardsList-mU3LQTf9.esm.js","sources":["../../src/components/ScorecardsList/ScorecardsList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { techInsightsApiRef } from '../../api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport Alert from '@material-ui/lab/Alert';\nimport { MarkdownContent } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\n\nexport const ScorecardsList = (props: { checkResults: CheckResult[] }) => {\n const { checkResults } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List>\n {checkResults.map((result, index) => {\n const description = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n )?.description;\n\n return (\n <ListItem key={result.check.id}>\n <ListItemText\n key={index}\n primary={result.check.name}\n secondary={\n description ? (\n description(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n )\n }\n className={classes.listItemText}\n />\n {checkResultRenderers\n .find(({ type }) => type === result.check.type)\n ?.component(result) ?? (\n <Alert severity=\"error\">Unknown type.</Alert>\n )}\n </ListItem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AAM,CAAA,IAAA;AAAA,QACtB,SAAA,EACE,WACE,GAAA,WAAA,CAAY,MAAM,CAAA,uCAEjB,eAAgB,EAAA,EAAA,OAAA,EAAS,MAAO,CAAA,KAAA,CAAM,WAAa,EAAA,CAAA;AAAA,QAGxD,WAAW,OAAQ,CAAA,YAAA;AAAA,OAAA;AAAA,KACrB,EAAA,CACC,gCACE,IAAK,CAAA,CAAC,EAAE,IAAK,EAAA,KAAM,SAAS,MAAO,CAAA,KAAA,CAAM,IAAI,CAD/C,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAEG,UAAU,MAFb,CAAA,KAAA,IAAA,GAAA,EAAA,uCAGE,KAAM,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,EAAA,eAAa,CAEzC,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
@@ -1,19 +0,0 @@
1
- export { S as ScorecardInfo } from './ScorecardInfo-DRy_gP7g.esm.js';
2
- import 'react';
3
- import '@material-ui/core/Grid';
4
- import '@material-ui/core/Typography';
5
- import '@material-ui/core/styles';
6
- import '@backstage/core-components';
7
- import '@material-ui/lab/Alert';
8
- import './ScorecardsList-mU3LQTf9.esm.js';
9
- import '@backstage/core-plugin-api';
10
- import '@material-ui/core/List';
11
- import '@material-ui/core/ListItem';
12
- import '@material-ui/core/ListItemText';
13
- import '../index.esm.js';
14
- import '@backstage/errors';
15
- import '@backstage/catalog-model';
16
- import '@material-ui/icons/CheckCircleOutline';
17
- import '@material-ui/icons/ErrorOutline';
18
- import 'qs';
19
- //# sourceMappingURL=index-B0n7xKVB.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-B0n7xKVB.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,16 +0,0 @@
1
- export { S as ScorecardsList } from './ScorecardsList-mU3LQTf9.esm.js';
2
- import 'react';
3
- import '@backstage/core-plugin-api';
4
- import '@material-ui/core/List';
5
- import '@material-ui/core/ListItem';
6
- import '@material-ui/core/ListItemText';
7
- import '@material-ui/core/styles';
8
- import '../index.esm.js';
9
- import '@backstage/errors';
10
- import '@backstage/catalog-model';
11
- import '@material-ui/icons/CheckCircleOutline';
12
- import '@material-ui/icons/ErrorOutline';
13
- import 'qs';
14
- import '@material-ui/lab/Alert';
15
- import '@backstage/core-components';
16
- //# sourceMappingURL=index-B5eokOBn.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-B5eokOBn.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DYpZtEuv.esm.js","sources":["../../src/components/ScorecardsContent/ScorecardContent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Content, Page, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport Alert from '@material-ui/lab/Alert';\nimport { techInsightsApiRef } from '../../api/TechInsightsApi';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\nconst useStyles = makeStyles(() => ({\n contentScorecards: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport const ScorecardsContent = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n}) => {\n const { title, description, checksId } = props;\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n const { namespace, kind, name } = getCompoundEntityRef(useEntity().entity);\n const { value, loading, error } = useAsync(\n async () => await api.runChecks({ namespace, kind, name }, checksId),\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n return (\n <Page themeId=\"home\">\n <Content className={classes.contentScorecards}>\n <ScorecardInfo\n title={title}\n description={description}\n checkResults={value || []}\n />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,iBAAmB,EAAA;AAAA,IACjB,WAAa,EAAA,CAAA;AAAA,IACb,YAAc,EAAA,CAAA;AAAA,GAChB;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,iBAAA,GAAoB,CAAC,KAI5B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,WAAa,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AACzC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAM,MAAA,EAAE,WAAW,IAAM,EAAA,IAAA,KAAS,oBAAqB,CAAA,SAAA,GAAY,MAAM,CAAA,CAAA;AACzE,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAI,CAAA,SAAA,CAAU,EAAE,SAAW,EAAA,IAAA,EAAM,IAAK,EAAA,EAAG,QAAQ,CAAA;AAAA,GACrE,CAAA;AAEA,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAA,EAAS,MAAM,OAAQ,CAAA,CAAA;AAAA,GAChD;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,OAAQ,EAAA,EAAA,SAAA,EAAW,QAAQ,iBAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA,EAAc,SAAS,EAAC;AAAA,KAAA;AAAA,GAE5B,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Dk00aaon.esm.js","sources":["../../src/components/ScorecardsCard/ScorecardsCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ErrorPanel, Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ScorecardInfo } from '../ScorecardsInfo';\nimport { techInsightsApiRef } from '../../api/TechInsightsApi';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getCompoundEntityRef } from '@backstage/catalog-model';\n\nexport const ScorecardsCard = (props: {\n title: string;\n description?: string;\n checksId?: string[];\n onlyFailed?: boolean;\n}) => {\n const { title, description, checksId, onlyFailed } = props;\n const api = useApi(techInsightsApiRef);\n const { entity } = useEntity();\n const { value, loading, error } = useAsync(\n async () => await api.runChecks(getCompoundEntityRef(entity), checksId),\n [api, entity, JSON.stringify(checksId)],\n );\n\n const checkResultRenderers = useMemo(() => {\n if (!onlyFailed || !value) return {};\n\n const types = [...new Set(value.map(({ check }) => check.type))];\n const renderers = api.getCheckResultRenderers(types);\n return Object.fromEntries(\n renderers.map(renderer => [renderer.type, renderer]),\n );\n }, [api, value, onlyFailed]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const filteredValue = !onlyFailed\n ? value || []\n : (value || []).filter(val =>\n checkResultRenderers[val.check.type]?.isFailed?.(val),\n );\n\n return (\n <ScorecardInfo\n title={title}\n description={description}\n checkResults={filteredValue}\n noWarning={onlyFailed}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBa,MAAA,cAAA,GAAiB,CAAC,KAKzB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,WAAa,EAAA,QAAA,EAAU,YAAe,GAAA,KAAA,CAAA;AACrD,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAChC,YAAY,MAAM,GAAA,CAAI,UAAU,oBAAqB,CAAA,MAAM,GAAG,QAAQ,CAAA;AAAA,IACtE,CAAC,GAAK,EAAA,MAAA,EAAQ,IAAK,CAAA,SAAA,CAAU,QAAQ,CAAC,CAAA;AAAA,GACxC,CAAA;AAEA,EAAM,MAAA,oBAAA,GAAuB,QAAQ,MAAM;AACzC,IAAI,IAAA,CAAC,cAAc,CAAC,KAAA;AAAO,MAAA,OAAO,EAAC,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,KAAM,CAAA,GAAA,CAAI,CAAC,EAAE,KAAM,EAAA,KAAM,KAAM,CAAA,IAAI,CAAC,CAAC,CAAA,CAAA;AAC/D,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,uBAAA,CAAwB,KAAK,CAAA,CAAA;AACnD,IAAA,OAAO,MAAO,CAAA,WAAA;AAAA,MACZ,UAAU,GAAI,CAAA,CAAA,QAAA,KAAY,CAAC,QAAS,CAAA,IAAA,EAAM,QAAQ,CAAC,CAAA;AAAA,KACrD,CAAA;AAAA,GACC,EAAA,CAAC,GAAK,EAAA,KAAA,EAAO,UAAU,CAAC,CAAA,CAAA;AAE3B,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,KAAc,EAAA,CAAA,CAAA;AAAA,GACnC;AAEA,EAAM,MAAA,aAAA,GAAgB,CAAC,UACnB,GAAA,KAAA,IAAS,EACR,GAAA,CAAA,KAAA,IAAS,EAAI,EAAA,MAAA;AAAA,IAAO,CAAI,GAAA,KAAA;AAzD/B,MAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA0DQ,MAAA,OAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,oBAAA,CAAqB,IAAI,KAAM,CAAA,IAAI,CAAnC,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAsC,aAAtC,IAAiD,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,GAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GACnD,CAAA;AAEJ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAc,EAAA,aAAA;AAAA,MACd,SAAW,EAAA,UAAA;AAAA,KAAA;AAAA,GACb,CAAA;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Dprfu-4U.esm.js","sources":["../../src/components/ScorecardsPage/Filters.tsx","../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Check, techInsightsApiRef } from '../../api';\nimport Typography from '@material-ui/core/Typography';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport TextField from '@material-ui/core/TextField';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { ErrorPanel } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n fullWidth: { width: '100%' },\n boxLabel: {\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n },\n});\n\nconst FixedWidthFormControlLabel = withStyles(_theme => ({\n label: {\n width: '100%',\n },\n root: {\n width: '90%',\n },\n}))(FormControlLabel);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\nfunction RenderOptionLabel(props: { check: Check; isSelected: boolean }) {\n const classes = useStyles();\n const { check, isSelected } = props;\n return (\n <Box className={classes.fullWidth}>\n <FixedWidthFormControlLabel\n className={classes.fullWidth}\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={isSelected}\n />\n }\n onClick={event => event.preventDefault()}\n label={\n <Tooltip title={check.id}>\n <Box display=\"flex\" alignItems=\"center\">\n <Box className={classes.boxLabel}>\n <Typography noWrap>{check.name}</Typography>\n </Box>\n </Box>\n </Tooltip>\n }\n />\n </Box>\n );\n}\n\n/** public **/\nexport type FiltersProps = {\n checksChanged: (checks: Check[]) => void;\n};\n\nexport const Filters = (props: FiltersProps) => {\n const { checksChanged } = props;\n const api = useApi(techInsightsApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return api.getAllChecks();\n }, [api]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Checks\n <Autocomplete\n multiple\n disableCloseOnSelect\n options={value ?? []}\n loading={loading}\n getOptionLabel={o => o.name}\n onChange={(_: object, changedChecks) => {\n checksChanged(changedChecks);\n }}\n filterOptions={x => x}\n renderOption={(check, { selected }) => {\n return <RenderOptionLabel check={check} isSelected={selected} />;\n }}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Typography>\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Check, techInsightsApiRef } from '../../api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { BulkCheckResponse } from '@backstage-community/plugin-tech-insights-common';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { ScorecardsList } from '../ScorecardsList';\nimport Grid from '@material-ui/core/Grid';\nimport { Filters } from './Filters';\n\nconst tableColumns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row => <ScorecardsList checkResults={row.results} />,\n },\n];\n\nexport const ScorecardsPage = () => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n return { checks, result };\n }, [api, filterSelectedChecks]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAA,EAAW,EAAE,KAAA,EAAO,MAAO,EAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA,QAAA;AAAA,GACZ;AACF,CAAC,CAAA,CAAA;AAED,MAAM,0BAAA,GAA6B,WAAW,CAAW,MAAA,MAAA;AAAA,EACvD,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,MAAA;AAA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