@backstage/plugin-catalog-react 1.13.1-next.0 → 1.14.0-next.1
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,29 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.14.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6812980: Added a new prop, `disableTooltip` to the `EntityRefLink` component
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- e969dc7: Move `@types/react` to a peer dependency.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/core-components@0.15.1-next.1
|
|
14
|
+
- @backstage/frontend-plugin-api@0.9.0-next.1
|
|
15
|
+
- @backstage/integration-react@1.2.0-next.1
|
|
16
|
+
- @backstage/core-compat-api@0.3.1-next.1
|
|
17
|
+
- @backstage/core-plugin-api@1.10.0-next.1
|
|
18
|
+
- @backstage/plugin-permission-react@0.4.27-next.1
|
|
19
|
+
- @backstage/version-bridge@1.0.10-next.0
|
|
20
|
+
- @backstage/catalog-client@1.7.0
|
|
21
|
+
- @backstage/catalog-model@1.7.0
|
|
22
|
+
- @backstage/errors@1.2.4
|
|
23
|
+
- @backstage/types@1.1.1
|
|
24
|
+
- @backstage/plugin-catalog-common@1.1.0
|
|
25
|
+
- @backstage/plugin-permission-common@0.8.1
|
|
26
|
+
|
|
3
27
|
## 1.13.1-next.0
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/alpha/package.json
CHANGED
|
@@ -14,6 +14,7 @@ const EntityRefLink = forwardRef(
|
|
|
14
14
|
title,
|
|
15
15
|
children,
|
|
16
16
|
hideIcon,
|
|
17
|
+
disableTooltip,
|
|
17
18
|
...linkProps
|
|
18
19
|
} = props;
|
|
19
20
|
const entityRoute = useEntityRoute(props.entityRef);
|
|
@@ -23,7 +24,8 @@ const EntityRefLink = forwardRef(
|
|
|
23
24
|
entityRef,
|
|
24
25
|
defaultKind,
|
|
25
26
|
defaultNamespace,
|
|
26
|
-
hideIcon
|
|
27
|
+
hideIcon,
|
|
28
|
+
disableTooltip
|
|
27
29
|
}
|
|
28
30
|
);
|
|
29
31
|
return /* @__PURE__ */ React.createElement(Link, { ...linkProps, ref, to: entityRoute }, content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityRefLink.esm.js","sources":["../../../src/components/EntityRefLink/EntityRefLink.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport React, { forwardRef } from 'react';\nimport { entityRouteRef } from '../../routes';\nimport { EntityDisplayName } from '../EntityDisplayName';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n defaultNamespace?: string;\n /** @deprecated This option should no longer be used; presentation is requested through the {@link entityPresentationApiRef} instead */\n title?: string;\n children?: React.ReactNode;\n hideIcon?: boolean;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const {\n entityRef,\n defaultKind,\n defaultNamespace,\n title,\n children,\n hideIcon,\n ...linkProps\n } = props;\n const entityRoute = useEntityRoute(props.entityRef);\n\n const content = children ?? title ?? (\n <EntityDisplayName\n entityRef={entityRef}\n defaultKind={defaultKind}\n defaultNamespace={defaultNamespace}\n hideIcon={hideIcon}\n />\n );\n\n return (\n <Link {...linkProps} ref={ref} to={entityRoute}>\n {content}\n </Link>\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\n\n// Hook that computes the route to a given entity / ref. This is a bit\n// contrived, because it tries to retain the casing of the entity name if\n// present, but not of other parts. This is in an attempt to make slightly more\n// nice-looking URLs.\nfunction useEntityRoute(\n entityRef: Entity | CompoundEntityRef | string,\n): string {\n const entityRoute = useRouteRef(entityRouteRef);\n\n let kind;\n let namespace;\n let name;\n\n if (typeof entityRef === 'string') {\n const parsed = parseEntityRef(entityRef);\n kind = parsed.kind;\n namespace = parsed.namespace;\n name = parsed.name;\n } else if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n namespace = namespace?.toLocaleLowerCase('en-US') ?? DEFAULT_NAMESPACE;\n\n const routeParams = {\n kind: encodeURIComponent(kind),\n namespace: encodeURIComponent(namespace),\n name: encodeURIComponent(name),\n };\n\n return entityRoute(routeParams);\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityRefLink.esm.js","sources":["../../../src/components/EntityRefLink/EntityRefLink.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport React, { forwardRef } from 'react';\nimport { entityRouteRef } from '../../routes';\nimport { EntityDisplayName } from '../EntityDisplayName';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n defaultNamespace?: string;\n /** @deprecated This option should no longer be used; presentation is requested through the {@link entityPresentationApiRef} instead */\n title?: string;\n children?: React.ReactNode;\n hideIcon?: boolean;\n disableTooltip?: boolean;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const {\n entityRef,\n defaultKind,\n defaultNamespace,\n title,\n children,\n hideIcon,\n disableTooltip,\n ...linkProps\n } = props;\n const entityRoute = useEntityRoute(props.entityRef);\n\n const content = children ?? title ?? (\n <EntityDisplayName\n entityRef={entityRef}\n defaultKind={defaultKind}\n defaultNamespace={defaultNamespace}\n hideIcon={hideIcon}\n disableTooltip={disableTooltip}\n />\n );\n\n return (\n <Link {...linkProps} ref={ref} to={entityRoute}>\n {content}\n </Link>\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\n\n// Hook that computes the route to a given entity / ref. This is a bit\n// contrived, because it tries to retain the casing of the entity name if\n// present, but not of other parts. This is in an attempt to make slightly more\n// nice-looking URLs.\nfunction useEntityRoute(\n entityRef: Entity | CompoundEntityRef | string,\n): string {\n const entityRoute = useRouteRef(entityRouteRef);\n\n let kind;\n let namespace;\n let name;\n\n if (typeof entityRef === 'string') {\n const parsed = parseEntityRef(entityRef);\n kind = parsed.kind;\n namespace = parsed.namespace;\n name = parsed.name;\n } else if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n namespace = namespace?.toLocaleLowerCase('en-US') ?? DEFAULT_NAMESPACE;\n\n const routeParams = {\n kind: encodeURIComponent(kind),\n namespace: encodeURIComponent(namespace),\n name: encodeURIComponent(name),\n };\n\n return entityRoute(routeParams);\n}\n"],"names":[],"mappings":";;;;;;;AAiDO,MAAM,aAAgB,GAAA,UAAA;AAAA,EAC3B,CAAC,OAAO,GAAQ,KAAA;AACd,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,GAAG,SAAA;AAAA,KACD,GAAA,KAAA,CAAA;AACJ,IAAM,MAAA,WAAA,GAAc,cAAe,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AAElD,IAAM,MAAA,OAAA,GAAU,YAAY,KAC1B,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,SAAA;AAAA,QACA,WAAA;AAAA,QACA,gBAAA;AAAA,QACA,QAAA;AAAA,QACA,cAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAGF,IAAA,2CACG,IAAM,EAAA,EAAA,GAAG,WAAW,GAAU,EAAA,EAAA,EAAI,eAChC,OACH,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAMA,SAAS,eACP,SACQ,EAAA;AACR,EAAM,MAAA,WAAA,GAAc,YAAY,cAAc,CAAA,CAAA;AAE9C,EAAI,IAAA,IAAA,CAAA;AACJ,EAAI,IAAA,SAAA,CAAA;AACJ,EAAI,IAAA,IAAA,CAAA;AAEJ,EAAI,IAAA,OAAO,cAAc,QAAU,EAAA;AACjC,IAAM,MAAA,MAAA,GAAS,eAAe,SAAS,CAAA,CAAA;AACvC,IAAA,IAAA,GAAO,MAAO,CAAA,IAAA,CAAA;AACd,IAAA,SAAA,GAAY,MAAO,CAAA,SAAA,CAAA;AACnB,IAAA,IAAA,GAAO,MAAO,CAAA,IAAA,CAAA;AAAA,GAChB,MAAA,IAAW,cAAc,SAAW,EAAA;AAClC,IAAA,IAAA,GAAO,SAAU,CAAA,IAAA,CAAA;AACjB,IAAA,SAAA,GAAY,UAAU,QAAS,CAAA,SAAA,CAAA;AAC/B,IAAA,IAAA,GAAO,UAAU,QAAS,CAAA,IAAA,CAAA;AAAA,GACrB,MAAA;AACL,IAAA,IAAA,GAAO,SAAU,CAAA,IAAA,CAAA;AACjB,IAAA,SAAA,GAAY,SAAU,CAAA,SAAA,CAAA;AACtB,IAAA,IAAA,GAAO,SAAU,CAAA,IAAA,CAAA;AAAA,GACnB;AAEA,EAAO,IAAA,GAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA,CAAA;AACrC,EAAY,SAAA,GAAA,SAAA,EAAW,iBAAkB,CAAA,OAAO,CAAK,IAAA,iBAAA,CAAA;AAErD,EAAA,MAAM,WAAc,GAAA;AAAA,IAClB,IAAA,EAAM,mBAAmB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,mBAAmB,SAAS,CAAA;AAAA,IACvC,IAAA,EAAM,mBAAmB,IAAI,CAAA;AAAA,GAC/B,CAAA;AAEA,EAAA,OAAO,YAAY,WAAW,CAAA,CAAA;AAChC;;;;"}
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0-next.1",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -56,24 +56,23 @@
|
|
|
56
56
|
"test": "backstage-cli package test"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/catalog-client": "
|
|
60
|
-
"@backstage/catalog-model": "
|
|
61
|
-
"@backstage/core-compat-api": "
|
|
62
|
-
"@backstage/core-components": "
|
|
63
|
-
"@backstage/core-plugin-api": "
|
|
64
|
-
"@backstage/errors": "
|
|
65
|
-
"@backstage/frontend-plugin-api": "
|
|
66
|
-
"@backstage/integration-react": "
|
|
67
|
-
"@backstage/plugin-catalog-common": "
|
|
68
|
-
"@backstage/plugin-permission-common": "
|
|
69
|
-
"@backstage/plugin-permission-react": "
|
|
70
|
-
"@backstage/types": "
|
|
71
|
-
"@backstage/version-bridge": "
|
|
59
|
+
"@backstage/catalog-client": "1.7.0",
|
|
60
|
+
"@backstage/catalog-model": "1.7.0",
|
|
61
|
+
"@backstage/core-compat-api": "0.3.1-next.1",
|
|
62
|
+
"@backstage/core-components": "0.15.1-next.1",
|
|
63
|
+
"@backstage/core-plugin-api": "1.10.0-next.1",
|
|
64
|
+
"@backstage/errors": "1.2.4",
|
|
65
|
+
"@backstage/frontend-plugin-api": "0.9.0-next.1",
|
|
66
|
+
"@backstage/integration-react": "1.2.0-next.1",
|
|
67
|
+
"@backstage/plugin-catalog-common": "1.1.0",
|
|
68
|
+
"@backstage/plugin-permission-common": "0.8.1",
|
|
69
|
+
"@backstage/plugin-permission-react": "0.4.27-next.1",
|
|
70
|
+
"@backstage/types": "1.1.1",
|
|
71
|
+
"@backstage/version-bridge": "1.0.10-next.0",
|
|
72
72
|
"@material-ui/core": "^4.12.2",
|
|
73
73
|
"@material-ui/icons": "^4.9.1",
|
|
74
74
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
75
75
|
"@react-hookz/web": "^24.0.0",
|
|
76
|
-
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
77
76
|
"classnames": "^2.2.6",
|
|
78
77
|
"lodash": "^4.17.21",
|
|
79
78
|
"material-ui-popup-state": "^1.9.3",
|
|
@@ -83,23 +82,33 @@
|
|
|
83
82
|
"zen-observable": "^0.10.0"
|
|
84
83
|
},
|
|
85
84
|
"devDependencies": {
|
|
86
|
-
"@backstage/cli": "
|
|
87
|
-
"@backstage/core-app-api": "
|
|
88
|
-
"@backstage/frontend-test-utils": "
|
|
89
|
-
"@backstage/plugin-catalog-common": "
|
|
90
|
-
"@backstage/plugin-scaffolder-common": "
|
|
91
|
-
"@backstage/test-utils": "
|
|
85
|
+
"@backstage/cli": "0.28.0-next.1",
|
|
86
|
+
"@backstage/core-app-api": "1.15.1-next.1",
|
|
87
|
+
"@backstage/frontend-test-utils": "0.2.1-next.1",
|
|
88
|
+
"@backstage/plugin-catalog-common": "1.1.0",
|
|
89
|
+
"@backstage/plugin-scaffolder-common": "1.5.6",
|
|
90
|
+
"@backstage/test-utils": "1.6.1-next.1",
|
|
92
91
|
"@testing-library/dom": "^10.0.0",
|
|
93
92
|
"@testing-library/jest-dom": "^6.0.0",
|
|
94
93
|
"@testing-library/react": "^16.0.0",
|
|
95
94
|
"@testing-library/user-event": "^14.0.0",
|
|
95
|
+
"@types/react": "^18.0.0",
|
|
96
96
|
"@types/zen-observable": "^0.8.0",
|
|
97
|
+
"react": "^18.0.2",
|
|
98
|
+
"react-dom": "^18.0.2",
|
|
99
|
+
"react-router-dom": "^6.3.0",
|
|
97
100
|
"react-test-renderer": "^16.13.1"
|
|
98
101
|
},
|
|
99
102
|
"peerDependencies": {
|
|
103
|
+
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
100
104
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
101
105
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
102
106
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
103
107
|
},
|
|
108
|
+
"peerDependenciesMeta": {
|
|
109
|
+
"@types/react": {
|
|
110
|
+
"optional": true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
104
113
|
"module": "./dist/index.esm.js"
|
|
105
114
|
}
|