@backstage/plugin-catalog-react 2.1.0 → 2.1.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,13 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 448323a: Fixed entity relation cards (e.g., "Has components") only showing one entity at a time by using `paginationOptions: { type: 'none' }` instead of deriving page size from data length.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/ui@0.13.2
|
|
10
|
+
|
|
3
11
|
## 2.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -30,7 +30,7 @@ function EntityDataTable(props) {
|
|
|
30
30
|
mode: "complete",
|
|
31
31
|
data: tableData,
|
|
32
32
|
sortFn,
|
|
33
|
-
paginationOptions: {
|
|
33
|
+
paginationOptions: { type: "none" }
|
|
34
34
|
});
|
|
35
35
|
return /* @__PURE__ */ jsx(
|
|
36
36
|
Table,
|
|
@@ -39,8 +39,7 @@ function EntityDataTable(props) {
|
|
|
39
39
|
...tableProps,
|
|
40
40
|
loading,
|
|
41
41
|
error,
|
|
42
|
-
emptyState
|
|
43
|
-
pagination: { type: "none" }
|
|
42
|
+
emptyState
|
|
44
43
|
}
|
|
45
44
|
);
|
|
46
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDataTable.esm.js","sources":["../../../src/components/EntityDataTable/EntityDataTable.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Table, useTable } from '@backstage/ui';\nimport { useCallback, useMemo, ReactNode } from 'react';\nimport { EntityRow, EntityColumnConfig } from './columnFactories';\nimport { SortDescriptor } from '@backstage/ui';\n\n/** @public */\nexport interface EntityDataTableProps {\n columnConfig: EntityColumnConfig[];\n data: Entity[];\n loading?: boolean;\n error?: Error;\n emptyState?: ReactNode;\n}\n\n/** @public */\nexport function EntityDataTable(props: EntityDataTableProps) {\n const { columnConfig, data, loading, error, emptyState } = props;\n\n const tableData: EntityRow[] = useMemo(\n () =>\n data.map(entity => ({\n ...entity,\n id: stringifyEntityRef(entity),\n })),\n [data],\n );\n\n const sortFn = useCallback(\n (items: EntityRow[], sort: SortDescriptor) => {\n const column = columnConfig.find(c => c.id === sort.column);\n if (!column?.sortValue) {\n return items;\n }\n const getValue = column.sortValue;\n const direction = sort.direction === 'descending' ? -1 : 1;\n return [...items].sort(\n (a, b) => getValue(a).localeCompare(getValue(b)) * direction,\n );\n },\n [columnConfig],\n );\n\n const { tableProps } = useTable({\n mode: 'complete',\n data: tableData,\n sortFn,\n paginationOptions: {
|
|
1
|
+
{"version":3,"file":"EntityDataTable.esm.js","sources":["../../../src/components/EntityDataTable/EntityDataTable.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Table, useTable } from '@backstage/ui';\nimport { useCallback, useMemo, ReactNode } from 'react';\nimport { EntityRow, EntityColumnConfig } from './columnFactories';\nimport { SortDescriptor } from '@backstage/ui';\n\n/** @public */\nexport interface EntityDataTableProps {\n columnConfig: EntityColumnConfig[];\n data: Entity[];\n loading?: boolean;\n error?: Error;\n emptyState?: ReactNode;\n}\n\n/** @public */\nexport function EntityDataTable(props: EntityDataTableProps) {\n const { columnConfig, data, loading, error, emptyState } = props;\n\n const tableData: EntityRow[] = useMemo(\n () =>\n data.map(entity => ({\n ...entity,\n id: stringifyEntityRef(entity),\n })),\n [data],\n );\n\n const sortFn = useCallback(\n (items: EntityRow[], sort: SortDescriptor) => {\n const column = columnConfig.find(c => c.id === sort.column);\n if (!column?.sortValue) {\n return items;\n }\n const getValue = column.sortValue;\n const direction = sort.direction === 'descending' ? -1 : 1;\n return [...items].sort(\n (a, b) => getValue(a).localeCompare(getValue(b)) * direction,\n );\n },\n [columnConfig],\n );\n\n const { tableProps } = useTable({\n mode: 'complete',\n data: tableData,\n sortFn,\n paginationOptions: { type: 'none' },\n });\n\n return (\n <Table\n columnConfig={columnConfig}\n {...tableProps}\n loading={loading}\n error={error}\n emptyState={emptyState}\n />\n );\n}\n"],"names":[],"mappings":";;;;;AAgCO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,EAAE,YAAA,EAAc,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,YAAW,GAAI,KAAA;AAE3D,EAAA,MAAM,SAAA,GAAyB,OAAA;AAAA,IAC7B,MACE,IAAA,CAAK,GAAA,CAAI,CAAA,MAAA,MAAW;AAAA,MAClB,GAAG,MAAA;AAAA,MACH,EAAA,EAAI,mBAAmB,MAAM;AAAA,KAC/B,CAAE,CAAA;AAAA,IACJ,CAAC,IAAI;AAAA,GACP;AAEA,EAAA,MAAM,MAAA,GAAS,WAAA;AAAA,IACb,CAAC,OAAoB,IAAA,KAAyB;AAC5C,MAAA,MAAM,SAAS,YAAA,CAAa,IAAA,CAAK,OAAK,CAAA,CAAE,EAAA,KAAO,KAAK,MAAM,CAAA;AAC1D,MAAA,IAAI,CAAC,QAAQ,SAAA,EAAW;AACtB,QAAA,OAAO,KAAA;AAAA,MACT;AACA,MAAA,MAAM,WAAW,MAAA,CAAO,SAAA;AACxB,MAAA,MAAM,SAAA,GAAY,IAAA,CAAK,SAAA,KAAc,YAAA,GAAe,EAAA,GAAK,CAAA;AACzD,MAAA,OAAO,CAAC,GAAG,KAAK,CAAA,CAAE,IAAA;AAAA,QAChB,CAAC,CAAA,EAAG,CAAA,KAAM,QAAA,CAAS,CAAC,EAAE,aAAA,CAAc,QAAA,CAAS,CAAC,CAAC,CAAA,GAAI;AAAA,OACrD;AAAA,IACF,CAAA;AAAA,IACA,CAAC,YAAY;AAAA,GACf;AAEA,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,QAAA,CAAS;AAAA,IAC9B,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM,SAAA;AAAA,IACN,MAAA;AAAA,IACA,iBAAA,EAAmB,EAAE,IAAA,EAAM,MAAA;AAAO,GACnC,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,YAAA;AAAA,MACC,GAAG,UAAA;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"@backstage/core-plugin-api": "^1.12.4",
|
|
81
81
|
"@backstage/errors": "^1.2.7",
|
|
82
82
|
"@backstage/filter-predicates": "^0.1.1",
|
|
83
|
-
"@backstage/frontend-plugin-api": "^0.15.
|
|
83
|
+
"@backstage/frontend-plugin-api": "^0.15.1",
|
|
84
84
|
"@backstage/integration-react": "^1.2.16",
|
|
85
85
|
"@backstage/plugin-catalog-common": "^1.1.8",
|
|
86
86
|
"@backstage/plugin-permission-common": "^0.9.7",
|
|
87
87
|
"@backstage/plugin-permission-react": "^0.4.41",
|
|
88
88
|
"@backstage/types": "^1.2.2",
|
|
89
|
-
"@backstage/ui": "^0.13.
|
|
89
|
+
"@backstage/ui": "^0.13.2",
|
|
90
90
|
"@backstage/version-bridge": "^1.0.12",
|
|
91
91
|
"@material-ui/core": "^4.12.2",
|
|
92
92
|
"@material-ui/icons": "^4.9.1",
|