@backstage-community/plugin-tech-insights 0.3.35 → 0.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @backstage-community/plugin-tech-insights
2
2
 
3
+ ## 0.3.37
4
+
5
+ ### Patch Changes
6
+
7
+ - e516773: Remove usages of deprecated references and usage of @backstage/backend-common
8
+ - e516773: Backstage version bump to v1.31.1
9
+ - Updated dependencies [e516773]
10
+ - Updated dependencies [e516773]
11
+ - @backstage-community/plugin-tech-insights-common@0.2.19
12
+
13
+ ## 0.3.36
14
+
15
+ ### Patch Changes
16
+
17
+ - 42a2c31: Export component extensions instead of routable extensions when routes aren't required (or used). ResultCheckIcon can now wrap both React components and HTML elements for onClick handling of the popup menu with links.
18
+
3
19
  ## 0.3.35
4
20
 
5
21
  ### Patch Changes
@@ -1 +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 CheckLink,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { Check, InsightFacts } from './types';\nimport { CheckResultRenderer } from '../components/CheckResultRenderer';\nimport { CompoundEntityRef, Entity } 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 isCheckResultFailed: (check: CheckResult) => boolean;\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 getLinksForEntity(\n result: CheckResult,\n entity: Entity,\n options?: { includeStaticLinks?: boolean },\n ): CheckLink[];\n}\n"],"names":[],"mappings":";;AAgCO,MAAM,qBAAqB,YAA8B,CAAA;AAAA,EAC9D,EAAI,EAAA,6BAAA;AACN,CAAC;;;;"}
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 CheckLink,\n} from '@backstage-community/plugin-tech-insights-common';\nimport {\n Check,\n InsightFacts,\n} from '@backstage-community/plugin-tech-insights-common/client';\nimport { CheckResultRenderer } from '../components/CheckResultRenderer';\nimport { CompoundEntityRef, Entity } 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 isCheckResultFailed: (check: CheckResult) => boolean;\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 getLinksForEntity(\n result: CheckResult,\n entity: Entity,\n options?: { includeStaticLinks?: boolean },\n ): CheckLink[];\n}\n"],"names":[],"mappings":";;AAmCO,MAAM,qBAAqB,YAA8B,CAAA;AAAA,EAC9D,EAAI,EAAA,6BAAA;AACN,CAAC;;;;"}
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
2
  import { useApi } from '@backstage/core-plugin-api';
3
- import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
4
3
  import IconButton from '@material-ui/core/IconButton';
5
4
  import Alert from '@material-ui/lab/Alert';
6
5
  import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
@@ -14,26 +13,30 @@ const ResultCheckIcon = (props) => {
14
13
  result,
15
14
  entity,
16
15
  disableLinksMenu,
16
+ component,
17
17
  componentProps,
18
18
  missingRendererComponent = /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Unknown type.")
19
19
  } = props;
20
- const Component = props.component ?? ListItemSecondaryAction;
21
20
  const api = useApi(techInsightsApiRef);
22
21
  const checkResultRenderer = props.checkResultRenderer ?? api.getCheckResultRenderers([result.check.type])[0];
23
22
  const [menu, setMenu] = useState();
24
23
  const iconComponent = checkResultRenderer?.component(result);
