@backstage/plugin-catalog-react 1.12.3-next.1 → 1.12.3-next.2
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 +19 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.esm.js +2 -2
- package/dist/alpha.esm.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.12.3-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 012e3eb: Entity page extensions created for the new frontend system via the `/alpha` exports will now be enabled by default.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.7.0-next.2
|
|
10
|
+
- @backstage/plugin-permission-common@0.8.1-next.1
|
|
11
|
+
- @backstage/plugin-catalog-common@1.0.26-next.1
|
|
12
|
+
- @backstage/plugin-permission-react@0.4.25-next.1
|
|
13
|
+
- @backstage/catalog-client@1.6.5
|
|
14
|
+
- @backstage/catalog-model@1.5.0
|
|
15
|
+
- @backstage/core-components@0.14.10-next.0
|
|
16
|
+
- @backstage/core-plugin-api@1.9.3
|
|
17
|
+
- @backstage/errors@1.2.4
|
|
18
|
+
- @backstage/integration-react@1.1.30-next.0
|
|
19
|
+
- @backstage/types@1.1.1
|
|
20
|
+
- @backstage/version-bridge@1.0.8
|
|
21
|
+
|
|
3
22
|
## 1.12.3-next.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.esm.js
CHANGED
|
@@ -28,7 +28,7 @@ function createEntityCardExtension(options) {
|
|
|
28
28
|
id: "entity-content:catalog/overview",
|
|
29
29
|
input: "cards"
|
|
30
30
|
},
|
|
31
|
-
disabled: options.disabled
|
|
31
|
+
disabled: options.disabled,
|
|
32
32
|
output: {
|
|
33
33
|
element: coreExtensionData.reactElement,
|
|
34
34
|
filterFunction: catalogExtensionData.entityFilterFunction.optional(),
|
|
@@ -56,7 +56,7 @@ function createEntityContentExtension(options) {
|
|
|
56
56
|
id: "page:catalog/entity",
|
|
57
57
|
input: "contents"
|
|
58
58
|
},
|
|
59
|
-
disabled: options.disabled
|
|
59
|
+
disabled: options.disabled,
|
|
60
60
|
output: {
|
|
61
61
|
element: coreExtensionData.reactElement,
|
|
62
62
|
path: coreExtensionData.routePath,
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 AnyExtensionInputMap,\n ExtensionBoundary,\n PortableSchema,\n ResolvedExtensionInputs,\n RouteRef,\n coreExtensionData,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport React, { lazy } from 'react';\nimport { Entity } from '@backstage/catalog-model';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { Expand } from '../../../packages/frontend-plugin-api/src/types';\n\nexport { useEntityPermission } from './hooks/useEntityPermission';\nexport { isOwnerOf } from './utils';\nexport * from './translation';\n\n/** @alpha */\nexport const catalogExtensionData = {\n entityContentTitle: createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n }),\n entityFilterFunction: createExtensionDataRef<\n (entity: Entity) => boolean\n >().with({ id: 'catalog.entity-filter-function' }),\n entityFilterExpression: createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n }),\n};\n\n// TODO: Figure out how to merge with provided config schema\n/** @alpha */\nexport function createEntityCardExtension<\n TConfig extends { filter?: string },\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n configSchema?: PortableSchema<TConfig>;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({\n filter: z.string().optional(),\n }),\n ) as PortableSchema<TConfig>);\n return createExtension({\n kind: 'entity-card',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'entity-content:catalog/overview',\n input: 'cards',\n },\n disabled: options.disabled
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 AnyExtensionInputMap,\n ExtensionBoundary,\n PortableSchema,\n ResolvedExtensionInputs,\n RouteRef,\n coreExtensionData,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport React, { lazy } from 'react';\nimport { Entity } from '@backstage/catalog-model';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { Expand } from '../../../packages/frontend-plugin-api/src/types';\n\nexport { useEntityPermission } from './hooks/useEntityPermission';\nexport { isOwnerOf } from './utils';\nexport * from './translation';\n\n/** @alpha */\nexport const catalogExtensionData = {\n entityContentTitle: createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n }),\n entityFilterFunction: createExtensionDataRef<\n (entity: Entity) => boolean\n >().with({ id: 'catalog.entity-filter-function' }),\n entityFilterExpression: createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n }),\n};\n\n// TODO: Figure out how to merge with provided config schema\n/** @alpha */\nexport function createEntityCardExtension<\n TConfig extends { filter?: string },\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n configSchema?: PortableSchema<TConfig>;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({\n filter: z.string().optional(),\n }),\n ) as PortableSchema<TConfig>);\n return createExtension({\n kind: 'entity-card',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'entity-content:catalog/overview',\n input: 'cards',\n },\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n filterFunction: catalogExtensionData.entityFilterFunction.optional(),\n filterExpression: catalogExtensionData.entityFilterExpression.optional(),\n },\n inputs: options.inputs,\n configSchema,\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ inputs, config })\n .then(element => ({ default: () => element })),\n );\n\n return {\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n ...mergeFilters({ config, options }),\n };\n },\n });\n}\n\n/** @alpha */\nexport function createEntityContentExtension<\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n routeRef?: RouteRef;\n defaultPath: string;\n defaultTitle: string;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n return createExtension({\n kind: 'entity-content',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'page:catalog/entity',\n input: 'contents',\n },\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n path: coreExtensionData.routePath,\n routeRef: coreExtensionData.routeRef.optional(),\n title: catalogExtensionData.entityContentTitle,\n filterFunction: catalogExtensionData.entityFilterFunction.optional(),\n filterExpression: catalogExtensionData.entityFilterExpression.optional(),\n },\n inputs: options.inputs,\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default(options.defaultPath),\n title: z.string().default(options.defaultTitle),\n filter: z.string().optional(),\n }),\n ),\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ inputs })\n .then(element => ({ default: () => element })),\n );\n\n return {\n path: config.path,\n title: config.title,\n routeRef: options.routeRef,\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n ...mergeFilters({ config, options }),\n };\n },\n });\n}\n\n/**\n * Decides what filter outputs to produce, given some options and config\n */\nfunction mergeFilters(inputs: {\n options: {\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n };\n config: {\n filter?: string;\n };\n}): {\n filterFunction?: typeof catalogExtensionData.entityFilterFunction.T;\n filterExpression?: typeof catalogExtensionData.entityFilterExpression.T;\n} {\n const { options, config } = inputs;\n if (config.filter) {\n return { filterExpression: config.filter };\n } else if (typeof options.filter === 'string') {\n return { filterExpression: options.filter };\n } else if (typeof options.filter === 'function') {\n return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W,QAAU,EAAA;AAC7C,IAAO,OAAA,EAAE,gBAAkB,EAAA,OAAA,CAAQ,MAAO,EAAA,CAAA;AAAA,GACjC,MAAA,IAAA,OAAO,OAAQ,CAAA,MAAA,KAAW,UAAY,EAAA;AAC/C,IAAO,OAAA,EAAE,cAAgB,EAAA,OAAA,CAAQ,MAAO,EAAA,CAAA;AAAA,GAC1C;AACA,EAAA,OAAO,EAAC,CAAA;AACV;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.12.3-next.
|
|
3
|
+
"version": "1.12.3-next.2",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@backstage/core-components": "^0.14.10-next.0",
|
|
62
62
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
63
63
|
"@backstage/errors": "^1.2.4",
|
|
64
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
64
|
+
"@backstage/frontend-plugin-api": "^0.7.0-next.2",
|
|
65
65
|
"@backstage/integration-react": "^1.1.30-next.0",
|
|
66
|
-
"@backstage/plugin-catalog-common": "^1.0.26-next.
|
|
67
|
-
"@backstage/plugin-permission-common": "^0.8.1-next.
|
|
68
|
-
"@backstage/plugin-permission-react": "^0.4.25-next.
|
|
66
|
+
"@backstage/plugin-catalog-common": "^1.0.26-next.1",
|
|
67
|
+
"@backstage/plugin-permission-common": "^0.8.1-next.1",
|
|
68
|
+
"@backstage/plugin-permission-react": "^0.4.25-next.1",
|
|
69
69
|
"@backstage/types": "^1.1.1",
|
|
70
70
|
"@backstage/version-bridge": "^1.0.8",
|
|
71
71
|
"@material-ui/core": "^4.12.2",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"zen-observable": "^0.10.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@backstage/cli": "^0.27.0-next.
|
|
85
|
+
"@backstage/cli": "^0.27.0-next.3",
|
|
86
86
|
"@backstage/core-app-api": "^1.14.2-next.0",
|
|
87
|
-
"@backstage/plugin-catalog-common": "^1.0.26-next.
|
|
88
|
-
"@backstage/plugin-scaffolder-common": "^1.5.5-next.
|
|
89
|
-
"@backstage/test-utils": "^1.5.10-next.
|
|
87
|
+
"@backstage/plugin-catalog-common": "^1.0.26-next.1",
|
|
88
|
+
"@backstage/plugin-scaffolder-common": "^1.5.5-next.1",
|
|
89
|
+
"@backstage/test-utils": "^1.5.10-next.2",
|
|
90
90
|
"@testing-library/dom": "^10.0.0",
|
|
91
91
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
92
|
"@testing-library/react": "^15.0.0",
|