@backstage-community/plugin-tech-insights 0.3.35 → 0.3.36
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 +6 -0
- package/dist/components/ResultCheckIcon/ResultCheckIcon.esm.js +15 -12
- package/dist/components/ResultCheckIcon/ResultCheckIcon.esm.js.map +1 -1
- package/dist/components/ScorecardsList/ScorecardsList.esm.js +2 -0
- package/dist/components/ScorecardsList/ScorecardsList.esm.js.map +1 -1
- package/dist/index.d.ts +13 -19
- package/dist/plugin.esm.js +17 -13
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @backstage-community/plugin-tech-insights
|
|
2
2
|
|
|
3
|
+
## 0.3.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
3
9
|
## 0.3.35
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -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
|
|
24
|
+
const onClick = (event) => {
|
|
25
|
+
menu?.open(event.currentTarget);
|
|
26
|
+
};
|
|
27
|
+
const wrapActions = (inner) => {
|
|
26
28
|
if (!menu) {
|
|
27
|
-
|
|
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
|
|
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,MAAM,CAAA,CAAA;AAE3D,EAAA,MAAM,UAA6B,CAAS,KAAA,KAAA;AAC1C,IAAM,IAAA,EAAA,IAAA,CAAK,MAAM,aAAa,CAAA,CAAA;AAAA,GAChC,CAAA;AAEA,EAAM,MAAA,WAAA,GAAc,CAAC,KAAyC,KAAA;AAC5D,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAA,IAAI,SAAW,EAAA;AACb,QAAA,MAAM,SACJ,GAAA,SAAA,CAAA;AACF,QAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,cAAA,EAAA,EAAiB,KAAM,CAAA,CAAA;AAAA,OAC/C;AACA,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,MAAM,SACJ,GAAA,SAAA,CAAA;AACF,MAAA,uBACG,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,cAAA,EAAgB,OAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAK,KAAM,EAAA,YAAA,EAAW,MAC/B,EAAA,EAAA,KACH,CACF,CAAA,CAAA;AAAA,KAEJ;AACA,IAAA,2CACG,UAAW,EAAA,EAAA,IAAA,EAAK,OAAM,YAAW,EAAA,MAAA,EAAO,WACtC,KACH,CAAA,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;;;;"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useApi } from '@backstage/core-plugin-api';
|
|
3
3
|
import List from '@material-ui/core/List';
|
|
4
4
|
import 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":"
|
|
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,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,SAAW,EAAA,uBAAA;AAAA,QACX,mBAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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, {
|
|
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';
|
|
@@ -47,8 +46,8 @@ type CheckResultRenderer = {
|
|
|
47
46
|
declare const jsonRulesEngineCheckResultRenderer: CheckResultRenderer;
|
|
48
47
|
|
|
49
48
|
/** @public */
|
|
50
|
-
type
|
|
51
|
-
onClick?: MouseEventHandler
|
|
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<
|
|
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
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
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?:
|
|
89
|
+
component?: ElementType<P>;
|
|
92
90
|
/**
|
|
93
|
-
* Props to provide to the wrapping component
|
|
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<
|
|
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: <
|
|
151
|
+
declare const TechInsightsCheckIcon: <P extends ResultCheckIconBaseComponentProps>(props: ResultCheckIconProps<P>) => react.JSX.Element;
|
|
158
152
|
/**
|
|
159
153
|
* @public
|
|
160
154
|
*/
|
|
@@ -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
|
|
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 };
|
package/dist/plugin.esm.js
CHANGED
|
@@ -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
|
-
|
|
20
|
+
createComponentExtension({
|
|
21
21
|
name: "ScorecardInfo",
|
|
22
|
-
component:
|
|
23
|
-
|
|
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
|
-
|
|
28
|
+
createComponentExtension({
|
|
28
29
|
name: "ScorecardsList",
|
|
29
|
-
component:
|
|
30
|
-
|
|
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
|
-
|
|
57
|
+
createComponentExtension({
|
|
56
58
|
name: "TechInsightsCheckIcon",
|
|
57
|
-
component:
|
|
58
|
-
|
|
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
|
-
|
|
65
|
+
createComponentExtension({
|
|
63
66
|
name: "TechInsightsLinksMenu",
|
|
64
|
-
component:
|
|
65
|
-
|
|
67
|
+
component: {
|
|
68
|
+
lazy: () => import('./components/ResultLinksMenu/index.esm.js').then((m) => m.ResultLinksMenu)
|
|
69
|
+
}
|
|
66
70
|
})
|
|
67
71
|
);
|
|
68
72
|
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -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
|
|
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,MACJ,OAAO,0CAA6B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,KACpE;AAAA,GACD,CAAA;AACH,EAAA;AAKO,MAAM,qCAAqC,kBAAmB,CAAA,OAAA;AAAA,EACnE,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,oCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6CAAgC,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,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,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,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,EAAA;AAKO,MAAM,wBAAwB,kBAAmB,CAAA,OAAA;AAAA,EACtD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,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;;;;"}
|