25
- const wrapActions = (component) => {
24
+ const onClick = (event) => {
25
+ menu?.open(event.currentTarget);
26
+ };
27
+ const wrapActions = (inner) => {
26
28
  if (!menu) {
27
- return component;
29
+ if (component) {
30
+ const Component = component;
31
+ return /* @__PURE__ */ React.createElement(Component, { ...componentProps }, inner);
32
+ }
33
+ return inner;
34
+ }
35
+ if (component) {
36
+ const Component = component;
37
+ return /* @__PURE__ */ React.createElement(Component, { ...componentProps, onClick }, /* @__PURE__ */ React.createElement(IconButton, { edge: "end", "aria-label": "icon" }, inner));
28
38
  }
29
- return /* @__PURE__ */ React.createElement(
30
- Component,
31
- {
32
- ...componentProps,
33
- onClick: (event) => menu?.open(event.currentTarget)
34
- },
35
- /* @__PURE__ */ React.createElement(IconButton, { edge: "end", "aria-label": "comments" }, component)
36
- );
39
+ return /* @__PURE__ */ React.createElement(IconButton, { edge: "end", "aria-label": "icon", onClick }, inner);
37
40
  };
38
41
  return /* @__PURE__ */ React.createElement(React.Fragment, null, !disableLinksMenu && /* @__PURE__ */ React.createElement(ResultLinksMenu, { result, entity, setMenu }), wrapActions(iconComponent ?? missingRendererComponent));
39
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCheckIcon.esm.js","sources":["../../../src/components/ResultCheckIcon/ResultCheckIcon.tsx"],"sourcesContent":["/*\n * Copyright 2024 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, {\n ComponentProps,\n ComponentType,\n MouseEventHandler,\n ReactNode,\n useState,\n} from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { Entity } from '@backstage/catalog-model';\n\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport IconButton from '@material-ui/core/IconButton';\nimport Alert from '@material-ui/lab/Alert';\n\nimport { techInsightsApiRef } from '../../api';\nimport { CheckResultRenderer } from '../CheckResultRenderer';\nimport { ResultLinksMenu, ResultLinksMenuInfo } from '../ResultLinksMenu';\n\n/** @public */\nexport type ResultCheckIconBaseComponent = ComponentType<{\n onClick?: MouseEventHandler | undefined;\n}>;\n\n/**\n * ResultCheckIcon props\n *\n * The only necessary prop is {@link ResultCheckIconProps.result}, but if\n * {@link ResultCheckIconProps.entity} is provided, the popup menu with links\n * will also include links specifically for this entity.\n *\n * @public\n */\nexport interface ResultCheckIconProps<C extends ResultCheckIconBaseComponent> {\n /**\n * The CheckResult object to create an icon for\n */\n result: CheckResult;\n /**\n * The entity for which this check result is created. This is optional, but if\n * provided, entity-specific links will be added to the popup menu, if any.\n */\n entity?: Entity;\n /**\n * This can optionally be provided, with a small performance improvement, if\n * it is already cashed upstream.\n */\n checkResultRenderer?: CheckResultRenderer;\n /**\n * Will disable the popup menu\n */\n disableLinksMenu?: boolean;\n /**\n * By default, the icon (and the parent `IconButton`) is wrapped inside a\n * `ListItemSecondaryAction` which handles the `onClick` to open the popup\n * menu.\n *\n * This can be changed by providing a custom component here.\n *\n * The {@link ResultCheckIconProps.componentProps} prop can be specified to\n * add props to the wrapping component.\n */\n component?: C;\n /**\n * Props to provide to the wrapping component, which by default is a\n * `ListItemSecondaryAction` but can be overridden using\n * {@link ResultCheckIconProps.component}.\n */\n componentProps?: Omit<ComponentProps<C>, 'onClick'>;\n /**\n * Override the component used to display instead of a result icon, when no\n * renderer was found for this check type.\n */\n missingRendererComponent?: ReactNode;\n}\n\nexport const ResultCheckIcon = <\n C extends ResultCheckIconBaseComponent = typeof ListItemSecondaryAction,\n>(\n props: ResultCheckIconProps<C>,\n) => {\n const {\n result,\n entity,\n disableLinksMenu,\n componentProps,\n missingRendererComponent = <Alert severity=\"error\">Unknown type.</Alert>,\n } = props;\n\n const Component = props.component ?? ListItemSecondaryAction;\n\n const api = useApi(techInsightsApiRef);\n\n const checkResultRenderer =\n props.checkResultRenderer ??\n api.getCheckResultRenderers([result.check.type])[0];\n\n const [menu, setMenu] = useState<ResultLinksMenuInfo | undefined>();\n\n const iconComponent = checkResultRenderer?.component(result);\n\n const wrapActions = (component: React.ReactElement): ReactNode => {\n if (!menu) {\n return component;\n }\n return (\n <Component\n {...componentProps}\n onClick={event => menu?.open(event.currentTarget)}\n >\n <IconButton edge=\"end\" aria-label=\"comments\">\n {component}\n </IconButton>\n </Component>\n );\n };\n\n return (\n <>\n {!disableLinksMenu && (\n <ResultLinksMenu result={result} entity={entity} setMenu={setMenu} />\n )}\n {wrapActions(iconComponent ?? missingRendererComponent)}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA6Fa,MAAA,eAAA,GAAkB,CAG7B,KACG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,MAAA;AAAA,IACA,MAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,IACA,wBAA2B,mBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,QAAA,EAAS,WAAQ,eAAa,CAAA;AAAA,GAC9D,GAAA,KAAA,CAAA;AAEJ,EAAM,MAAA,SAAA,GAAY,MAAM,SAAa,IAAA,uBAAA,CAAA;AAErC,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AAErC,EAAM,MAAA,mBAAA,GACJ,KAAM,CAAA,mBAAA,IACN,GAAI,CAAA,uBAAA,CAAwB,CAAC,MAAA,CAAO,KAAM,CAAA,IAAI,CAAC,CAAA,CAAE,CAAC,CAAA,CAAA;AAEpD,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAA0C,EAAA,CAAA;AAElE,EAAM,MAAA,aAAA,GAAgB,mBAAqB,EAAA,SAAA,CAAU,MAAM,CAAA,CAAA;AAE3D,EAAM,MAAA,WAAA,GAAc,CAAC,SAA6C,KAAA;AAChE,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAO,OAAA,SAAA,CAAA;AAAA,KACT;AACA,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACE,GAAG,cAAA;AAAA,QACJ,OAAS,EAAA,CAAA,KAAA,KAAS,IAAM,EAAA,IAAA,CAAK,MAAM,aAAa,CAAA;AAAA,OAAA;AAAA,0CAE/C,UAAW,EAAA,EAAA,IAAA,EAAK,KAAM,EAAA,YAAA,EAAW,cAC/B,SACH,CAAA;AAAA,KACF,CAAA;AAAA,GAEJ,CAAA;AAEA,EAAA,uBAEK,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,CAAC,gBACA,oBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,MAAA,EAAgB,MAAgB,EAAA,OAAA,EAAkB,CAEpE,EAAA,WAAA,CAAY,aAAiB,IAAA,wBAAwB,CACxD,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ResultCheckIcon.esm.js","sources":["../../../src/components/ResultCheckIcon/ResultCheckIcon.tsx"],"sourcesContent":["/*\n * Copyright 2024 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, {\n ElementType,\n MouseEventHandler,\n PropsWithChildren,\n ReactNode,\n useState,\n} from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { Entity } from '@backstage/catalog-model';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport Alert from '@material-ui/lab/Alert';\n\nimport { techInsightsApiRef } from '../../api';\nimport { CheckResultRenderer } from '../CheckResultRenderer';\nimport { ResultLinksMenu, ResultLinksMenuInfo } from '../ResultLinksMenu';\n\n/** @public */\nexport type ResultCheckIconBaseComponentProps = PropsWithChildren<{\n onClick?: MouseEventHandler;\n}>;\n\n/**\n * ResultCheckIcon props\n *\n * The only necessary prop is {@link ResultCheckIconProps.result}, but if\n * {@link ResultCheckIconProps.entity} is provided, the popup menu with links\n * will also include links specifically for this entity.\n *\n * @public\n */\nexport interface ResultCheckIconProps<\n P extends ResultCheckIconBaseComponentProps,\n> {\n /**\n * The CheckResult object to create an icon for\n */\n result: CheckResult;\n /**\n * The entity for which this check result is created. This is optional, but if\n * provided, entity-specific links will be added to the popup menu, if any.\n */\n entity?: Entity;\n /**\n * This can optionally be provided, with a small performance improvement, if\n * it is already cashed upstream.\n */\n checkResultRenderer?: CheckResultRenderer;\n /**\n * Will disable the popup menu\n */\n disableLinksMenu?: boolean;\n /**\n * The icon is rendered with an `IconButton` which handles the onClick.\n * To wrap this in another component, handling the onClick, pass a component,\n * such as `ListItemSecondaryAction` which handles the `onClick` to open the\n * popup menu.\n *\n * The {@link ResultCheckIconProps.componentProps} prop can be specified to\n * add props to the wrapping component.\n */\n component?: ElementType<P>;\n /**\n * Props to provide to the wrapping component\n * {@link ResultCheckIconProps.component}.\n */\n componentProps?: Omit<P, 'onClick' | 'children'>;\n /**\n * Override the component used to display instead of a result icon, when no\n * renderer was found for this check type.\n */\n missingRendererComponent?: ReactNode;\n}\n\nexport const ResultCheckIcon = <P extends ResultCheckIconBaseComponentProps>(\n props: ResultCheckIconProps<P>,\n) => {\n const {\n result,\n entity,\n disableLinksMenu,\n component,\n componentProps,\n missingRendererComponent = <Alert severity=\"error\">Unknown type.</Alert>,\n } = props;\n\n const api = useApi(techInsightsApiRef);\n\n const checkResultRenderer =\n props.checkResultRenderer ??\n api.getCheckResultRenderers([result.check.type])[0];\n\n const [menu, setMenu] = useState<ResultLinksMenuInfo | undefined>();\n\n const iconComponent = checkResultRenderer?.component(result);\n\n const onClick: MouseEventHandler = event => {\n menu?.open(event.currentTarget);\n };\n\n const wrapActions = (inner: React.ReactElement): ReactNode => {\n if (!menu) {\n if (component) {\n const Component =\n component as ElementType<ResultCheckIconBaseComponentProps>;\n return <Component {...componentProps}>{inner}</Component>;\n }\n return inner;\n }\n\n if (component) {\n const Component =\n component as ElementType<ResultCheckIconBaseComponentProps>;\n return (\n <Component {...componentProps} onClick={onClick}>\n <IconButton edge=\"end\" aria-label=\"icon\">\n {inner}\n </IconButton>\n </Component>\n );\n }\n return (\n <IconButton edge=\"end\" aria-label=\"icon\" onClick={onClick}>\n {inner}\n </IconButton>\n );\n };\n\n return (\n <>\n {!disableLinksMenu && (\n <ResultLinksMenu result={result} entity={entity} setMenu={setMenu} />\n )}\n {wrapActions(iconComponent ?? missingRendererComponent)}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA4Fa,MAAA,eAAA,GAAkB,CAC7B,KACG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,MAAA;AAAA,IACA,MAAA;AAAA,IACA,gBAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,wBAA2B,mBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,QAAA,EAAS,WAAQ,eAAa,CAAA;AAAA,GAC9D,GAAA,KAAA,CAAA;AAEJ,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AAErC,EAAM,MAAA,mBAAA,GACJ,KAAM,CAAA,mBAAA,IACN,GAAI,CAAA,uBAAA,CAAwB,CAAC,MAAA,CAAO,KAAM,CAAA,IAAI,CAAC,CAAA,CAAE,CAAC,CAAA,CAAA;AAEpD,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAA0C,EAAA,CAAA;AAElE,EAAM,MAAA,aAAA,GAAgB,mBAAqB,EAAA,SAAA,CAAU,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ListItem from '@material-ui/core/ListItem';
5
+ import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
5
6
  import ListItemText from '@material-ui/core/ListItemText';
6
7
  import { makeStyles } from '@material-ui/core/styles';
7
8
  import { techInsightsApiRef } from '../../api/TechInsightsApi.esm.js';
@@ -40,6 +41,7 @@ const ScorecardsList = (props) => {
40
41
  {
41
42
  result,
42
43
  entity,
44
+ component: ListItemSecondaryAction,
43
45
  checkResultRenderer
44
46
  }
45
47
  ));
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardsList.esm.js","sources":["../../../src/components/ScorecardsList/ScorecardsList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport 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 { MarkdownContent } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { ResultCheckIcon } from '../ResultCheckIcon';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\n\nexport const ScorecardsList = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n}) => {\n const { checkResults, entity } = props;\n\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List>\n {checkResults.map((result, index) => {\n const checkResultRenderer = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n );\n\n const description = checkResultRenderer?.description;\n\n return (\n <ListItem key={result.check.id}>\n <ListItemText\n key={index}\n primary={result.check.name}\n secondary={\n description ? (\n description(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n )\n }\n className={classes.listItemText}\n />\n <ResultCheckIcon\n result={result}\n entity={entity}\n checkResultRenderer={checkResultRenderer}\n />\n </ListItem>\n );\n })}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA4BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,YAAc,EAAA;AAAA,IACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GACjC;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,cAAA,GAAiB,CAAC,KAGzB,KAAA;AACJ,EAAM,MAAA,EAAE,YAAc,EAAA,MAAA,EAAW,GAAA,KAAA,CAAA;AAEjC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AAErC,EAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,IAAI,YAAa,CAAA,GAAA,CAAI,CAAC,EAAE,KAAM,EAAA,KAAM,KAAM,CAAA,IAAI,CAAC,CAAC,CAAA,CAAA;AACtE,EAAM,MAAA,oBAAA,GAAuB,GAAI,CAAA,uBAAA,CAAwB,KAAK,CAAA,CAAA;AAE9D,EAAA,2CACG,IACE,EAAA,IAAA,EAAA,YAAA,CAAa,GAAI,CAAA,CAAC,QAAQ,KAAU,KAAA;AACnC,IAAA,MAAM,sBAAsB,oBAAqB,CAAA,IAAA;AAAA,MAC/C,CAAY,QAAA,KAAA,QAAA,CAAS,IAAS,KAAA,MAAA,CAAO,KAAM,CAAA,IAAA;AAAA,KAC7C,CAAA;AAEA,IAAA,MAAM,cAAc,mBAAqB,EAAA,WAAA,CAAA;AAEzC,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,GAAK,EAAA,MAAA,CAAO,MAAM,EAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,GAAK,EAAA,KAAA;AAAA,QACL,OAAA,EAAS,OAAO,KAAM,CAAA,IAAA;AAAA,QACtB,SAAA,EACE,WACE,GAAA,WAAA,CAAY,MAAM,CAAA,uCAEjB,eAAgB,EAAA,EAAA,OAAA,EAAS,MAAO,CAAA,KAAA,CAAM,WAAa,EAAA,CAAA;AAAA,QAGxD,WAAW,OAAQ,CAAA,YAAA;AAAA,OAAA;AAAA,KAErB,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,MAAA;AAAA,QACA,MAAA;AAAA,QACA,mBAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ScorecardsList.esm.js","sources":["../../../src/components/ScorecardsList/ScorecardsList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { techInsightsApiRef } from '../../api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { ResultCheckIcon } from '../ResultCheckIcon';\n\nconst useStyles = makeStyles(theme => ({\n listItemText: {\n paddingRight: theme.spacing(0.5),\n },\n}));\n\nexport const ScorecardsList = (props: {\n checkResults: CheckResult[];\n entity?: Entity;\n}) => {\n const { checkResults, entity } = props;\n\n const classes = useStyles();\n const api = useApi(techInsightsApiRef);\n\n const types = [...new Set(checkResults.map(({ check }) => check.type))];\n const checkResultRenderers = api.getCheckResultRenderers(types);\n\n return (\n <List>\n {checkResults.map((result, index) => {\n const checkResultRenderer = checkResultRenderers.find(\n renderer => renderer.type === result.check.type,\n );\n\n const description = checkResultRenderer?.description;\n\n return (\n <ListItem key={result.check.id}>\n <ListItemText\n key={index}\n primary={result.check.name}\n secondary={\n description ? (\n description(result)\n ) : (\n <MarkdownContent content={result.check.description} />\n )\n }\n className={classes.listItemText}\n />\n <ResultCheckIcon\n result={result}\n entity={entity}\n component={ListItemSecondaryAction}\n checkResultRenderer={checkResultRenderer}\n />\n </ListItem>\n );\n })}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,YAAc,EAAA;AAAA,IACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GACjC;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,cAAA,GAAiB,CAAC,KAGzB,KAAA;AACJ,EAAM,MAAA,EAAE,YAAc,EAAA,MAAA,EAAW,GAAA,KAAA,CAAA;AAEjC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AAErC,EAAA,MAAM,KAAQ,GAAA,CAAC,GAAG,IAAI,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Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport 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;A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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;;;;"}
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 { techInsightsApiRef } from '../../api';\nimport { Check } from '@backstage-community/plugin-tech-insights-common/client';\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":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAA,EAAW,EAAE,KAAA,EAAO,MAAO,EAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA,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,KAAA,CAAA;AAC9B,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,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,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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScorecardsPage.esm.js","sources":["../../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useMemo, useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n TableOptions,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { 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';\nimport { ExportCsv as exportCsv } from '@material-table/exporters';\n\nexport const ScorecardsPage = () => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n const [filterWithResults, setFilterWithResults] = useState<boolean>(true);\n const tableOptions: TableOptions = {\n exportAllData: true,\n exportMenu: [\n {\n label: 'Export CSV',\n exportFunc: (cols, datas) => exportCsv(cols, datas, 'tech-insights'),\n },\n ],\n };\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n\n return {\n checks,\n result: filterWithResults\n ? result.filter(response => response.results.length > 0)\n : result,\n };\n }, [api, filterSelectedChecks, filterWithResults]);\n\n const tableColumns = useMemo(() => {\n const columns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row => <ScorecardsList checkResults={row.results} />,\n export: false,\n },\n ];\n\n (filterSelectedChecks.length === 0\n ? value?.checks || []\n : filterSelectedChecks\n ).forEach(check => {\n columns.push({\n field: check.id,\n title: check.name,\n customExport: row =>\n `${\n row.results.filter(\n result => result && result.check && result.check.id === check.id,\n )[0]?.result\n }`,\n hidden: true,\n export: true,\n });\n });\n\n return columns;\n }, [value, filterSelectedChecks]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n withResultsChanged={withResults =>\n setFilterWithResults(withResults)\n }\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n options={tableOptions}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["exportCsv"],"mappings":";;;;;;;;;;;;;;AAqCO,MAAM,iBAAiB,MAAM;AAClC,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAA,MAAM,CAAC,oBAAsB,EAAA,uBAAuB,CAAI,GAAA,QAAA,CAAkB,EAAE,CAAA,CAAA;AAC5E,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,IAAI,CAAA,CAAA;AACxE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,aAAe,EAAA,IAAA;AAAA,IACf,UAAY,EAAA;AAAA,MACV;AAAA,QACE,KAAO,EAAA,YAAA;AAAA,QACP,YAAY,CAAC,IAAA,EAAM,UAAUA,SAAU,CAAA,IAAA,EAAM,OAAO,eAAe,CAAA;AAAA,OACrE;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,YAAY;AACrD,IAAM,MAAA,MAAA,GAAS,MAAM,GAAA,CAAI,YAAa,EAAA,CAAA;AACtC,IAAA,MAAM,SAAS,MAAM,GAAA,CAAI,aAAc,CAAA,IAAI,oBAAoB,CAAA,CAAA;AAE/D,IAAO,OAAA;AAAA,MACL,MAAA;AAAA,MACA,MAAA,EAAQ,oBACJ,MAAO,CAAA,MAAA,CAAO,cAAY,QAAS,CAAA,OAAA,CAAQ,MAAS,GAAA,C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,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ScorecardsPage.esm.js","sources":["../../../src/components/ScorecardsPage/ScorecardsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useMemo, useState } from 'react';\nimport {\n Content,\n ErrorPanel,\n Header,\n HeaderLabel,\n Page,\n TableColumn,\n Table,\n TableOptions,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { techInsightsApiRef } from '../../api';\nimport { Check } from '@backstage-community/plugin-tech-insights-common/client';\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';\nimport { ExportCsv as exportCsv } from '@material-table/exporters';\n\nexport const ScorecardsPage = () => {\n const api = useApi(techInsightsApiRef);\n const [filterSelectedChecks, setFilterSelectedChecks] = useState<Check[]>([]);\n const [filterWithResults, setFilterWithResults] = useState<boolean>(true);\n const tableOptions: TableOptions = {\n exportAllData: true,\n exportMenu: [\n {\n label: 'Export CSV',\n exportFunc: (cols, datas) => exportCsv(cols, datas, 'tech-insights'),\n },\n ],\n };\n\n const { value, loading, error } = useAsync(async () => {\n const checks = await api.getAllChecks();\n const result = await api.runBulkChecks([], filterSelectedChecks);\n\n return {\n checks,\n result: filterWithResults\n ? result.filter(response => response.results.length > 0)\n : result,\n };\n }, [api, filterSelectedChecks, filterWithResults]);\n\n const tableColumns = useMemo(() => {\n const columns: TableColumn<BulkCheckResponse[0]>[] = [\n {\n field: 'entity',\n title: 'Entity',\n render: row => <EntityRefLink entityRef={row.entity} />,\n },\n {\n field: 'results',\n title: 'Results',\n render: row => <ScorecardsList checkResults={row.results} />,\n export: false,\n },\n ];\n\n (filterSelectedChecks.length === 0\n ? value?.checks || []\n : filterSelectedChecks\n ).forEach(check => {\n columns.push({\n field: check.id,\n title: check.name,\n customExport: row =>\n `${\n row.results.filter(\n result => result && result.check && result.check.id === check.id,\n )[0]?.result\n }`,\n hidden: true,\n export: true,\n });\n });\n\n return columns;\n }, [value, filterSelectedChecks]);\n\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Tech insights\">\n <HeaderLabel label=\"Entities\" value={value?.result.length ?? 0} />\n <HeaderLabel label=\"Checks\" value={value?.checks.length ?? 0} />\n </Header>\n <Content>\n <Grid container>\n <Grid item style={{ width: '300px' }}>\n <Filters\n checksChanged={checks => setFilterSelectedChecks(checks)}\n withResultsChanged={withResults =>\n setFilterWithResults(withResults)\n }\n />\n </Grid>\n <Grid item xs>\n <Table\n columns={tableColumns}\n data={value?.result ?? []}\n isLoading={loading}\n options={tableOptions}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["exportCsv"],"mappings":";;;;;;;;;;;;;;AAsCO,MAAM,iBAAiB,MAAM;AAClC,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AACrC,EAAA,MAAM,CAAC,oBAAsB,EAAA,uBAAuB,CAAI,GAAA,QAAA,CAAkB,EAAE,CAAA,CAAA;AAC5E,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,IAAI,CAAA,CAAA;AACxE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,aAAe,EAAA,IAAA;AAAA,IACf,UAAY,EAAA;AAAA,MACV;AA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AA,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,IAAA,EAAM,KAAO,EAAA,MAAA,IAAU,EAAC;AAAA,MACxB,SAAW,EAAA,OAAA;AAAA,MACX,OAAS,EAAA,YAAA;AAAA,KAAA;AAAA,GAEb,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,14 @@
1
1
  /// <reference types="react" />
2
- import * as _material_ui_core from '@material-ui/core';
3
2
  import * as react from 'react';
4
- import react__default, { ComponentType, MouseEventHandler, ComponentProps, ReactNode } from 'react';
3
+ import react__default, { PropsWithChildren, MouseEventHandler, ElementType, ReactNode } from 'react';
5
4
  import * as _backstage_community_plugin_tech_insights_common from '@backstage-community/plugin-tech-insights-common';
6
5
  import { CheckResult, BulkCheckResponse, FactSchema, CheckLink } from '@backstage-community/plugin-tech-insights-common';
7
6
  import * as _backstage_catalog_model from '@backstage/catalog-model';
8
7
  import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
9
8
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
10
9
  import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
10
+ import { Check as Check$1, InsightFacts as InsightFacts$1, TechInsightsClient as TechInsightsClient$1 } from '@backstage-community/plugin-tech-insights-common/client';
11
11
  import { JsonValue } from '@backstage/types';
12
- import { Check as Check$1, TechInsightsClient as TechInsightsClient$1 } from '@backstage-community/plugin-tech-insights-common/client';
13
12
 
14
13
  /**
15
14
  * TechInsightsLinksMenu setMenu receiver.
@@ -47,8 +46,8 @@ type CheckResultRenderer = {
47
46
  declare const jsonRulesEngineCheckResultRenderer: CheckResultRenderer;
48
47
 
49
48
  /** @public */
50
- type ResultCheckIconBaseComponent = ComponentType<{
51
- onClick?: MouseEventHandler | undefined;
49
+ type ResultCheckIconBaseComponentProps = PropsWithChildren<{
50
+ onClick?: MouseEventHandler;
52
51
  }>;
53
52
  /**
54
53
  * ResultCheckIcon props
@@ -59,7 +58,7 @@ type ResultCheckIconBaseComponent = ComponentType<{
59
58
  *
60
59
  * @public
61
60
  */
62
- interface ResultCheckIconProps<C extends ResultCheckIconBaseComponent> {
61
+ interface ResultCheckIconProps<P extends ResultCheckIconBaseComponentProps> {
63
62
  /**
64
63
  * The CheckResult object to create an icon for
65
64
  */
@@ -79,22 +78,20 @@ interface ResultCheckIconProps<C extends ResultCheckIconBaseComponent> {
79
78
  */
80
79
  disableLinksMenu?: boolean;
81
80
  /**
82
- * By default, the icon (and the parent `IconButton`) is wrapped inside a
83
- * `ListItemSecondaryAction` which handles the `onClick` to open the popup
84
- * menu.
85
- *
86
- * This can be changed by providing a custom component here.
81
+ * The icon is rendered with an `IconButton` which handles the onClick.
82
+ * To wrap this in another component, handling the onClick, pass a component,
83
+ * such as `ListItemSecondaryAction` which handles the `onClick` to open the
84
+ * popup menu.
87
85
  *
88
86
  * The {@link ResultCheckIconProps.componentProps} prop can be specified to
89
87
  * add props to the wrapping component.
90
88
  */
91
- component?: C;
89
+ component?: ElementType<P>;
92
90
  /**
93
- * Props to provide to the wrapping component, which by default is a
94
- * `ListItemSecondaryAction` but can be overridden using
91
+ * Props to provide to the wrapping component
95
92
  * {@link ResultCheckIconProps.component}.
96
93
  */
97
- componentProps?: Omit<ComponentProps<C>, 'onClick'>;
94
+ componentProps?: Omit<P, 'onClick' | 'children'>;
98
95
  /**
99
96
  * Override the component used to display instead of a result icon, when no
100
97
  * renderer was found for this check type.
@@ -116,9 +113,6 @@ declare const ScorecardInfo: (props: {
116
113
  title: react.ReactNode;
117
114
  entity: _backstage_catalog_model.Entity;
118
115
  description?: string | undefined;
119
- /**
120
- * @public
121
- */
122
116
  noWarning?: boolean | undefined;
123
117
  expanded?: boolean | undefined;
124
118
  }) => react.JSX.Element;
@@ -154,7 +148,7 @@ declare const TechInsightsScorecardPage: () => react.JSX.Element;
154
148
  /**
155
149
  * @public
156
150
  */
157
- declare const TechInsightsCheckIcon: <C extends ResultCheckIconBaseComponent = typeof _material_ui_core.ListItemSecondaryAction>(props: ResultCheckIconProps<C>) => react.JSX.Element;
151
+ declare const TechInsightsCheckIcon: <P extends ResultCheckIconBaseComponentProps>(props: ResultCheckIconProps<P>) => react.JSX.Element;
158
152
  /**
159
153
  * @public
160
154
  */
@@ -164,27 +158,6 @@ declare const TechInsightsLinksMenu: (props: react.PropsWithChildren<{
164
158
  setMenu(opener: ResultLinksMenuInfo | undefined): void;
165
159
  }>) => react.JSX.Element | null;
166
160
 
167
- /**
168
- * Represents a single check defined on the TechInsights backend.
169
- *
170
- * @public
171
- * @deprecated Import from \@backstage-community/plugin-tech-insights-common/client
172
- */
173
- type Check = Check$1;
174
- /**
175
- * Represents a Fact defined on the TechInsights backend.
176
- *
177
- * @public
178
- * @deprecated Import from \@backstage-community/plugin-tech-insights-common/client
179
- */
180
- interface InsightFacts {
181
- [factId: string]: {
182
- timestamp: string;
183
- version: string;
184
- facts: Record<string, JsonValue>;
185
- };
186
- }
187
-
188
161
  /**
189
162
  * {@link @backstage/core-plugin-api#ApiRef} for the {@link TechInsightsApi}
190
163
  *
@@ -199,10 +172,10 @@ declare const techInsightsApiRef: _backstage_core_plugin_api.ApiRef<TechInsights
199
172
  interface TechInsightsApi {
200
173
  getCheckResultRenderers: (types: string[]) => CheckResultRenderer[];
201
174
  isCheckResultFailed: (check: CheckResult) => boolean;
202
- getAllChecks(): Promise<Check[]>;
175
+ getAllChecks(): Promise<Check$1[]>;
203
176
  runChecks(entityParams: CompoundEntityRef, checks?: string[]): Promise<CheckResult[]>;
204
- runBulkChecks(entities: CompoundEntityRef[], checks?: Check[]): Promise<BulkCheckResponse>;
205
- getFacts(entity: CompoundEntityRef, facts: string[]): Promise<InsightFacts>;
177
+ runBulkChecks(entities: CompoundEntityRef[], checks?: Check$1[]): Promise<BulkCheckResponse>;
178
+ getFacts(entity: CompoundEntityRef, facts: string[]): Promise<InsightFacts$1>;
206
179
  getFactSchemas(): Promise<FactSchema[]>;
207
180
  getLinksForEntity(result: CheckResult, entity: Entity, options?: {
208
181
  includeStaticLinks?: boolean;
@@ -226,6 +199,27 @@ declare class TechInsightsClient extends TechInsightsClient$1 implements TechIns
226
199
  }): CheckLink[];
227
200
  }
228
201
 
202
+ /**
203
+ * Represents a single check defined on the TechInsights backend.
204
+ *
205
+ * @public
206
+ * @deprecated Import from \@backstage-community/plugin-tech-insights-common/client
207
+ */
208
+ type Check = Check$1;
209
+ /**
210
+ * Represents a Fact defined on the TechInsights backend.
211
+ *
212
+ * @public
213
+ * @deprecated Import from \@backstage-community/plugin-tech-insights-common/client
214
+ */
215
+ interface InsightFacts {
216
+ [factId: string]: {
217
+ timestamp: string;
218
+ version: string;
219
+ facts: Record<string, JsonValue>;
220
+ };
221
+ }
222
+
229
223
  /**
230
224
  * @public
231
225
  */
@@ -233,4 +227,4 @@ declare const BooleanCheck: (props: {
233
227
  checkResult: CheckResult;
234
228
  }) => react__default.JSX.Element;
235
229
 
236
- export { BooleanCheck, type Check, type CheckResultRenderer, EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, type InsightFacts, type ResultCheckIconBaseComponent, type ResultCheckIconProps, type ResultLinksMenuInfo, ScorecardInfo, ScorecardsList, type TechInsightsApi, TechInsightsCheckIcon, TechInsightsClient, TechInsightsLinksMenu, TechInsightsScorecardPage, jsonRulesEngineCheckResultRenderer, techInsightsApiRef, techInsightsPlugin };
230
+ export { BooleanCheck, type Check, type CheckResultRenderer, EntityTechInsightsScorecardCard, EntityTechInsightsScorecardContent, type InsightFacts, type ResultCheckIconBaseComponentProps, type ResultCheckIconProps, type ResultLinksMenuInfo, ScorecardInfo, ScorecardsList, type TechInsightsApi, TechInsightsCheckIcon, TechInsightsClient, TechInsightsLinksMenu, TechInsightsScorecardPage, jsonRulesEngineCheckResultRenderer, techInsightsApiRef, techInsightsPlugin };
@@ -1,4 +1,4 @@
1
- import { createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
1
+ import { createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createComponentExtension, createRoutableExtension } from '@backstage/core-plugin-api';
2
2
  import { rootRouteRef } from './routes.esm.js';
3
3
  import { techInsightsApiRef } from './api/TechInsightsApi.esm.js';
4
4
  import { TechInsightsClient } from './api/TechInsightsClient.esm.js';
@@ -17,17 +17,19 @@ const techInsightsPlugin = createPlugin({
17
17
  }
18
18
  });
19
19
  const ScorecardInfo = techInsightsPlugin.provide(
20
- createRoutableExtension({
20
+ createComponentExtension({
21
21
  name: "ScorecardInfo",
22
- component: () => import('./components/ScorecardsInfo/index.esm.js').then((m) => m.ScorecardInfo),
23
- mountPoint: rootRouteRef
22
+ component: {
23
+ lazy: () => import('./components/ScorecardsInfo/index.esm.js').then((m) => m.ScorecardInfo)
24
+ }
24
25
  })
25
26
  );
26
27
  const ScorecardsList = techInsightsPlugin.provide(
27
- createRoutableExtension({
28
+ createComponentExtension({
28
29
  name: "ScorecardsList",
29
- component: () => import('./components/ScorecardsList/index.esm.js').then((m) => m.ScorecardsList),
30
- mountPoint: rootRouteRef
30
+ component: {
31
+ lazy: () => import('./components/ScorecardsList/index.esm.js').then((m) => m.ScorecardsList)
32
+ }
31
33
  })
32
34
  );
33
35
  const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(
@@ -52,17 +54,19 @@ const TechInsightsScorecardPage = techInsightsPlugin.provide(
52
54
  })
53
55
  );
54
56
  const TechInsightsCheckIcon = techInsightsPlugin.provide(
55
- createRoutableExtension({
57
+ createComponentExtension({
56
58
  name: "TechInsightsCheckIcon",
57
- component: () => import('./components/ResultCheckIcon/index.esm.js').then((m) => m.ResultCheckIcon),
58
- mountPoint: rootRouteRef
59
+ component: {
60
+ lazy: () => import('./components/ResultCheckIcon/index.esm.js').then((m) => m.ResultCheckIcon)
61
+ }
59
62
  })
60
63
  );
61
64
  const TechInsightsLinksMenu = techInsightsPlugin.provide(
62
- createRoutableExtension({
65
+ createComponentExtension({
63
66
  name: "TechInsightsLinksMenu",
64
- component: () => import('./components/ResultLinksMenu/index.esm.js').then((m) => m.ResultLinksMenu),
65
- mountPoint: rootRouteRef
67
+ component: {
68
+ lazy: () => import('./components/ResultLinksMenu/index.esm.js').then((m) => m.ResultLinksMenu)
69
+ }
66
70
  })
67
71
  );
68
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n 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\n/**\n * @public\n */\nexport const TechInsightsCheckIcon = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsCheckIcon',\n component: () =>\n import('./components/ResultCheckIcon').then(m => m.ResultCheckIcon),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsLinksMenu = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsLinksMenu',\n component: () =>\n import('./components/ResultLinksMenu').then(m => m.ResultLinksMenu),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;AA6BO,MAAM,qBAAqB,YAAa,CAAA;AAAA,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,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,EAAA;AAKO,MAAM,wBAAwB,kBAAmB,CAAA,OAAA;AAAA,EACtD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,2CAA8B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,eAAe,CAAA;AAAA,IACpE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAKO,MAAM,wBAAwB,kBAAmB,CAAA,OAAA;AAAA,EACtD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,2CAA8B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,eAAe,CAAA;AAAA,IACpE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n createComponentExtension,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { 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 createComponentExtension({\n name: 'ScorecardInfo',\n component: {\n lazy: () =>\n import('./components/ScorecardsInfo').then(m => m.ScorecardInfo),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const ScorecardsList = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'ScorecardsList',\n component: {\n lazy: () =>\n import('./components/ScorecardsList').then(m => m.ScorecardsList),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardContent = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardContent',\n component: () =>\n import('./components/ScorecardsContent').then(m => m.ScorecardsContent),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const EntityTechInsightsScorecardCard = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechInsightsScorecardCard',\n component: () =>\n import('./components/ScorecardsCard').then(m => m.ScorecardsCard),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsScorecardPage = techInsightsPlugin.provide(\n createRoutableExtension({\n name: 'TechInsightsScorecardPage',\n component: () =>\n import('./components/ScorecardsPage').then(m => m.ScorecardsPage),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsCheckIcon = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsCheckIcon',\n component: {\n lazy: () =>\n import('./components/ResultCheckIcon').then(m => m.ResultCheckIcon),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const TechInsightsLinksMenu = techInsightsPlugin.provide(\n createComponentExtension({\n name: 'TechInsightsLinksMenu',\n component: {\n lazy: () =>\n import('./components/ResultLinksMenu').then(m => m.ResultLinksMenu),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;AA8BO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,kBAAA;AAAA,MACL,IAAM,EAAA,EAAE,YAAc,EAAA,eAAA,EAAiB,aAAa,cAAe,EAAA;AAAA,MACnE,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,WAAA,EACxB,KAAA,IAAI,kBAAmB,CAAA,EAAE,YAAc,EAAA,WAAA,EAAa,CAAA;AAAA,KACvD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,GACR;AACF,CAAC,EAAA;AAKM,MAAM,gBAAgB,kBAAmB,CAAA,OAAA;AAAA,EAC9C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,eAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,KACnE;AAAA,GACD,CAAA;AACH,EAAA;AAKO,MAAM,iBAAiB,kBAAmB,CAAA,OAAA;AAAA,EAC/C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAC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AAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,2CAA8B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,eAAe,CAAA;AAAA,KACtE;AAAA,GACD,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-tech-insights",
3
- "version": "0.3.35",
3
+ "version": "0.3.37",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "tech-insights",
@@ -39,12 +39,12 @@
39
39
  "test": "backstage-cli package test"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage-community/plugin-tech-insights-common": "^0.2.18",
43
- "@backstage/catalog-model": "^1.6.0",
44
- "@backstage/core-components": "^0.14.10",
45
- "@backstage/core-plugin-api": "^1.9.3",
42
+ "@backstage-community/plugin-tech-insights-common": "^0.2.19",
43
+ "@backstage/catalog-model": "^1.7.0",
44
+ "@backstage/core-components": "^0.15.0",
45
+ "@backstage/core-plugin-api": "^1.9.4",
46
46
  "@backstage/errors": "^1.2.4",
47
- "@backstage/plugin-catalog-react": "^1.12.3",
47
+ "@backstage/plugin-catalog-react": "^1.13.0",
48
48
  "@backstage/types": "^1.1.1",
49
49
  "@material-table/exporters": "^1.2.19",
50
50
  "@material-ui/core": "^4.12.2",
@@ -54,8 +54,8 @@
54
54
  "react-use": "^17.2.4"
55
55
  },
56
56
  "devDependencies": {
57
- "@backstage/cli": "^0.27.0",
58
- "@backstage/dev-utils": "^1.0.37",
57
+ "@backstage/cli": "^0.27.1",
58
+ "@backstage/dev-utils": "^1.1.0",
59
59
  "@testing-library/dom": "^10.0.0",
60
60
  "@testing-library/jest-dom": "^6.0.0",
61
61
  "@testing-library/react": "^15.0.0",