@backstage/plugin-catalog-react 2.1.0-next.2 → 2.1.1-next.0
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 +50 -0
- package/dist/alpha.d.ts +111 -30
- package/dist/alpha.esm.js +9 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/EntityDataTable/EntityDataTable.esm.js +49 -0
- package/dist/components/EntityDataTable/EntityDataTable.esm.js.map +1 -0
- package/dist/components/EntityDataTable/columnFactories.esm.js +119 -0
- package/dist/components/EntityDataTable/columnFactories.esm.js.map +1 -0
- package/dist/components/EntityDataTable/presets.esm.js +43 -0
- package/dist/components/EntityDataTable/presets.esm.js.map +1 -0
- package/dist/components/EntityRelationCard/EntityRelationCard.esm.js +65 -0
- package/dist/components/EntityRelationCard/EntityRelationCard.esm.js.map +1 -0
- package/dist/hooks/useEntityListProvider.esm.js +9 -8
- package/dist/hooks/useEntityListProvider.esm.js.map +1 -1
- package/dist/index.d.ts +93 -1
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/translation.esm.js +3 -0
- package/dist/translation.esm.js.map +1 -1
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 2.1.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 51aacae: Fixed a UI flicker in the catalog entity list where changing a filter would briefly flash stale data before showing the new results.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/ui@0.14.0-next.0
|
|
10
|
+
- @backstage/core-components@0.18.9-next.0
|
|
11
|
+
- @backstage/frontend-plugin-api@0.15.2-next.0
|
|
12
|
+
- @backstage/core-compat-api@0.5.10-next.0
|
|
13
|
+
- @backstage/frontend-test-utils@0.5.2-next.0
|
|
14
|
+
- @backstage/integration-react@1.2.17-next.0
|
|
15
|
+
- @backstage/core-plugin-api@1.12.5-next.0
|
|
16
|
+
- @backstage/catalog-client@1.14.0
|
|
17
|
+
- @backstage/catalog-model@1.7.7
|
|
18
|
+
- @backstage/errors@1.2.7
|
|
19
|
+
- @backstage/filter-predicates@0.1.1
|
|
20
|
+
- @backstage/types@1.2.2
|
|
21
|
+
- @backstage/version-bridge@1.0.12
|
|
22
|
+
- @backstage/plugin-catalog-common@1.1.8
|
|
23
|
+
- @backstage/plugin-permission-common@0.9.7
|
|
24
|
+
- @backstage/plugin-permission-react@0.4.42-next.0
|
|
25
|
+
|
|
26
|
+
## 2.1.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- c548a0f: Added `EntityDataTable`, `EntityRelationCard`, `entityDataTableColumns`, `entityColumnPresets`, and related types as alpha exports. These replace `EntityTable` and `RelatedEntitiesCard` (from `@backstage/plugin-catalog`) respectively, providing a unified BUI-based pattern for entity table cards.
|
|
31
|
+
- 4d58894: Added `aliases` and `contentOrder` fields to `EntityContentGroupDefinition`, allowing groups to declare alias IDs and control the sort order of their content items.
|
|
32
|
+
- d14b6e0: Exported `useEntityRefLink` hook that returns a function for generating entity page URLs from entity references.
|
|
33
|
+
- 0be2541: Promoted the plugin's translation ref to the stable package entry point. It was previously only available through the alpha entry point.
|
|
34
|
+
- c6080eb: Added `EntityInfoCard` component to `@backstage/plugin-catalog-react` as a BUI-based card wrapper for entity page cards.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- a49a40d: Updated dependency `zod` to `^3.25.76 || ^4.0.0` & migrated to `/v3` or `/v4` imports.
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @backstage/ui@0.13.0
|
|
41
|
+
- @backstage/core-compat-api@0.5.9
|
|
42
|
+
- @backstage/core-plugin-api@1.12.4
|
|
43
|
+
- @backstage/core-components@0.18.8
|
|
44
|
+
- @backstage/frontend-plugin-api@0.15.0
|
|
45
|
+
- @backstage/catalog-client@1.14.0
|
|
46
|
+
- @backstage/frontend-test-utils@0.5.1
|
|
47
|
+
- @backstage/plugin-permission-react@0.4.41
|
|
48
|
+
- @backstage/filter-predicates@0.1.1
|
|
49
|
+
- @backstage/plugin-permission-common@0.9.7
|
|
50
|
+
- @backstage/catalog-model@1.7.7
|
|
51
|
+
- @backstage/integration-react@1.2.16
|
|
52
|
+
|
|
3
53
|
## 2.1.0-next.2
|
|
4
54
|
|
|
5
55
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { FilterPredicate } from '@backstage/filter-predicates';
|
|
|
6
6
|
import { Entity } from '@backstage/catalog-model';
|
|
7
7
|
import { IconLinkVerticalProps } from '@backstage/core-components';
|
|
8
8
|
import { ResourcePermission } from '@backstage/plugin-permission-common';
|
|
9
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
|
+
import { ColumnConfig, TableItem } from '@backstage/ui';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Returns true if the `owner` argument is a direct owner on the `entity` argument.
|
|
@@ -323,7 +325,113 @@ declare function convertLegacyEntityContentExtension(LegacyExtension: ComponentT
|
|
|
323
325
|
defaultTitle?: [Error: `Use the 'title' override instead`];
|
|
324
326
|
}): ExtensionDefinition;
|
|
325
327
|
|
|
328
|
+
/**
|
|
329
|
+
* A thin wrapper around the
|
|
330
|
+
* {@link @backstage/plugin-permission-react#usePermission} hook which uses the
|
|
331
|
+
* current entity in context to make an authorization request for the given
|
|
332
|
+
* {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.
|
|
333
|
+
*
|
|
334
|
+
* Note: this hook blocks the permission request until the entity has loaded in
|
|
335
|
+
* context. If you have the entityRef and need concurrent requests, use the
|
|
336
|
+
* `usePermission` hook directly.
|
|
337
|
+
* @alpha
|
|
338
|
+
*/
|
|
339
|
+
declare function useEntityPermission(permission: ResourcePermission<'catalog-entity'>): {
|
|
340
|
+
loading: boolean;
|
|
341
|
+
allowed: boolean;
|
|
342
|
+
error?: Error;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @alpha
|
|
347
|
+
*/
|
|
348
|
+
type EntityTableColumnTitleProps = {
|
|
349
|
+
translationKey: 'name' | 'system' | 'owner' | 'type' | 'lifecycle' | 'namespace' | 'description' | 'tags' | 'targets' | 'title' | 'label' | 'domain';
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* @alpha
|
|
353
|
+
*/
|
|
354
|
+
declare const EntityTableColumnTitle: ({ translationKey, }: EntityTableColumnTitleProps) => "System" | "Title" | "Domain" | "Lifecycle" | "Namespace" | "Owner" | "Tags" | "Type" | "Name" | "Description" | "Targets" | "Label";
|
|
355
|
+
|
|
356
|
+
/** @public */
|
|
357
|
+
type EntityRow = Entity & TableItem;
|
|
358
|
+
/** @public */
|
|
359
|
+
interface EntityColumnConfig extends ColumnConfig<EntityRow> {
|
|
360
|
+
sortValue?: (entity: EntityRow) => string;
|
|
361
|
+
}
|
|
362
|
+
/** @public */
|
|
363
|
+
declare const columnFactories: Readonly<{
|
|
364
|
+
createEntityRefColumn(options: {
|
|
365
|
+
defaultKind?: string;
|
|
366
|
+
isRowHeader?: boolean;
|
|
367
|
+
}): EntityColumnConfig;
|
|
368
|
+
createEntityRelationColumn(options: {
|
|
369
|
+
id: string;
|
|
370
|
+
translationKey: "owner" | "system" | "domain";
|
|
371
|
+
relation: string;
|
|
372
|
+
defaultKind?: string;
|
|
373
|
+
filter?: {
|
|
374
|
+
kind: string;
|
|
375
|
+
};
|
|
376
|
+
}): EntityColumnConfig;
|
|
377
|
+
createOwnerColumn(): EntityColumnConfig;
|
|
378
|
+
createSystemColumn(): EntityColumnConfig;
|
|
379
|
+
createDomainColumn(): EntityColumnConfig;
|
|
380
|
+
createMetadataDescriptionColumn(): EntityColumnConfig;
|
|
381
|
+
createSpecTypeColumn(): EntityColumnConfig;
|
|
382
|
+
createSpecLifecycleColumn(): EntityColumnConfig;
|
|
383
|
+
}>;
|
|
384
|
+
|
|
385
|
+
/** @public */
|
|
386
|
+
interface EntityDataTableProps {
|
|
387
|
+
columnConfig: EntityColumnConfig[];
|
|
388
|
+
data: Entity[];
|
|
389
|
+
loading?: boolean;
|
|
390
|
+
error?: Error;
|
|
391
|
+
emptyState?: ReactNode;
|
|
392
|
+
}
|
|
393
|
+
/** @public */
|
|
394
|
+
declare function EntityDataTable(props: EntityDataTableProps): react_jsx_runtime.JSX.Element;
|
|
395
|
+
|
|
326
396
|
/** @alpha */
|
|
397
|
+
declare const entityColumnPresets: {
|
|
398
|
+
readonly component: {
|
|
399
|
+
readonly columns: EntityColumnConfig[];
|
|
400
|
+
readonly helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component";
|
|
401
|
+
};
|
|
402
|
+
readonly resource: {
|
|
403
|
+
readonly columns: EntityColumnConfig[];
|
|
404
|
+
readonly helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource";
|
|
405
|
+
};
|
|
406
|
+
readonly system: {
|
|
407
|
+
readonly columns: EntityColumnConfig[];
|
|
408
|
+
readonly helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system";
|
|
409
|
+
};
|
|
410
|
+
readonly domain: {
|
|
411
|
+
readonly columns: EntityColumnConfig[];
|
|
412
|
+
readonly helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain";
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/** @public */
|
|
417
|
+
interface EntityRelationCardProps {
|
|
418
|
+
title: string;
|
|
419
|
+
relationType: string;
|
|
420
|
+
entityKind?: string;
|
|
421
|
+
columnConfig: EntityColumnConfig[];
|
|
422
|
+
emptyState?: {
|
|
423
|
+
message: string;
|
|
424
|
+
helpLink?: string;
|
|
425
|
+
};
|
|
426
|
+
className?: string;
|
|
427
|
+
}
|
|
428
|
+
/** @public */
|
|
429
|
+
declare function EntityRelationCard(props: EntityRelationCardProps): react_jsx_runtime.JSX.Element;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* @alpha
|
|
433
|
+
* @deprecated Import from `@backstage/plugin-catalog-react` instead.
|
|
434
|
+
*/
|
|
327
435
|
declare const catalogReactTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"catalog-react", {
|
|
328
436
|
readonly "catalogFilter.title": "Filters";
|
|
329
437
|
readonly "catalogFilter.buttonTitle": "Filters";
|
|
@@ -407,6 +515,7 @@ declare const catalogReactTranslationRef: _backstage_frontend_plugin_api.Transla
|
|
|
407
515
|
readonly "entityTableColumnTitle.owner": "Owner";
|
|
408
516
|
readonly "entityTableColumnTitle.lifecycle": "Lifecycle";
|
|
409
517
|
readonly "entityTableColumnTitle.targets": "Targets";
|
|
518
|
+
readonly "entityRelationCard.emptyHelpLinkTitle": "Learn how to change this.";
|
|
410
519
|
readonly "missingAnnotationEmptyState.title": "Missing Annotation";
|
|
411
520
|
readonly "missingAnnotationEmptyState.readMore": "Read more";
|
|
412
521
|
readonly "missingAnnotationEmptyState.annotationYaml": "Add the annotation to your {{entityKind}} YAML as shown in the highlighted example below:";
|
|
@@ -414,33 +523,5 @@ declare const catalogReactTranslationRef: _backstage_frontend_plugin_api.Transla
|
|
|
414
523
|
readonly "missingAnnotationEmptyState.generateDescription_other": "The annotations {{annotations}} are missing. You need to add the annotations to your {{entityKind}} if you want to enable this tool.";
|
|
415
524
|
}>;
|
|
416
525
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
* {@link @backstage/plugin-permission-react#usePermission} hook which uses the
|
|
420
|
-
* current entity in context to make an authorization request for the given
|
|
421
|
-
* {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.
|
|
422
|
-
*
|
|
423
|
-
* Note: this hook blocks the permission request until the entity has loaded in
|
|
424
|
-
* context. If you have the entityRef and need concurrent requests, use the
|
|
425
|
-
* `usePermission` hook directly.
|
|
426
|
-
* @alpha
|
|
427
|
-
*/
|
|
428
|
-
declare function useEntityPermission(permission: ResourcePermission<'catalog-entity'>): {
|
|
429
|
-
loading: boolean;
|
|
430
|
-
allowed: boolean;
|
|
431
|
-
error?: Error;
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @alpha
|
|
436
|
-
*/
|
|
437
|
-
type EntityTableColumnTitleProps = {
|
|
438
|
-
translationKey: 'name' | 'system' | 'owner' | 'type' | 'lifecycle' | 'namespace' | 'description' | 'tags' | 'targets' | 'title' | 'label' | 'domain';
|
|
439
|
-
};
|
|
440
|
-
/**
|
|
441
|
-
* @alpha
|
|
442
|
-
*/
|
|
443
|
-
declare const EntityTableColumnTitle: ({ translationKey, }: EntityTableColumnTitleProps) => "System" | "Title" | "Domain" | "Lifecycle" | "Namespace" | "Owner" | "Tags" | "Type" | "Name" | "Description" | "Targets" | "Label";
|
|
444
|
-
|
|
445
|
-
export { CatalogFilterBlueprint, EntityCardBlueprint, EntityContentBlueprint, EntityContentLayoutBlueprint, EntityContextMenuItemBlueprint, EntityHeaderBlueprint, EntityIconLinkBlueprint, EntityTableColumnTitle, catalogReactTranslationRef, convertLegacyEntityCardExtension, convertLegacyEntityContentExtension, defaultEntityContentGroupDefinitions, defaultEntityContentGroups, isOwnerOf, useEntityPermission };
|
|
446
|
-
export type { EntityCardType, EntityContentGroupDefinitions, EntityContentLayoutProps, EntityContextMenuItemParams, EntityTableColumnTitleProps, UseProps };
|
|
526
|
+
export { CatalogFilterBlueprint, EntityCardBlueprint, EntityContentBlueprint, EntityContentLayoutBlueprint, EntityContextMenuItemBlueprint, EntityDataTable, EntityHeaderBlueprint, EntityIconLinkBlueprint, EntityRelationCard, EntityTableColumnTitle, catalogReactTranslationRef, convertLegacyEntityCardExtension, convertLegacyEntityContentExtension, defaultEntityContentGroupDefinitions, defaultEntityContentGroups, entityColumnPresets, columnFactories as entityDataTableColumns, isOwnerOf, useEntityPermission };
|
|
527
|
+
export type { EntityCardType, EntityColumnConfig, EntityContentGroupDefinitions, EntityContentLayoutProps, EntityContextMenuItemParams, EntityDataTableProps, EntityRelationCardProps, EntityRow, EntityTableColumnTitleProps, UseProps };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -8,8 +8,16 @@ export { EntityContextMenuItemBlueprint } from './alpha/blueprints/EntityContext
|
|
|
8
8
|
export { EntityIconLinkBlueprint } from './alpha/blueprints/EntityIconLinkBlueprint.esm.js';
|
|
9
9
|
export { convertLegacyEntityCardExtension } from './alpha/converters/convertLegacyEntityCardExtension.esm.js';
|
|
10
10
|
export { convertLegacyEntityContentExtension } from './alpha/converters/convertLegacyEntityContentExtension.esm.js';
|
|
11
|
-
|
|
11
|
+
import { catalogReactTranslationRef as catalogReactTranslationRef$1 } from './translation.esm.js';
|
|
12
12
|
export { isOwnerOf } from './utils/isOwnerOf.esm.js';
|
|
13
13
|
export { useEntityPermission } from './hooks/useEntityPermission.esm.js';
|
|
14
14
|
export { EntityTableColumnTitle } from './components/EntityTable/TitleColumn.esm.js';
|
|
15
|
+
export { EntityDataTable } from './components/EntityDataTable/EntityDataTable.esm.js';
|
|
16
|
+
export { columnFactories as entityDataTableColumns } from './components/EntityDataTable/columnFactories.esm.js';
|
|
17
|
+
export { entityColumnPresets } from './components/EntityDataTable/presets.esm.js';
|
|
18
|
+
export { EntityRelationCard } from './components/EntityRelationCard/EntityRelationCard.esm.js';
|
|
19
|
+
|
|
20
|
+
const catalogReactTranslationRef = catalogReactTranslationRef$1;
|
|
21
|
+
|
|
22
|
+
export { catalogReactTranslationRef };
|
|
15
23
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"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\nexport * from './blueprints';\nexport * from './converters';\nimport { catalogReactTranslationRef as _catalogReactTranslationRef } from '../translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog-react` instead.\n */\nexport const catalogReactTranslationRef = _catalogReactTranslationRef;\nexport { isOwnerOf } from '../utils/isOwnerOf';\nexport { useEntityPermission } from '../hooks/useEntityPermission';\nexport * from '../components/EntityTable/TitleColumn';\nexport * from '../components/EntityDataTable';\nexport * from '../components/EntityRelationCard';\n"],"names":["_catalogReactTranslationRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBO,MAAM,0BAAA,GAA6BA;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
|
+
import { useTable, Table } from '@backstage/ui';
|
|
4
|
+
import { useMemo, useCallback } from 'react';
|
|
5
|
+
|
|
6
|
+
function EntityDataTable(props) {
|
|
7
|
+
const { columnConfig, data, loading, error, emptyState } = props;
|
|
8
|
+
const tableData = useMemo(
|
|
9
|
+
() => data.map((entity) => ({
|
|
10
|
+
...entity,
|
|
11
|
+
id: stringifyEntityRef(entity)
|
|
12
|
+
})),
|
|
13
|
+
[data]
|
|
14
|
+
);
|
|
15
|
+
const sortFn = useCallback(
|
|
16
|
+
(items, sort) => {
|
|
17
|
+
const column = columnConfig.find((c) => c.id === sort.column);
|
|
18
|
+
if (!column?.sortValue) {
|
|
19
|
+
return items;
|
|
20
|
+
}
|
|
21
|
+
const getValue = column.sortValue;
|
|
22
|
+
const direction = sort.direction === "descending" ? -1 : 1;
|
|
23
|
+
return [...items].sort(
|
|
24
|
+
(a, b) => getValue(a).localeCompare(getValue(b)) * direction
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
[columnConfig]
|
|
28
|
+
);
|
|
29
|
+
const { tableProps } = useTable({
|
|
30
|
+
mode: "complete",
|
|
31
|
+
data: tableData,
|
|
32
|
+
sortFn,
|
|
33
|
+
paginationOptions: { pageSize: tableData.length || 1 }
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Table,
|
|
37
|
+
{
|
|
38
|
+
columnConfig,
|
|
39
|
+
...tableProps,
|
|
40
|
+
loading,
|
|
41
|
+
error,
|
|
42
|
+
emptyState,
|
|
43
|
+
pagination: { type: "none" }
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { EntityDataTable };
|
|
49
|
+
//# sourceMappingURL=EntityDataTable.esm.js.map
|
|
@@ -0,0 +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: { pageSize: tableData.length || 1 },\n });\n\n return (\n <Table\n columnConfig={columnConfig}\n {...tableProps}\n loading={loading}\n error={error}\n emptyState={emptyState}\n pagination={{ type: 'none' }}\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,QAAA,EAAU,SAAA,CAAU,UAAU,CAAA;AAAE,GACtD,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,UAAA;AAAA,MACA,UAAA,EAAY,EAAE,IAAA,EAAM,MAAA;AAAO;AAAA,GAC7B;AAEJ;;;;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { RELATION_PART_OF, RELATION_OWNED_BY } from '@backstage/catalog-model';
|
|
3
|
+
import { CellText, Column, Cell } from '@backstage/ui';
|
|
4
|
+
import { EntityRefLink } from '../EntityRefLink/EntityRefLink.esm.js';
|
|
5
|
+
import { EntityRefLinks } from '../EntityRefLink/EntityRefLinks.esm.js';
|
|
6
|
+
import { humanizeEntityRef } from '../EntityRefLink/humanize.esm.js';
|
|
7
|
+
import { EntityTableColumnTitle } from '../EntityTable/TitleColumn.esm.js';
|
|
8
|
+
import { getEntityRelations } from '../../utils/getEntityRelations.esm.js';
|
|
9
|
+
|
|
10
|
+
const columnFactories = Object.freeze({
|
|
11
|
+
createEntityRefColumn(options) {
|
|
12
|
+
const isRowHeader = options.isRowHeader ?? true;
|
|
13
|
+
return {
|
|
14
|
+
id: "name",
|
|
15
|
+
label: "Name",
|
|
16
|
+
header: () => /* @__PURE__ */ jsx(Column, { id: "name", isRowHeader, allowsSorting: true, children: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: "name" }) }),
|
|
17
|
+
isRowHeader,
|
|
18
|
+
isSortable: true,
|
|
19
|
+
cell: (entity) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(
|
|
20
|
+
EntityRefLink,
|
|
21
|
+
{
|
|
22
|
+
entityRef: entity,
|
|
23
|
+
defaultKind: options.defaultKind,
|
|
24
|
+
title: entity.metadata?.title
|
|
25
|
+
}
|
|
26
|
+
) }),
|
|
27
|
+
sortValue: (entity) => entity.metadata?.title || humanizeEntityRef(entity, { defaultKind: options.defaultKind })
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
createEntityRelationColumn(options) {
|
|
31
|
+
return {
|
|
32
|
+
id: options.id,
|
|
33
|
+
label: options.id.charAt(0).toUpperCase() + options.id.slice(1),
|
|
34
|
+
header: () => /* @__PURE__ */ jsx(Column, { id: options.id, allowsSorting: true, children: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: options.translationKey }) }),
|
|
35
|
+
isSortable: true,
|
|
36
|
+
cell: (entity) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(
|
|
37
|
+
EntityRefLinks,
|
|
38
|
+
{
|
|
39
|
+
entityRefs: getEntityRelations(
|
|
40
|
+
entity,
|
|
41
|
+
options.relation,
|
|
42
|
+
options.filter
|
|
43
|
+
),
|
|
44
|
+
defaultKind: options.defaultKind
|
|
45
|
+
}
|
|
46
|
+
) }),
|
|
47
|
+
sortValue: (entity) => getEntityRelations(entity, options.relation, options.filter).map((r) => humanizeEntityRef(r, { defaultKind: options.defaultKind })).join(", ")
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
createOwnerColumn() {
|
|
51
|
+
return columnFactories.createEntityRelationColumn({
|
|
52
|
+
id: "owner",
|
|
53
|
+
translationKey: "owner",
|
|
54
|
+
relation: RELATION_OWNED_BY,
|
|
55
|
+
defaultKind: "group"
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
createSystemColumn() {
|
|
59
|
+
return columnFactories.createEntityRelationColumn({
|
|
60
|
+
id: "system",
|
|
61
|
+
translationKey: "system",
|
|
62
|
+
relation: RELATION_PART_OF,
|
|
63
|
+
defaultKind: "system",
|
|
64
|
+
filter: { kind: "system" }
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
createDomainColumn() {
|
|
68
|
+
return columnFactories.createEntityRelationColumn({
|
|
69
|
+
id: "domain",
|
|
70
|
+
translationKey: "domain",
|
|
71
|
+
relation: RELATION_PART_OF,
|
|
72
|
+
defaultKind: "domain",
|
|
73
|
+
filter: { kind: "domain" }
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
createMetadataDescriptionColumn() {
|
|
77
|
+
return {
|
|
78
|
+
id: "description",
|
|
79
|
+
label: "Description",
|
|
80
|
+
header: () => /* @__PURE__ */ jsx(Column, { id: "description", allowsSorting: true, children: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: "description" }) }),
|
|
81
|
+
isSortable: true,
|
|
82
|
+
cell: (entity) => /* @__PURE__ */ jsx(CellText, { title: entity.metadata.description ?? "" }),
|
|
83
|
+
sortValue: (entity) => entity.metadata.description ?? ""
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
createSpecTypeColumn() {
|
|
87
|
+
return {
|
|
88
|
+
id: "type",
|
|
89
|
+
label: "Type",
|
|
90
|
+
header: () => /* @__PURE__ */ jsx(Column, { id: "type", allowsSorting: true, children: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: "type" }) }),
|
|
91
|
+
isSortable: true,
|
|
92
|
+
cell: (entity) => /* @__PURE__ */ jsx(
|
|
93
|
+
CellText,
|
|
94
|
+
{
|
|
95
|
+
title: entity.spec?.type ?? ""
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
sortValue: (entity) => entity.spec?.type ?? ""
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
createSpecLifecycleColumn() {
|
|
102
|
+
return {
|
|
103
|
+
id: "lifecycle",
|
|
104
|
+
label: "Lifecycle",
|
|
105
|
+
header: () => /* @__PURE__ */ jsx(Column, { id: "lifecycle", allowsSorting: true, children: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: "lifecycle" }) }),
|
|
106
|
+
isSortable: true,
|
|
107
|
+
cell: (entity) => /* @__PURE__ */ jsx(
|
|
108
|
+
CellText,
|
|
109
|
+
{
|
|
110
|
+
title: entity.spec?.lifecycle ?? ""
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
sortValue: (entity) => entity.spec?.lifecycle ?? ""
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export { columnFactories };
|
|
119
|
+
//# sourceMappingURL=columnFactories.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnFactories.esm.js","sources":["../../../src/components/EntityDataTable/columnFactories.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 {\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { Cell, CellText, Column, ColumnConfig, TableItem } from '@backstage/ui';\nimport {\n EntityRefLink,\n EntityRefLinks,\n humanizeEntityRef,\n} from '../EntityRefLink';\nimport { EntityTableColumnTitle } from '../EntityTable/TitleColumn';\nimport { getEntityRelations } from '../../utils';\n\n/** @public */\nexport type EntityRow = Entity & TableItem;\n\n/** @public */\nexport interface EntityColumnConfig extends ColumnConfig<EntityRow> {\n sortValue?: (entity: EntityRow) => string;\n}\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn(options: {\n defaultKind?: string;\n isRowHeader?: boolean;\n }): EntityColumnConfig {\n const isRowHeader = options.isRowHeader ?? true;\n return {\n id: 'name',\n label: 'Name',\n header: () => (\n <Column id=\"name\" isRowHeader={isRowHeader} allowsSorting>\n <EntityTableColumnTitle translationKey=\"name\" />\n </Column>\n ),\n isRowHeader,\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLink\n entityRef={entity}\n defaultKind={options.defaultKind}\n title={entity.metadata?.title}\n />\n </Cell>\n ),\n sortValue: entity =>\n entity.metadata?.title ||\n humanizeEntityRef(entity, { defaultKind: options.defaultKind }),\n };\n },\n\n createEntityRelationColumn(options: {\n id: string;\n translationKey: 'owner' | 'system' | 'domain';\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n }): EntityColumnConfig {\n return {\n id: options.id,\n label: options.id.charAt(0).toUpperCase() + options.id.slice(1),\n header: () => (\n <Column id={options.id} allowsSorting>\n <EntityTableColumnTitle translationKey={options.translationKey} />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLinks\n entityRefs={getEntityRelations(\n entity,\n options.relation,\n options.filter,\n )}\n defaultKind={options.defaultKind}\n />\n </Cell>\n ),\n sortValue: entity =>\n getEntityRelations(entity, options.relation, options.filter)\n .map(r => humanizeEntityRef(r, { defaultKind: options.defaultKind }))\n .join(', '),\n };\n },\n\n createOwnerColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'owner',\n translationKey: 'owner',\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n\n createSystemColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'system',\n translationKey: 'system',\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: { kind: 'system' },\n });\n },\n\n createDomainColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'domain',\n translationKey: 'domain',\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: { kind: 'domain' },\n });\n },\n\n createMetadataDescriptionColumn(): EntityColumnConfig {\n return {\n id: 'description',\n label: 'Description',\n header: () => (\n <Column id=\"description\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"description\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => <CellText title={entity.metadata.description ?? ''} />,\n sortValue: entity => entity.metadata.description ?? '',\n };\n },\n\n createSpecTypeColumn(): EntityColumnConfig {\n return {\n id: 'type',\n label: 'Type',\n header: () => (\n <Column id=\"type\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"type\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.type ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.type ?? '',\n };\n },\n\n createSpecLifecycleColumn(): EntityColumnConfig {\n return {\n id: 'lifecycle',\n label: 'Lifecycle',\n header: () => (\n <Column id=\"lifecycle\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"lifecycle\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? '',\n };\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AAuCO,MAAM,eAAA,GAAkB,OAAO,MAAA,CAAO;AAAA,EAC3C,sBAAsB,OAAA,EAGC;AACrB,IAAA,MAAM,WAAA,GAAc,QAAQ,WAAA,IAAe,IAAA;AAC3C,IAAA,OAAO;AAAA,MACL,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AC9C,IAAA,OAAO;AAAA,MACL,EAAA,EAAI,WAAA;AAAA,MACJ,KAAA,EAAO,WAAA;AAAA,MACP,MAAA,EAAQ,sBACN,GAAA,CAAC,MAAA,EAAA,EAAO,EAAA,EAAG,WAAA,EAAY,aAAA,EAAa,IAAA,EAClC,QAAA,kBAAA,GAAA,CAAC,sBAAA,EAAA,EAAuB,cAAA,EAAe,WAAA,EAAY,CAAA,EACrD,CAAA;AAAA,MAEF,UAAA,EAAY,IAAA;AAAA,MACZ,MAAM,CAAA,MAAA,qBACJ,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,KAAA,EACG,MAAA,CAAO,IAAA,EAA6C,SAAA,IAAa;AAAA;AAAA,OAEtE;AAAA,MAEF,SAAA,EAAW,CAAA,MAAA,KACR,MAAA,CAAO,IAAA,EAA6C,SAAA,IAAa;AAAA,KACtE;AAAA,EACF;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { columnFactories } from './columnFactories.esm.js';
|
|
2
|
+
|
|
3
|
+
const entityColumnPresets = {
|
|
4
|
+
component: {
|
|
5
|
+
columns: [
|
|
6
|
+
columnFactories.createEntityRefColumn({ defaultKind: "component" }),
|
|
7
|
+
columnFactories.createOwnerColumn(),
|
|
8
|
+
columnFactories.createSpecTypeColumn(),
|
|
9
|
+
columnFactories.createSpecLifecycleColumn(),
|
|
10
|
+
columnFactories.createMetadataDescriptionColumn()
|
|
11
|
+
],
|
|
12
|
+
helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component"
|
|
13
|
+
},
|
|
14
|
+
resource: {
|
|
15
|
+
columns: [
|
|
16
|
+
columnFactories.createEntityRefColumn({ defaultKind: "resource" }),
|
|
17
|
+
columnFactories.createOwnerColumn(),
|
|
18
|
+
columnFactories.createSpecTypeColumn(),
|
|
19
|
+
columnFactories.createSpecLifecycleColumn(),
|
|
20
|
+
columnFactories.createMetadataDescriptionColumn()
|
|
21
|
+
],
|
|
22
|
+
helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource"
|
|
23
|
+
},
|
|
24
|
+
system: {
|
|
25
|
+
columns: [
|
|
26
|
+
columnFactories.createEntityRefColumn({ defaultKind: "system" }),
|
|
27
|
+
columnFactories.createOwnerColumn(),
|
|
28
|
+
columnFactories.createMetadataDescriptionColumn()
|
|
29
|
+
],
|
|
30
|
+
helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system"
|
|
31
|
+
},
|
|
32
|
+
domain: {
|
|
33
|
+
columns: [
|
|
34
|
+
columnFactories.createEntityRefColumn({ defaultKind: "domain" }),
|
|
35
|
+
columnFactories.createOwnerColumn(),
|
|
36
|
+
columnFactories.createMetadataDescriptionColumn()
|
|
37
|
+
],
|
|
38
|
+
helpLink: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { entityColumnPresets };
|
|
43
|
+
//# sourceMappingURL=presets.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.esm.js","sources":["../../../src/components/EntityDataTable/presets.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 { columnFactories, EntityColumnConfig } from './columnFactories';\n\n/** @alpha */\nexport const entityColumnPresets = {\n component: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component',\n },\n resource: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'resource' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource',\n },\n system: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system',\n },\n domain: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'domain' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain',\n },\n} as const;\n"],"names":[],"mappings":";;AAmBO,MAAM,mBAAA,GAAsB;AAAA,EACjC,SAAA,EAAW;AAAA,IACT,OAAA,EAAS;AAAA,MACP,eAAA,CAAgB,qBAAA,CAAsB,EAAE,WAAA,EAAa,aAAa,CAAA;AAAA,MAClE,gBAAgB,iBAAA,EAAkB;AAAA,MAClC,gBAAgB,oBAAA,EAAqB;AAAA,MACrC,gBAAgB,yBAAA,EAA0B;AAAA,MAC1C,gBAAgB,+BAAA;AAAgC,KAClD;AAAA,IACA,QAAA,EACE;AAAA,GACJ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,eAAA,CAAgB,qBAAA,CAAsB,EAAE,WAAA,EAAa,YAAY,CAAA;AAAA,MACjE,gBAAgB,iBAAA,EAAkB;AAAA,MAClC,gBAAgB,oBAAA,EAAqB;AAAA,MACrC,gBAAgB,yBAAA,EAA0B;AAAA,MAC1C,gBAAgB,+BAAA;AAAgC,KAClD;AAAA,IACA,QAAA,EACE;AAAA,GACJ;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS;AAAA,MACP,eAAA,CAAgB,qBAAA,CAAsB,EAAE,WAAA,EAAa,UAAU,CAAA;AAAA,MAC/D,gBAAgB,iBAAA,EAAkB;AAAA,MAClC,gBAAgB,+BAAA;AAAgC,KAClD;AAAA,IACA,QAAA,EACE;AAAA,GACJ;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS;AAAA,MACP,eAAA,CAAgB,qBAAA,CAAsB,EAAE,WAAA,EAAa,UAAU,CAAA;AAAA,MAC/D,gBAAgB,iBAAA,EAAkB;AAAA,MAClC,gBAAgB,+BAAA;AAAgC,KAClD;AAAA,IACA,QAAA,EACE;AAAA;AAEN;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Alert, Text, Link } from '@backstage/ui';
|
|
3
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { EntityInfoCard } from '../EntityInfoCard/EntityInfoCard.esm.js';
|
|
5
|
+
import { EntityDataTable } from '../EntityDataTable/EntityDataTable.esm.js';
|
|
6
|
+
import '@backstage/catalog-model';
|
|
7
|
+
import '../EntityRefLink/EntityRefLink.esm.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'lodash/get';
|
|
10
|
+
import { catalogReactTranslationRef } from '../../translation.esm.js';
|
|
11
|
+
import '../EntityDataTable/presets.esm.js';
|
|
12
|
+
import { useEntity } from '../../hooks/useEntity.esm.js';
|
|
13
|
+
import '../../hooks/useEntityListProvider.esm.js';
|
|
14
|
+
import 'react-use/esm/useAsync';
|
|
15
|
+
import 'lodash/isEqual';
|
|
16
|
+
import 'lodash/sortBy';
|
|
17
|
+
import '@backstage/core-plugin-api';
|
|
18
|
+
import '../../api.esm.js';
|
|
19
|
+
import { useRelatedEntities } from '../../hooks/useRelatedEntities.esm.js';
|
|
20
|
+
import 'react-use/esm/useObservable';
|
|
21
|
+
import '../../apis/EntityPresentationApi/EntityPresentationApi.esm.js';
|
|
22
|
+
import '../../apis/StarredEntitiesApi/StarredEntitiesApi.esm.js';
|
|
23
|
+
import 'zen-observable';
|
|
24
|
+
|
|
25
|
+
function EntityRelationCard(props) {
|
|
26
|
+
const {
|
|
27
|
+
title,
|
|
28
|
+
relationType,
|
|
29
|
+
entityKind,
|
|
30
|
+
columnConfig,
|
|
31
|
+
emptyState,
|
|
32
|
+
className
|
|
33
|
+
} = props;
|
|
34
|
+
const { t } = useTranslationRef(catalogReactTranslationRef);
|
|
35
|
+
const { entity } = useEntity();
|
|
36
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
37
|
+
type: relationType,
|
|
38
|
+
kind: entityKind
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ jsx(EntityInfoCard, { title, className, children: error ? /* @__PURE__ */ jsx(Alert, { status: "warning", icon: true, title: error.message, role: "status" }) : /* @__PURE__ */ jsx(
|
|
41
|
+
EntityDataTable,
|
|
42
|
+
{
|
|
43
|
+
columnConfig,
|
|
44
|
+
data: entities ?? [],
|
|
45
|
+
loading,
|
|
46
|
+
emptyState: emptyState && /* @__PURE__ */ jsxs(Text, { as: "p", children: [
|
|
47
|
+
emptyState.message,
|
|
48
|
+
" ",
|
|
49
|
+
emptyState.helpLink && /* @__PURE__ */ jsx(
|
|
50
|
+
Link,
|
|
51
|
+
{
|
|
52
|
+
href: emptyState.helpLink,
|
|
53
|
+
target: "_blank",
|
|
54
|
+
rel: "noopener noreferrer",
|
|
55
|
+
variant: "body-medium",
|
|
56
|
+
children: t("entityRelationCard.emptyHelpLinkTitle")
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] })
|
|
60
|
+
}
|
|
61
|
+
) });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { EntityRelationCard };
|
|
65
|
+
//# sourceMappingURL=EntityRelationCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityRelationCard.esm.js","sources":["../../../src/components/EntityRelationCard/EntityRelationCard.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 { Alert, Link, Text } from '@backstage/ui';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { EntityInfoCard } from '../EntityInfoCard';\nimport { EntityDataTable } from '../EntityDataTable';\nimport { EntityColumnConfig } from '../EntityDataTable/columnFactories';\nimport { useEntity, useRelatedEntities } from '../../hooks';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/** @public */\nexport interface EntityRelationCardProps {\n title: string;\n relationType: string;\n entityKind?: string;\n columnConfig: EntityColumnConfig[];\n emptyState?: {\n message: string;\n helpLink?: string;\n };\n className?: string;\n}\n\n/** @public */\nexport function EntityRelationCard(props: EntityRelationCardProps) {\n const {\n title,\n relationType,\n entityKind,\n columnConfig,\n emptyState,\n className,\n } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n return (\n <EntityInfoCard title={title} className={className}>\n {error ? (\n <Alert status=\"warning\" icon title={error.message} role=\"status\" />\n ) : (\n <EntityDataTable\n columnConfig={columnConfig}\n data={entities ?? []}\n loading={loading}\n emptyState={\n emptyState && (\n <Text as=\"p\">\n {emptyState.message}{' '}\n {emptyState.helpLink && (\n <Link\n href={emptyState.helpLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"body-medium\"\n >\n {t('entityRelationCard.emptyHelpLinkTitle')}\n </Link>\n )}\n </Text>\n )\n }\n />\n )}\n </EntityInfoCard>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsCO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ;AAAA,IAC9D,IAAA,EAAM,YAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,2BACG,cAAA,EAAA,EAAe,KAAA,EAAc,SAAA,EAC3B,QAAA,EAAA,KAAA,uBACE,KAAA,EAAA,EAAM,MAAA,EAAO,SAAA,EAAU,IAAA,EAAI,MAAC,KAAA,EAAO,KAAA,CAAM,OAAA,EAAS,IAAA,EAAK,UAAS,CAAA,mBAEjE,GAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,YAAA;AAAA,MACA,IAAA,EAAM,YAAY,EAAC;AAAA,MACnB,OAAA;AAAA,MACA,UAAA,EACE,UAAA,oBACE,IAAA,CAAC,IAAA,EAAA,EAAK,IAAG,GAAA,EACN,QAAA,EAAA;AAAA,QAAA,UAAA,CAAW,OAAA;AAAA,QAAS,GAAA;AAAA,QACpB,WAAW,QAAA,oBACV,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,MAAM,UAAA,CAAW,QAAA;AAAA,YACjB,MAAA,EAAO,QAAA;AAAA,YACP,GAAA,EAAI,qBAAA;AAAA,YACJ,OAAA,EAAQ,aAAA;AAAA,YAEP,YAAE,uCAAuC;AAAA;AAAA;AAC5C,OAAA,EAEJ;AAAA;AAAA,GAGN,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -227,28 +227,29 @@ const EntityListProvider = (props) => {
|
|
|
227
227
|
},
|
|
228
228
|
[paginationMode]
|
|
229
229
|
);
|
|
230
|
+
const latestOutput = resolvedValue ?? outputState;
|
|
230
231
|
const pageInfo = useMemo(() => {
|
|
231
232
|
if (paginationMode !== "cursor") {
|
|
232
233
|
return void 0;
|
|
233
234
|
}
|
|
234
|
-
const prevCursor =
|
|
235
|
-
const nextCursor =
|
|
235
|
+
const prevCursor = latestOutput.pageInfo?.prevCursor;
|
|
236
|
+
const nextCursor = latestOutput.pageInfo?.nextCursor;
|
|
236
237
|
return {
|
|
237
238
|
prev: prevCursor ? () => setCursor(prevCursor) : void 0,
|
|
238
239
|
next: nextCursor ? () => setCursor(nextCursor) : void 0
|
|
239
240
|
};
|
|
240
|
-
}, [paginationMode,
|
|
241
|
+
}, [paginationMode, latestOutput.pageInfo]);
|
|
241
242
|
const value = useMemo(
|
|
242
243
|
() => ({
|
|
243
|
-
filters:
|
|
244
|
-
entities:
|
|
245
|
-
backendEntities:
|
|
244
|
+
filters: latestOutput.appliedFilters,
|
|
245
|
+
entities: latestOutput.entities,
|
|
246
|
+
backendEntities: latestOutput.backendEntities,
|
|
246
247
|
updateFilters,
|
|
247
248
|
queryParameters,
|
|
248
249
|
loading,
|
|
249
250
|
error,
|
|
250
251
|
pageInfo,
|
|
251
|
-
totalItems:
|
|
252
|
+
totalItems: latestOutput.totalItems,
|
|
252
253
|
limit,
|
|
253
254
|
offset,
|
|
254
255
|
setLimit,
|
|
@@ -256,7 +257,7 @@ const EntityListProvider = (props) => {
|
|
|
256
257
|
paginationMode
|
|
257
258
|
}),
|
|
258
259
|
[
|
|
259
|
-
|
|
260
|
+
latestOutput,
|
|
260
261
|
updateFilters,
|
|
261
262
|
queryParameters,
|
|
262
263
|
loading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListProvider.esm.js","sources":["../../src/hooks/useEntityListProvider.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 { QueryEntitiesResponse } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport { compact, isEqual } from 'lodash';\nimport qs from 'qs';\nimport {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router-dom';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport useMountedState from 'react-use/esm/useMountedState';\nimport { catalogApiRef } from '../api';\nimport {\n EntityErrorFilter,\n EntityKindFilter,\n EntityLifecycleFilter,\n EntityNamespaceFilter,\n EntityOrderFilter,\n EntityOrphanFilter,\n EntityOwnerFilter,\n EntityTagFilter,\n EntityTextFilter,\n EntityTypeFilter,\n EntityUserFilter,\n UserListFilter,\n} from '../filters';\nimport { EntityFilter, EntityListPagination } from '../types';\nimport {\n reduceBackendCatalogFilters,\n reduceCatalogFilters,\n reduceEntityFilters,\n} from '../utils/filters';\n\n/** @public */\nexport type DefaultEntityFilters = {\n kind?: EntityKindFilter;\n type?: EntityTypeFilter;\n user?: UserListFilter | EntityUserFilter;\n owners?: EntityOwnerFilter;\n lifecycles?: EntityLifecycleFilter;\n tags?: EntityTagFilter;\n text?: EntityTextFilter;\n orphan?: EntityOrphanFilter;\n error?: EntityErrorFilter;\n namespace?: EntityNamespaceFilter;\n order?: EntityOrderFilter;\n};\n\n/** @public */\nexport type PaginationMode = 'cursor' | 'offset' | 'none';\n\n/** @public */\nexport type EntityListContextProps<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n> = {\n /**\n * The currently registered filters, adhering to the shape of DefaultEntityFilters or an extension\n * of that default (to add custom filter types).\n */\n filters: EntityFilters;\n\n /**\n * The resolved list of catalog entities, after all filters are applied.\n */\n entities: Entity[];\n\n /**\n * The resolved list of catalog entities, after _only catalog-backend_ filters are applied.\n */\n backendEntities: Entity[];\n\n /**\n * Update one or more of the registered filters. Optional filters can be set to `undefined` to\n * reset the filter.\n */\n updateFilters: (\n filters:\n | Partial<EntityFilters>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => void;\n\n /**\n * Filter values from query parameters.\n */\n queryParameters: Partial<Record<keyof EntityFilters, string | string[]>>;\n\n loading: boolean;\n error?: Error;\n\n pageInfo?: {\n next?: () => void;\n prev?: () => void;\n };\n totalItems?: number;\n limit: number;\n offset?: number;\n setLimit: (limit: number) => void;\n setOffset?: (offset: number) => void;\n paginationMode: PaginationMode;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nexport const NewEntityListContext = createVersionedContext<{\n 1: EntityListContextProps<any>;\n}>('entity-list-context');\n\n/**\n * Creates new context for entity listing and filtering.\n */\nexport const OldEntityListContext = createContext<\n EntityListContextProps<any> | undefined\n>(undefined);\n\ntype OutputState<EntityFilters extends DefaultEntityFilters> = {\n appliedFilters: EntityFilters;\n appliedCursor?: string;\n entities: Entity[];\n backendEntities: Entity[];\n pageInfo?: QueryEntitiesResponse['pageInfo'];\n totalItems?: number;\n offset?: number;\n limit?: number;\n};\n\n/**\n * @public\n */\nexport type EntityListProviderProps = PropsWithChildren<{\n pagination?: EntityListPagination;\n}>;\n\n/**\n * Provides entities and filters for a catalog listing.\n * @public\n */\nexport const EntityListProvider = <EntityFilters extends DefaultEntityFilters>(\n props: EntityListProviderProps,\n) => {\n const isMounted = useMountedState();\n const catalogApi = useApi(catalogApiRef);\n const [requestedFilters, setRequestedFilters] = useState<EntityFilters>(\n {} as EntityFilters,\n );\n\n // We use react-router's useLocation hook so updates from external sources trigger an update to\n // the queryParameters in outputState. Updates from this hook use replaceState below and won't\n // trigger a useLocation change; this would instead come from an external source, such as a manual\n // update of the URL or two catalog sidebar links with different catalog filters.\n const location = useLocation();\n\n const getPaginationMode = (): PaginationMode => {\n if (props.pagination === true) {\n return 'cursor';\n }\n return typeof props.pagination === 'object'\n ? props.pagination.mode ?? 'cursor'\n : 'none';\n };\n\n const paginationMode = getPaginationMode();\n const paginationLimit =\n typeof props.pagination === 'object' ? props.pagination.limit ?? 20 : 20;\n\n const {\n queryParameters,\n cursor: initialCursor,\n offset: initialOffset,\n limit: initialLimit,\n } = useMemo(() => {\n const parsed = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n arrayLimit: 10000,\n });\n\n let limit = paginationLimit;\n if (typeof parsed.limit === 'string') {\n const queryLimit = Number.parseInt(parsed.limit, 10);\n if (!isNaN(queryLimit)) {\n limit = queryLimit;\n }\n }\n\n const offset =\n typeof parsed.offset === 'string' && paginationMode === 'offset'\n ? Number.parseInt(parsed.offset, 10)\n : undefined;\n\n return {\n queryParameters: (parsed.filters ?? {}) as Record<\n string,\n string | string[]\n >,\n cursor:\n typeof parsed.cursor === 'string' && paginationMode === 'cursor'\n ? parsed.cursor\n : undefined,\n offset:\n paginationMode === 'offset' && offset && !isNaN(offset)\n ? offset\n : undefined,\n limit,\n };\n }, [paginationMode, location.search, paginationLimit]);\n\n const [cursor, setCursor] = useState(initialCursor);\n const [offset, setOffset] = useState<number | undefined>(initialOffset);\n const [limit, setLimit] = useState(initialLimit);\n\n const [outputState, setOutputState] = useState<OutputState<EntityFilters>>(\n () => {\n return {\n appliedFilters: {} as EntityFilters,\n entities: [],\n backendEntities: [],\n pageInfo: {},\n offset,\n limit,\n };\n },\n );\n\n // The main async filter worker. Note that while it has a lot of dependencies\n // in terms of its implementation, the triggering only happens (debounced)\n // based on the requested filters changing.\n const [{ value: resolvedValue, loading, error }, refresh] = useAsyncFn(\n async () => {\n const kindValue =\n requestedFilters.kind?.value?.toLocaleLowerCase('en-US');\n const adjustedFilters =\n kindValue === 'user' || kindValue === 'group'\n ? { ...requestedFilters, owners: undefined }\n : requestedFilters;\n const compacted = compact(Object.values(adjustedFilters));\n const entityFilter = reduceEntityFilters(compacted);\n\n if (paginationMode !== 'none') {\n if (cursor) {\n if (cursor !== outputState.appliedCursor) {\n const response = await catalogApi.queryEntities({\n cursor,\n limit,\n });\n return {\n appliedFilters: requestedFilters,\n appliedCursor: cursor,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n pageInfo: response.pageInfo,\n totalItems: response.totalItems,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n appliedCursor: outputState.appliedCursor,\n backendEntities: outputState.backendEntities,\n entities,\n pageInfo: outputState.pageInfo,\n totalItems: outputState.totalItems,\n limit: outputState.limit,\n offset: outputState.offset,\n };\n }\n\n const backendFilter = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n if (\n (paginationMode === 'offset' &&\n (outputState.limit !== limit || outputState.offset !== offset)) ||\n !isEqual(previousBackendFilter, backendFilter)\n ) {\n const response = await catalogApi.queryEntities({\n ...backendFilter,\n limit,\n offset,\n });\n return {\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n pageInfo: response.pageInfo,\n totalItems: response.totalItems,\n limit,\n offset,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities,\n pageInfo: outputState.pageInfo,\n totalItems: outputState.totalItems,\n limit: outputState.limit,\n offset: outputState.offset,\n };\n }\n\n const backendFilter = reduceBackendCatalogFilters(compacted);\n const { orderFields } = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceBackendCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n // TODO(mtlewis): currently entities will never be requested unless\n // there's at least one filter, we should allow an initial request\n // to happen with no filters.\n if (!isEqual(previousBackendFilter, backendFilter)) {\n // TODO(timbonicus): should limit fields here, but would need filter\n // fields + table columns\n const response = await catalogApi.getEntities({\n filter: backendFilter,\n order: orderFields,\n });\n const entities = response.items.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities,\n totalItems: entities.length,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities,\n totalItems: entities.length,\n };\n },\n [\n catalogApi,\n queryParameters,\n requestedFilters,\n outputState,\n cursor,\n paginationMode,\n limit,\n offset,\n ],\n { loading: true },\n );\n\n // Slight debounce on the refresh, since (especially on page load) several\n // filters will be calling this in rapid succession.\n useDebounce(refresh, 10, [requestedFilters, cursor, limit, offset]);\n\n useEffect(() => {\n if (resolvedValue === undefined) {\n return;\n }\n setOutputState(resolvedValue);\n if (isMounted()) {\n const queryParams = Object.keys(requestedFilters).reduce(\n (params, key) => {\n const filter = requestedFilters[key as keyof EntityFilters] as\n | EntityFilter\n | undefined;\n if (filter?.toQueryValue) {\n params[key] = filter.toQueryValue();\n }\n return params;\n },\n {} as Record<string, string | string[]>,\n );\n\n const oldParams = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n arrayLimit: 10000,\n });\n const newParams = qs.stringify(\n {\n ...oldParams,\n filters: queryParams,\n ...(paginationMode === 'none' ? {} : { cursor, limit, offset }),\n },\n { addQueryPrefix: true, arrayFormat: 'repeat' },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing, since we\n // don't want there to be back/forward slots for every single filter\n // change.\n window.history?.replaceState(null, document.title, newUrl);\n }\n }, [\n cursor,\n isMounted,\n limit,\n location.search,\n offset,\n requestedFilters,\n resolvedValue,\n paginationMode,\n ]);\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<EntityFilter>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => {\n // changing filters will affect pagination, so we need to reset\n // the cursor and start from the first page.\n // TODO(vinzscam): this is currently causing issues at page reload\n // where the state is not kept. Unfortunately we need to rethink\n // the way filters work in order to fix this.\n if (paginationMode === 'cursor') {\n setCursor(undefined);\n } else if (paginationMode === 'offset') {\n // Same thing with offset\n setOffset(0);\n }\n setRequestedFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [paginationMode],\n );\n\n const pageInfo = useMemo(() => {\n if (paginationMode !== 'cursor') {\n return undefined;\n }\n\n const prevCursor = outputState.pageInfo?.prevCursor;\n const nextCursor = outputState.pageInfo?.nextCursor;\n return {\n prev: prevCursor ? () => setCursor(prevCursor) : undefined,\n next: nextCursor ? () => setCursor(nextCursor) : undefined,\n };\n }, [paginationMode, outputState.pageInfo]);\n\n const value = useMemo(\n () => ({\n filters: outputState.appliedFilters,\n entities: outputState.entities,\n backendEntities: outputState.backendEntities,\n updateFilters,\n queryParameters,\n loading,\n error,\n pageInfo,\n totalItems: outputState.totalItems,\n limit,\n offset,\n setLimit,\n setOffset,\n paginationMode,\n }),\n [\n outputState,\n updateFilters,\n queryParameters,\n loading,\n error,\n pageInfo,\n limit,\n offset,\n paginationMode,\n setLimit,\n setOffset,\n ],\n );\n\n return (\n <OldEntityListContext.Provider value={value}>\n <NewEntityListContext.Provider\n value={createVersionedValueMap({ 1: value })}\n >\n {props.children}\n </NewEntityListContext.Provider>\n </OldEntityListContext.Provider>\n );\n};\n\n/**\n * Hook for interacting with the entity list context provided by the {@link EntityListProvider}.\n * @public\n */\nexport function useEntityList<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n>(): EntityListContextProps<EntityFilters> {\n const versionedHolder = useVersionedContext<{\n 1: EntityListContextProps<any>;\n }>('entity-list-context');\n const oldContext = useContext(OldEntityListContext);\n\n if (versionedHolder) {\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityListContext v1 not available');\n }\n return value;\n }\n\n if (oldContext) {\n return oldContext;\n }\n\n throw new Error('useEntityList must be used within EntityListProvider');\n}\n"],"names":["limit","offset","entities","backendFilter","previousBackendFilter"],"mappings":";;;;;;;;;;;;;AAoIO,MAAM,oBAAA,GAAuB,uBAEjC,qBAAqB;AAKjB,MAAM,oBAAA,GAAuB,cAElC,MAAS;AAwBJ,MAAM,kBAAA,GAAqB,CAChC,KAAA,KACG;AACH,EAAA,MAAM,YAAY,eAAA,EAAgB;AAClC,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,CAAC,gBAAA,EAAkB,mBAAmB,CAAA,GAAI,QAAA;AAAA,IAC9C;AAAC,GACH;AAMA,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,MAAM,oBAAoB,MAAsB;AAC9C,IAAA,IAAI,KAAA,CAAM,eAAe,IAAA,EAAM;AAC7B,MAAA,OAAO,QAAA;AAAA,IACT;AACA,IAAA,OAAO,OAAO,KAAA,CAAM,UAAA,KAAe,WAC/B,KAAA,CAAM,UAAA,CAAW,QAAQ,QAAA,GACzB,MAAA;AAAA,EACN,CAAA;AAEA,EAAA,MAAM,iBAAiB,iBAAA,EAAkB;AACzC,EAAA,MAAM,eAAA,GACJ,OAAO,KAAA,CAAM,UAAA,KAAe,WAAW,KAAA,CAAM,UAAA,CAAW,SAAS,EAAA,GAAK,EAAA;AAExE,EAAA,MAA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qBAAqB,CAAA;AACxB,EAAA,MAAM,UAAA,GAAa,WAAW,oBAAoB,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,MAAM,KAAA,GAAQ,eAAA,CAAgB,SAAA,CAAU,CAAC,CAAA;AACzC,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,MAAM,IAAI,MAAM,oCAAoC,CAAA;AAAA,IACtD;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO,UAAA;AAAA,EACT;AAEA,EAAA,MAAM,IAAI,MAAM,sDAAsD,CAAA;AACxE;;;;"}
|
|
1
|
+
{"version":3,"file":"useEntityListProvider.esm.js","sources":["../../src/hooks/useEntityListProvider.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 { QueryEntitiesResponse } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport { compact, isEqual } from 'lodash';\nimport qs from 'qs';\nimport {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router-dom';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport useMountedState from 'react-use/esm/useMountedState';\nimport { catalogApiRef } from '../api';\nimport {\n EntityErrorFilter,\n EntityKindFilter,\n EntityLifecycleFilter,\n EntityNamespaceFilter,\n EntityOrderFilter,\n EntityOrphanFilter,\n EntityOwnerFilter,\n EntityTagFilter,\n EntityTextFilter,\n EntityTypeFilter,\n EntityUserFilter,\n UserListFilter,\n} from '../filters';\nimport { EntityFilter, EntityListPagination } from '../types';\nimport {\n reduceBackendCatalogFilters,\n reduceCatalogFilters,\n reduceEntityFilters,\n} from '../utils/filters';\n\n/** @public */\nexport type DefaultEntityFilters = {\n kind?: EntityKindFilter;\n type?: EntityTypeFilter;\n user?: UserListFilter | EntityUserFilter;\n owners?: EntityOwnerFilter;\n lifecycles?: EntityLifecycleFilter;\n tags?: EntityTagFilter;\n text?: EntityTextFilter;\n orphan?: EntityOrphanFilter;\n error?: EntityErrorFilter;\n namespace?: EntityNamespaceFilter;\n order?: EntityOrderFilter;\n};\n\n/** @public */\nexport type PaginationMode = 'cursor' | 'offset' | 'none';\n\n/** @public */\nexport type EntityListContextProps<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n> = {\n /**\n * The currently registered filters, adhering to the shape of DefaultEntityFilters or an extension\n * of that default (to add custom filter types).\n */\n filters: EntityFilters;\n\n /**\n * The resolved list of catalog entities, after all filters are applied.\n */\n entities: Entity[];\n\n /**\n * The resolved list of catalog entities, after _only catalog-backend_ filters are applied.\n */\n backendEntities: Entity[];\n\n /**\n * Update one or more of the registered filters. Optional filters can be set to `undefined` to\n * reset the filter.\n */\n updateFilters: (\n filters:\n | Partial<EntityFilters>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => void;\n\n /**\n * Filter values from query parameters.\n */\n queryParameters: Partial<Record<keyof EntityFilters, string | string[]>>;\n\n loading: boolean;\n error?: Error;\n\n pageInfo?: {\n next?: () => void;\n prev?: () => void;\n };\n totalItems?: number;\n limit: number;\n offset?: number;\n setLimit: (limit: number) => void;\n setOffset?: (offset: number) => void;\n paginationMode: PaginationMode;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nexport const NewEntityListContext = createVersionedContext<{\n 1: EntityListContextProps<any>;\n}>('entity-list-context');\n\n/**\n * Creates new context for entity listing and filtering.\n */\nexport const OldEntityListContext = createContext<\n EntityListContextProps<any> | undefined\n>(undefined);\n\ntype OutputState<EntityFilters extends DefaultEntityFilters> = {\n appliedFilters: EntityFilters;\n appliedCursor?: string;\n entities: Entity[];\n backendEntities: Entity[];\n pageInfo?: QueryEntitiesResponse['pageInfo'];\n totalItems?: number;\n offset?: number;\n limit?: number;\n};\n\n/**\n * @public\n */\nexport type EntityListProviderProps = PropsWithChildren<{\n pagination?: EntityListPagination;\n}>;\n\n/**\n * Provides entities and filters for a catalog listing.\n * @public\n */\nexport const EntityListProvider = <EntityFilters extends DefaultEntityFilters>(\n props: EntityListProviderProps,\n) => {\n const isMounted = useMountedState();\n const catalogApi = useApi(catalogApiRef);\n const [requestedFilters, setRequestedFilters] = useState<EntityFilters>(\n {} as EntityFilters,\n );\n\n // We use react-router's useLocation hook so updates from external sources trigger an update to\n // the queryParameters in outputState. Updates from this hook use replaceState below and won't\n // trigger a useLocation change; this would instead come from an external source, such as a manual\n // update of the URL or two catalog sidebar links with different catalog filters.\n const location = useLocation();\n\n const getPaginationMode = (): PaginationMode => {\n if (props.pagination === true) {\n return 'cursor';\n }\n return typeof props.pagination === 'object'\n ? props.pagination.mode ?? 'cursor'\n : 'none';\n };\n\n const paginationMode = getPaginationMode();\n const paginationLimit =\n typeof props.pagination === 'object' ? props.pagination.limit ?? 20 : 20;\n\n const {\n queryParameters,\n cursor: initialCursor,\n offset: initialOffset,\n limit: initialLimit,\n } = useMemo(() => {\n const parsed = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n arrayLimit: 10000,\n });\n\n let limit = paginationLimit;\n if (typeof parsed.limit === 'string') {\n const queryLimit = Number.parseInt(parsed.limit, 10);\n if (!isNaN(queryLimit)) {\n limit = queryLimit;\n }\n }\n\n const offset =\n typeof parsed.offset === 'string' && paginationMode === 'offset'\n ? Number.parseInt(parsed.offset, 10)\n : undefined;\n\n return {\n queryParameters: (parsed.filters ?? {}) as Record<\n string,\n string | string[]\n >,\n cursor:\n typeof parsed.cursor === 'string' && paginationMode === 'cursor'\n ? parsed.cursor\n : undefined,\n offset:\n paginationMode === 'offset' && offset && !isNaN(offset)\n ? offset\n : undefined,\n limit,\n };\n }, [paginationMode, location.search, paginationLimit]);\n\n const [cursor, setCursor] = useState(initialCursor);\n const [offset, setOffset] = useState<number | undefined>(initialOffset);\n const [limit, setLimit] = useState(initialLimit);\n\n const [outputState, setOutputState] = useState<OutputState<EntityFilters>>(\n () => {\n return {\n appliedFilters: {} as EntityFilters,\n entities: [],\n backendEntities: [],\n pageInfo: {},\n offset,\n limit,\n };\n },\n );\n\n // The main async filter worker. Note that while it has a lot of dependencies\n // in terms of its implementation, the triggering only happens (debounced)\n // based on the requested filters changing.\n const [{ value: resolvedValue, loading, error }, refresh] = useAsyncFn(\n async () => {\n const kindValue =\n requestedFilters.kind?.value?.toLocaleLowerCase('en-US');\n const adjustedFilters =\n kindValue === 'user' || kindValue === 'group'\n ? { ...requestedFilters, owners: undefined }\n : requestedFilters;\n const compacted = compact(Object.values(adjustedFilters));\n const entityFilter = reduceEntityFilters(compacted);\n\n if (paginationMode !== 'none') {\n if (cursor) {\n if (cursor !== outputState.appliedCursor) {\n const response = await catalogApi.queryEntities({\n cursor,\n limit,\n });\n return {\n appliedFilters: requestedFilters,\n appliedCursor: cursor,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n pageInfo: response.pageInfo,\n totalItems: response.totalItems,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n appliedCursor: outputState.appliedCursor,\n backendEntities: outputState.backendEntities,\n entities,\n pageInfo: outputState.pageInfo,\n totalItems: outputState.totalItems,\n limit: outputState.limit,\n offset: outputState.offset,\n };\n }\n\n const backendFilter = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n if (\n (paginationMode === 'offset' &&\n (outputState.limit !== limit || outputState.offset !== offset)) ||\n !isEqual(previousBackendFilter, backendFilter)\n ) {\n const response = await catalogApi.queryEntities({\n ...backendFilter,\n limit,\n offset,\n });\n return {\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n pageInfo: response.pageInfo,\n totalItems: response.totalItems,\n limit,\n offset,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities,\n pageInfo: outputState.pageInfo,\n totalItems: outputState.totalItems,\n limit: outputState.limit,\n offset: outputState.offset,\n };\n }\n\n const backendFilter = reduceBackendCatalogFilters(compacted);\n const { orderFields } = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceBackendCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n // TODO(mtlewis): currently entities will never be requested unless\n // there's at least one filter, we should allow an initial request\n // to happen with no filters.\n if (!isEqual(previousBackendFilter, backendFilter)) {\n // TODO(timbonicus): should limit fields here, but would need filter\n // fields + table columns\n const response = await catalogApi.getEntities({\n filter: backendFilter,\n order: orderFields,\n });\n const entities = response.items.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities,\n totalItems: entities.length,\n };\n }\n const entities = outputState.backendEntities.filter(entityFilter);\n return {\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities,\n totalItems: entities.length,\n };\n },\n [\n catalogApi,\n queryParameters,\n requestedFilters,\n outputState,\n cursor,\n paginationMode,\n limit,\n offset,\n ],\n { loading: true },\n );\n\n // Slight debounce on the refresh, since (especially on page load) several\n // filters will be calling this in rapid succession.\n useDebounce(refresh, 10, [requestedFilters, cursor, limit, offset]);\n\n useEffect(() => {\n if (resolvedValue === undefined) {\n return;\n }\n setOutputState(resolvedValue);\n if (isMounted()) {\n const queryParams = Object.keys(requestedFilters).reduce(\n (params, key) => {\n const filter = requestedFilters[key as keyof EntityFilters] as\n | EntityFilter\n | undefined;\n if (filter?.toQueryValue) {\n params[key] = filter.toQueryValue();\n }\n return params;\n },\n {} as Record<string, string | string[]>,\n );\n\n const oldParams = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n arrayLimit: 10000,\n });\n const newParams = qs.stringify(\n {\n ...oldParams,\n filters: queryParams,\n ...(paginationMode === 'none' ? {} : { cursor, limit, offset }),\n },\n { addQueryPrefix: true, arrayFormat: 'repeat' },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing, since we\n // don't want there to be back/forward slots for every single filter\n // change.\n window.history?.replaceState(null, document.title, newUrl);\n }\n }, [\n cursor,\n isMounted,\n limit,\n location.search,\n offset,\n requestedFilters,\n resolvedValue,\n paginationMode,\n ]);\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<EntityFilter>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => {\n // changing filters will affect pagination, so we need to reset\n // the cursor and start from the first page.\n // TODO(vinzscam): this is currently causing issues at page reload\n // where the state is not kept. Unfortunately we need to rethink\n // the way filters work in order to fix this.\n if (paginationMode === 'cursor') {\n setCursor(undefined);\n } else if (paginationMode === 'offset') {\n // Same thing with offset\n setOffset(0);\n }\n setRequestedFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [paginationMode],\n );\n\n // Use resolvedValue directly when available to avoid an extra render cycle.\n // Without this, there's a render where loading has flipped back to false but\n // outputState hasn't been updated yet (it syncs via useEffect), causing a\n // flash of stale data between the loading state and the new results.\n const latestOutput = resolvedValue ?? outputState;\n\n const pageInfo = useMemo(() => {\n if (paginationMode !== 'cursor') {\n return undefined;\n }\n\n const prevCursor = latestOutput.pageInfo?.prevCursor;\n const nextCursor = latestOutput.pageInfo?.nextCursor;\n return {\n prev: prevCursor ? () => setCursor(prevCursor) : undefined,\n next: nextCursor ? () => setCursor(nextCursor) : undefined,\n };\n }, [paginationMode, latestOutput.pageInfo]);\n\n const value = useMemo(\n () => ({\n filters: latestOutput.appliedFilters,\n entities: latestOutput.entities,\n backendEntities: latestOutput.backendEntities,\n updateFilters,\n queryParameters,\n loading,\n error,\n pageInfo,\n totalItems: latestOutput.totalItems,\n limit,\n offset,\n setLimit,\n setOffset,\n paginationMode,\n }),\n [\n latestOutput,\n updateFilters,\n queryParameters,\n loading,\n error,\n pageInfo,\n limit,\n offset,\n paginationMode,\n setLimit,\n setOffset,\n ],\n );\n\n return (\n <OldEntityListContext.Provider value={value}>\n <NewEntityListContext.Provider\n value={createVersionedValueMap({ 1: value })}\n >\n {props.children}\n </NewEntityListContext.Provider>\n </OldEntityListContext.Provider>\n );\n};\n\n/**\n * Hook for interacting with the entity list context provided by the {@link EntityListProvider}.\n * @public\n */\nexport function useEntityList<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n>(): EntityListContextProps<EntityFilters> {\n const versionedHolder = useVersionedContext<{\n 1: EntityListContextProps<any>;\n }>('entity-list-context');\n const oldContext = useContext(OldEntityListContext);\n\n if (versionedHolder) {\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityListContext v1 not available');\n }\n return value;\n }\n\n if (oldContext) {\n return oldContext;\n }\n\n throw new Error('useEntityList must be used within EntityListProvider');\n}\n"],"names":["limit","offset","entities","backendFilter","previousBackendFilter"],"mappings":";;;;;;;;;;;;;AAoIO,MAAM,oBAAA,GAAuB,uBAEjC,qBAAqB;AAKjB,MAAM,oBAAA,GAAuB,cAElC,MAAS;AAwBJ,MAAM,kBAAA,GAAqB,CAChC,KAAA,KACG;AACH,EAAA,MAAM,YAAY,eAAA,EAAgB;AAClC,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,CAAC,gBAAA,EA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AAAA,IACA;AAAA,MACE,YAAA;AAAA,MACA,aAAA;AAAA,MACA,eAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,cAAA;AAAA,MACA,QAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,oBAAA,CAAqB,QAAA,EAArB,EAA8B,KAAA,EAC7B,QAAA,kBAAA,GAAA;AAAA,IAAC,oBAAA,CAAqB,QAAA;AAAA,IAArB;AAAA,MACC,KAAA,EAAO,uBAAA,CAAwB,EAAE,CAAA,EAAG,OAAO,CAAA;AAAA,MAE1C,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA,GACT,EACF,CAAA;AAEJ;AAMO,SAAS,aAAA,GAE2B;AACzC,EAAA,MAAM,eAAA,GAAkB,oBAErB,qBAAqB,CAAA;AACxB,EAAA,MAAM,UAAA,GAAa,WAAW,oBAAoB,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,MAAM,KAAA,GAAQ,eAAA,CAAgB,SAAA,CAAU,CAAC,CAAA;AACzC,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,MAAM,IAAI,MAAM,oCAAoC,CAAA;AAAA,IACtD;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO,UAAA;AAAA,EACT;AAEA,EAAA,MAAM,IAAI,MAAM,sDAAsD,CAAA;AACxE;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1040,5 +1040,97 @@ declare function MockEntityListContextProvider<T extends DefaultEntityFilters =
|
|
|
1040
1040
|
*/
|
|
1041
1041
|
declare const EntityListContext: react.Context<EntityListContextProps<any> | undefined>;
|
|
1042
1042
|
|
|
1043
|
-
|
|
1043
|
+
/** @public */
|
|
1044
|
+
declare const catalogReactTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"catalog-react", {
|
|
1045
|
+
readonly "catalogFilter.title": "Filters";
|
|
1046
|
+
readonly "catalogFilter.buttonTitle": "Filters";
|
|
1047
|
+
readonly "entityKindPicker.title": "Kind";
|
|
1048
|
+
readonly "entityKindPicker.errorMessage": "Failed to load entity kinds";
|
|
1049
|
+
readonly "entityLifecyclePicker.title": "Lifecycle";
|
|
1050
|
+
readonly "entityNamespacePicker.title": "Namespace";
|
|
1051
|
+
readonly "entityOwnerPicker.title": "Owner";
|
|
1052
|
+
readonly "entityProcessingStatusPicker.title": "Processing Status";
|
|
1053
|
+
readonly "entityTagPicker.title": "Tags";
|
|
1054
|
+
readonly "entityPeekAheadPopover.title": "Drill into the entity to see all of the tags.";
|
|
1055
|
+
readonly "entityPeekAheadPopover.entityCardActionsAriaLabel": "Show";
|
|
1056
|
+
readonly "entityPeekAheadPopover.entityCardActionsTitle": "Show details";
|
|
1057
|
+
readonly "entityPeekAheadPopover.emailCardAction.title": "Email {{email}}";
|
|
1058
|
+
readonly "entityPeekAheadPopover.emailCardAction.ariaLabel": "Email";
|
|
1059
|
+
readonly "entityPeekAheadPopover.emailCardAction.subTitle": "mailto {{email}}";
|
|
1060
|
+
readonly "entitySearchBar.placeholder": "Search";
|
|
1061
|
+
readonly "entityTypePicker.title": "Type";
|
|
1062
|
+
readonly "entityTypePicker.errorMessage": "Failed to load entity types";
|
|
1063
|
+
readonly "entityTypePicker.optionAllTitle": "all";
|
|
1064
|
+
readonly "favoriteEntity.addToFavorites": "Add to favorites";
|
|
1065
|
+
readonly "favoriteEntity.removeFromFavorites": "Remove from favorites";
|
|
1066
|
+
readonly "inspectEntityDialog.title": "Entity Inspector";
|
|
1067
|
+
readonly "inspectEntityDialog.closeButtonTitle": "Close";
|
|
1068
|
+
readonly "inspectEntityDialog.tabsAriaLabel": "Inspector options";
|
|
1069
|
+
readonly "inspectEntityDialog.ancestryPage.title": "Ancestry";
|
|
1070
|
+
readonly "inspectEntityDialog.ancestryPage.description": "This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where {{processorsLink}} child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations.";
|
|
1071
|
+
readonly "inspectEntityDialog.ancestryPage.processorsLink": "processors emitted";
|
|
1072
|
+
readonly "inspectEntityDialog.colocatedPage.title": "Colocated";
|
|
1073
|
+
readonly "inspectEntityDialog.colocatedPage.description": "These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL).";
|
|
1074
|
+
readonly "inspectEntityDialog.colocatedPage.alertNoLocation": "Entity had no location information.";
|
|
1075
|
+
readonly "inspectEntityDialog.colocatedPage.alertNoEntity": "There were no other entities on this location.";
|
|
1076
|
+
readonly "inspectEntityDialog.colocatedPage.locationHeader": "At the same location";
|
|
1077
|
+
readonly "inspectEntityDialog.colocatedPage.originHeader": "At the same origin";
|
|
1078
|
+
readonly "inspectEntityDialog.jsonPage.title": "Entity as JSON";
|
|
1079
|
+
readonly "inspectEntityDialog.jsonPage.description": "This is the raw entity data as received from the catalog, on JSON form.";
|
|
1080
|
+
readonly "inspectEntityDialog.overviewPage.title": "Overview";
|
|
1081
|
+
readonly "inspectEntityDialog.overviewPage.metadata.title": "Metadata";
|
|
1082
|
+
readonly "inspectEntityDialog.overviewPage.labels": "Labels";
|
|
1083
|
+
readonly "inspectEntityDialog.overviewPage.status.title": "Status";
|
|
1084
|
+
readonly "inspectEntityDialog.overviewPage.identity.title": "Identity";
|
|
1085
|
+
readonly "inspectEntityDialog.overviewPage.annotations": "Annotations";
|
|
1086
|
+
readonly "inspectEntityDialog.overviewPage.tags": "Tags";
|
|
1087
|
+
readonly "inspectEntityDialog.overviewPage.relation.title": "Relations";
|
|
1088
|
+
readonly "inspectEntityDialog.yamlPage.title": "Entity as YAML";
|
|
1089
|
+
readonly "inspectEntityDialog.yamlPage.description": "This is the raw entity data as received from the catalog, on YAML form.";
|
|
1090
|
+
readonly "inspectEntityDialog.tabNames.json": "Raw JSON";
|
|
1091
|
+
readonly "inspectEntityDialog.tabNames.yaml": "Raw YAML";
|
|
1092
|
+
readonly "inspectEntityDialog.tabNames.overview": "Overview";
|
|
1093
|
+
readonly "inspectEntityDialog.tabNames.ancestry": "Ancestry";
|
|
1094
|
+
readonly "inspectEntityDialog.tabNames.colocated": "Colocated";
|
|
1095
|
+
readonly "unregisterEntityDialog.title": "Are you sure you want to unregister this entity?";
|
|
1096
|
+
readonly "unregisterEntityDialog.cancelButtonTitle": "Cancel";
|
|
1097
|
+
readonly "unregisterEntityDialog.deleteButtonTitle": "Delete Entity";
|
|
1098
|
+
readonly "unregisterEntityDialog.deleteEntitySuccessMessage": "Removed entity {{entityName}}";
|
|
1099
|
+
readonly "unregisterEntityDialog.onlyDeleteStateTitle": "This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog.";
|
|
1100
|
+
readonly "unregisterEntityDialog.errorStateTitle": "Internal error: Unknown state";
|
|
1101
|
+
readonly "unregisterEntityDialog.bootstrapState.title": "You cannot unregister this entity, since it originates from a protected Backstage configuration (location \"{{location}}\"). If you believe this is in error, please contact the {{appTitle}} integrator.";
|
|
1102
|
+
readonly "unregisterEntityDialog.bootstrapState.advancedDescription": "You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.";
|
|
1103
|
+
readonly "unregisterEntityDialog.bootstrapState.advancedOptions": "Advanced Options";
|
|
1104
|
+
readonly "unregisterEntityDialog.unregisterState.title": "This action will unregister the following entities:";
|
|
1105
|
+
readonly "unregisterEntityDialog.unregisterState.description": "To undo, just re-register the entity in {{appTitle}}.";
|
|
1106
|
+
readonly "unregisterEntityDialog.unregisterState.subTitle": "Located at the following location:";
|
|
1107
|
+
readonly "unregisterEntityDialog.unregisterState.advancedDescription": "You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.";
|
|
1108
|
+
readonly "unregisterEntityDialog.unregisterState.advancedOptions": "Advanced Options";
|
|
1109
|
+
readonly "unregisterEntityDialog.unregisterState.unregisterButtonTitle": "Unregister Location";
|
|
1110
|
+
readonly "userListPicker.defaultOrgName": "Company";
|
|
1111
|
+
readonly "userListPicker.orgFilterAllLabel": "All";
|
|
1112
|
+
readonly "userListPicker.personalFilter.title": "Personal";
|
|
1113
|
+
readonly "userListPicker.personalFilter.ownedLabel": "Owned";
|
|
1114
|
+
readonly "userListPicker.personalFilter.starredLabel": "Starred";
|
|
1115
|
+
readonly "entityTableColumnTitle.name": "Name";
|
|
1116
|
+
readonly "entityTableColumnTitle.type": "Type";
|
|
1117
|
+
readonly "entityTableColumnTitle.label": "Label";
|
|
1118
|
+
readonly "entityTableColumnTitle.title": "Title";
|
|
1119
|
+
readonly "entityTableColumnTitle.description": "Description";
|
|
1120
|
+
readonly "entityTableColumnTitle.system": "System";
|
|
1121
|
+
readonly "entityTableColumnTitle.namespace": "Namespace";
|
|
1122
|
+
readonly "entityTableColumnTitle.domain": "Domain";
|
|
1123
|
+
readonly "entityTableColumnTitle.tags": "Tags";
|
|
1124
|
+
readonly "entityTableColumnTitle.owner": "Owner";
|
|
1125
|
+
readonly "entityTableColumnTitle.lifecycle": "Lifecycle";
|
|
1126
|
+
readonly "entityTableColumnTitle.targets": "Targets";
|
|
1127
|
+
readonly "entityRelationCard.emptyHelpLinkTitle": "Learn how to change this.";
|
|
1128
|
+
readonly "missingAnnotationEmptyState.title": "Missing Annotation";
|
|
1129
|
+
readonly "missingAnnotationEmptyState.readMore": "Read more";
|
|
1130
|
+
readonly "missingAnnotationEmptyState.annotationYaml": "Add the annotation to your {{entityKind}} YAML as shown in the highlighted example below:";
|
|
1131
|
+
readonly "missingAnnotationEmptyState.generateDescription_one": "The annotation {{annotations}} is missing. You need to add the annotation to your {{entityKind}} if you want to enable this tool.";
|
|
1132
|
+
readonly "missingAnnotationEmptyState.generateDescription_other": "The annotations {{annotations}} are missing. You need to add the annotations to your {{entityKind}} if you want to enable this tool.";
|
|
1133
|
+
}>;
|
|
1134
|
+
|
|
1135
|
+
export { AsyncEntityProvider, CatalogAutocomplete, CatalogFilterLayout, DefaultFilters, EntityAutocompletePicker, EntityDisplayName, EntityErrorFilter, EntityInfoCard, EntityKindFilter, EntityKindPicker, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListProvider, EntityNamespaceFilter, EntityNamespacePicker, EntityOrderFilter, EntityOrphanFilter, EntityOwnerFilter, EntityOwnerPicker, EntityPeekAheadPopover, EntityProcessingStatusPicker, EntityProvider, EntityRefLink, EntityRefLinks, EntitySearchBar, EntityTable, EntityTagFilter, EntityTagPicker, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityUserFilter, FavoriteEntity, InspectEntityDialog, MissingAnnotationEmptyState, MockEntityListContextProvider, MockStarredEntitiesApi, UnregisterEntityDialog, UserListFilter, UserListPicker, catalogApiRef, catalogReactTranslationRef, columnFactories, defaultEntityPresentation, entityPresentationApiRef, entityRouteParams, entityRouteRef, getEntityRelations, getEntitySourceLocation, humanizeEntityRef, starredEntitiesApiRef, useAsyncEntity, useEntity, useEntityList, useEntityOwnership, useEntityPresentation, useEntityRefLink, useEntityTypeFilter, useRelatedEntities, useStarredEntities, useStarredEntity };
|
|
1044
1136
|
export type { AllowedEntityFilters, AsyncEntityProviderProps, BackstageOverrides, CatalogAutocompleteProps, CatalogReactComponentsNameToClassKey, CatalogReactEntityAutocompletePickerClassKey, CatalogReactEntityDisplayNameClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityNamespacePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntityProcessingStatusPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultFiltersProps, EntityAutocompletePickerProps, EntityDisplayNameProps, EntityFilter, EntityInfoCardProps, EntityKindPickerProps, EntityListContextProps, EntityListPagination, EntityListProviderProps, EntityLoadingStatus, EntityNamespacePickerProps, EntityOwnerPickerProps, EntityPeekAheadPopoverProps, EntityPresentationApi, EntityProviderProps, EntityRefLinkProps, EntityRefLinksProps, EntityRefPresentation, EntityRefPresentationSnapshot, EntityRouteParamsOptions, EntitySourceLocation, EntityTableProps, EntityTagPickerProps, EntityTypePickerProps, FavoriteEntityProps, FixedWidthFormControlLabelClassKey, MissingAnnotationEmptyStateClassKey, PaginationMode, StarredEntitiesApi, UnregisterEntityDialogProps, UserListFilterKind, UserListPickerProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -43,4 +43,5 @@ export { getEntityRelations } from './utils/getEntityRelations.esm.js';
|
|
|
43
43
|
export { getEntitySourceLocation } from './utils/getEntitySourceLocation.esm.js';
|
|
44
44
|
import '@backstage/catalog-model';
|
|
45
45
|
export { EntityListContext, MockEntityListContextProvider } from './deprecated.esm.js';
|
|
46
|
+
export { catalogReactTranslationRef } from './translation.esm.js';
|
|
46
47
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -143,6 +143,9 @@ const catalogReactTranslationRef = createTranslationRef({
|
|
|
143
143
|
label: "Label",
|
|
144
144
|
domain: "Domain"
|
|
145
145
|
},
|
|
146
|
+
entityRelationCard: {
|
|
147
|
+
emptyHelpLinkTitle: "Learn how to change this."
|
|
148
|
+
},
|
|
146
149
|
missingAnnotationEmptyState: {
|
|
147
150
|
title: "Missing Annotation",
|
|
148
151
|
readMore: "Read more",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogReactTranslationRef = createTranslationRef({\n id: 'catalog-react',\n messages: {\n catalogFilter: {\n title: 'Filters',\n buttonTitle: 'Filters',\n },\n entityKindPicker: {\n title: 'Kind',\n errorMessage: 'Failed to load entity kinds',\n },\n entityLifecyclePicker: {\n title: 'Lifecycle',\n },\n entityNamespacePicker: {\n title: 'Namespace',\n },\n entityOwnerPicker: {\n title: 'Owner',\n },\n entityProcessingStatusPicker: {\n title: 'Processing Status',\n },\n entityTagPicker: {\n title: 'Tags',\n },\n entityPeekAheadPopover: {\n title: 'Drill into the entity to see all of the tags.',\n emailCardAction: {\n title: 'Email {{email}}',\n subTitle: 'mailto {{email}}',\n ariaLabel: 'Email',\n },\n entityCardActionsAriaLabel: 'Show',\n entityCardActionsTitle: 'Show details',\n },\n entitySearchBar: {\n placeholder: 'Search',\n },\n entityTypePicker: {\n title: 'Type',\n errorMessage: 'Failed to load entity types',\n optionAllTitle: 'all',\n },\n favoriteEntity: {\n addToFavorites: 'Add to favorites',\n removeFromFavorites: 'Remove from favorites',\n },\n inspectEntityDialog: {\n title: 'Entity Inspector',\n closeButtonTitle: 'Close',\n ancestryPage: {\n title: 'Ancestry',\n description:\n 'This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where {{processorsLink}} child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations.',\n processorsLink: 'processors emitted',\n },\n colocatedPage: {\n title: 'Colocated',\n description:\n 'These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL).',\n alertNoLocation: 'Entity had no location information.',\n alertNoEntity: 'There were no other entities on this location.',\n locationHeader: 'At the same location',\n originHeader: 'At the same origin',\n },\n jsonPage: {\n title: 'Entity as JSON',\n description:\n 'This is the raw entity data as received from the catalog, on JSON form.',\n },\n overviewPage: {\n title: 'Overview',\n relation: {\n title: 'Relations',\n },\n status: {\n title: 'Status',\n },\n identity: {\n title: 'Identity',\n },\n metadata: {\n title: 'Metadata',\n },\n annotations: 'Annotations',\n labels: 'Labels',\n tags: 'Tags',\n },\n yamlPage: {\n title: 'Entity as YAML',\n description:\n 'This is the raw entity data as received from the catalog, on YAML form.',\n },\n tabNames: {\n overview: 'Overview',\n ancestry: 'Ancestry',\n colocated: 'Colocated',\n json: 'Raw JSON',\n yaml: 'Raw YAML',\n },\n tabsAriaLabel: 'Inspector options',\n },\n unregisterEntityDialog: {\n title: 'Are you sure you want to unregister this entity?',\n cancelButtonTitle: 'Cancel',\n deleteButtonTitle: 'Delete Entity',\n deleteEntitySuccessMessage: 'Removed entity {{entityName}}',\n bootstrapState: {\n title:\n 'You cannot unregister this entity, since it originates from a protected Backstage configuration (location \"{{location}}\"). If you believe this is in error, please contact the {{appTitle}} integrator.',\n advancedDescription:\n 'You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.',\n advancedOptions: 'Advanced Options',\n },\n onlyDeleteStateTitle:\n 'This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog.',\n unregisterState: {\n title: 'This action will unregister the following entities:',\n subTitle: 'Located at the following location:',\n description: 'To undo, just re-register the entity in {{appTitle}}.',\n unregisterButtonTitle: 'Unregister Location',\n advancedOptions: 'Advanced Options',\n advancedDescription:\n 'You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.',\n },\n errorStateTitle: 'Internal error: Unknown state',\n },\n userListPicker: {\n defaultOrgName: 'Company',\n personalFilter: {\n title: 'Personal',\n ownedLabel: 'Owned',\n starredLabel: 'Starred',\n },\n orgFilterAllLabel: 'All',\n },\n entityTableColumnTitle: {\n name: 'Name',\n system: 'System',\n owner: 'Owner',\n type: 'Type',\n lifecycle: 'Lifecycle',\n namespace: 'Namespace',\n description: 'Description',\n tags: 'Tags',\n targets: 'Targets',\n title: 'Title',\n label: 'Label',\n domain: 'Domain',\n },\n missingAnnotationEmptyState: {\n title: 'Missing Annotation',\n readMore: 'Read more',\n annotationYaml:\n 'Add the annotation to your {{entityKind}} YAML as shown in the highlighted example below:',\n generateDescription_one:\n 'The annotation {{annotations}} is missing. You need to add the annotation to your {{entityKind}} if you want to enable this tool.',\n generateDescription_other:\n 'The annotations {{annotations}} are missing. You need to add the annotations to your {{entityKind}} if you want to enable this tool.',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,6BAA6B,oBAAA,CAAqB;AAAA,EAC7D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,aAAA,EAAe;AAAA,MACb,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACf;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,MAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,qBAAA,EAAuB;AAAA,MACrB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,qBAAA,EAAuB;AAAA,MACrB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,4BAAA,EAA8B;AAAA,MAC5B,KAAA,EAAO;AAAA,KACT;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,KAAA,EAAO;AAAA,KACT;AAAA,IACA,sB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AAwB;AAAA,MACtB,IAAA,EAAM,MAAA;AAAA,MACN,MAAA,EAAQ,QAAA;AAAA,MACR,KAAA,EAAO,OAAA;AAAA,MACP,IAAA,EAAM,MAAA;AAAA,MACN,SAAA,EAAW,WAAA;AAAA,MACX,SAAA,EAAW,WAAA;AAAA,MACX,WAAA,EAAa,aAAA;AAAA,MACb,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS,SAAA;AAAA,MACT,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO,OAAA;AAAA,MACP,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,2BAAA,EAA6B;AAAA,MAC3B,KAAA,EAAO,oBAAA;AAAA,MACP,QAAA,EAAU,WAAA;AAAA,MACV,cAAA,EACE,2FAAA;AAAA,MACF,uBAAA,EACE,mIAAA;AAAA,MACF,yBAAA,EACE;AAAA;AACJ;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport const catalogReactTranslationRef = createTranslationRef({\n id: 'catalog-react',\n messages: {\n catalogFilter: {\n title: 'Filters',\n buttonTitle: 'Filters',\n },\n entityKindPicker: {\n title: 'Kind',\n errorMessage: 'Failed to load entity kinds',\n },\n entityLifecyclePicker: {\n title: 'Lifecycle',\n },\n entityNamespacePicker: {\n title: 'Namespace',\n },\n entityOwnerPicker: {\n title: 'Owner',\n },\n entityProcessingStatusPicker: {\n title: 'Processing Status',\n },\n entityTagPicker: {\n title: 'Tags',\n },\n entityPeekAheadPopover: {\n title: 'Drill into the entity to see all of the tags.',\n emailCardAction: {\n title: 'Email {{email}}',\n subTitle: 'mailto {{email}}',\n ariaLabel: 'Email',\n },\n entityCardActionsAriaLabel: 'Show',\n entityCardActionsTitle: 'Show details',\n },\n entitySearchBar: {\n placeholder: 'Search',\n },\n entityTypePicker: {\n title: 'Type',\n errorMessage: 'Failed to load entity types',\n optionAllTitle: 'all',\n },\n favoriteEntity: {\n addToFavorites: 'Add to favorites',\n removeFromFavorites: 'Remove from favorites',\n },\n inspectEntityDialog: {\n title: 'Entity Inspector',\n closeButtonTitle: 'Close',\n ancestryPage: {\n title: 'Ancestry',\n description:\n 'This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where {{processorsLink}} child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations.',\n processorsLink: 'processors emitted',\n },\n colocatedPage: {\n title: 'Colocated',\n description:\n 'These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL).',\n alertNoLocation: 'Entity had no location information.',\n alertNoEntity: 'There were no other entities on this location.',\n locationHeader: 'At the same location',\n originHeader: 'At the same origin',\n },\n jsonPage: {\n title: 'Entity as JSON',\n description:\n 'This is the raw entity data as received from the catalog, on JSON form.',\n },\n overviewPage: {\n title: 'Overview',\n relation: {\n title: 'Relations',\n },\n status: {\n title: 'Status',\n },\n identity: {\n title: 'Identity',\n },\n metadata: {\n title: 'Metadata',\n },\n annotations: 'Annotations',\n labels: 'Labels',\n tags: 'Tags',\n },\n yamlPage: {\n title: 'Entity as YAML',\n description:\n 'This is the raw entity data as received from the catalog, on YAML form.',\n },\n tabNames: {\n overview: 'Overview',\n ancestry: 'Ancestry',\n colocated: 'Colocated',\n json: 'Raw JSON',\n yaml: 'Raw YAML',\n },\n tabsAriaLabel: 'Inspector options',\n },\n unregisterEntityDialog: {\n title: 'Are you sure you want to unregister this entity?',\n cancelButtonTitle: 'Cancel',\n deleteButtonTitle: 'Delete Entity',\n deleteEntitySuccessMessage: 'Removed entity {{entityName}}',\n bootstrapState: {\n title:\n 'You cannot unregister this entity, since it originates from a protected Backstage configuration (location \"{{location}}\"). If you believe this is in error, please contact the {{appTitle}} integrator.',\n advancedDescription:\n 'You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.',\n advancedOptions: 'Advanced Options',\n },\n onlyDeleteStateTitle:\n 'This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog.',\n unregisterState: {\n title: 'This action will unregister the following entities:',\n subTitle: 'Located at the following location:',\n description: 'To undo, just re-register the entity in {{appTitle}}.',\n unregisterButtonTitle: 'Unregister Location',\n advancedOptions: 'Advanced Options',\n advancedDescription:\n 'You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog.',\n },\n errorStateTitle: 'Internal error: Unknown state',\n },\n userListPicker: {\n defaultOrgName: 'Company',\n personalFilter: {\n title: 'Personal',\n ownedLabel: 'Owned',\n starredLabel: 'Starred',\n },\n orgFilterAllLabel: 'All',\n },\n entityTableColumnTitle: {\n name: 'Name',\n system: 'System',\n owner: 'Owner',\n type: 'Type',\n lifecycle: 'Lifecycle',\n namespace: 'Namespace',\n description: 'Description',\n tags: 'Tags',\n targets: 'Targets',\n title: 'Title',\n label: 'Label',\n domain: 'Domain',\n },\n entityRelationCard: {\n emptyHelpLinkTitle: 'Learn how to change this.',\n },\n missingAnnotationEmptyState: {\n title: 'Missing Annotation',\n readMore: 'Read more',\n annotationYaml:\n 'Add the annotation to your {{entityKind}} YAML as shown in the highlighted example below:',\n generateDescription_one:\n 'The annotation {{annotations}} is missing. You need to add the annotation to your {{entityKind}} if you want to enable this tool.',\n generateDescription_other:\n 'The annotations {{annotations}} are missing. You need to add the annotations to your {{entityKind}} if you want to enable this tool.',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,6BAA6B,oBAAA,CAAqB;AAAA,EAC7D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,aAAA,EAAe;AAAA,MACb,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACf;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,MAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,qBAAA,EAAuB;AAAA,MACrB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,qBAAA,EAAuB;AAAA,MACrB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO;AAAA,KACT;AAAA,IACA,4BAAA,EAA8B;AAAA,MAC5B,KAAA,EAAO;AAAA,KACT;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,KAAA,EAAO;AAAA,KACT;AAAA,IACA,sBAAA,EAAwB;AAAA,MACtB,KAAA,EAAO,+CAAA;AAAA,MACP,eAAA,EAAiB;AAAA,QACf,KAAA,EAAO,iBAAA;AAAA,QACP,QAAA,EAAU,kBAAA;AAAA,QACV,SAAA,EAAW;AAAA,OACb;AAAA,MACA,0BAAA,EAA4B,MAAA;AAAA,MAC5B,sBAAA,EAAwB;AAAA,KAC1B;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,WAAA,EAAa;AAAA,KACf;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,MAAA;AAAA,MACP,YAAA,EAAc,6BAAA;AAAA,MACd,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,cAAA,EAAgB,kBAAA;AAAA,MAChB,mBAAA,EAAqB;AAAA,KACvB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,KAAA,EAAO,kBAAA;AAAA,MACP,gBAAA,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yBAAA,EACE;AAAA;AACJ;AAEJ,CAAC;;;;"}
|
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-next.0",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -73,20 +73,20 @@
|
|
|
73
73
|
"test": "backstage-cli package test"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@backstage/catalog-client": "1.14.0
|
|
77
|
-
"@backstage/catalog-model": "1.7.
|
|
78
|
-
"@backstage/core-compat-api": "0.5.
|
|
79
|
-
"@backstage/core-components": "0.18.
|
|
80
|
-
"@backstage/core-plugin-api": "1.12.
|
|
76
|
+
"@backstage/catalog-client": "1.14.0",
|
|
77
|
+
"@backstage/catalog-model": "1.7.7",
|
|
78
|
+
"@backstage/core-compat-api": "0.5.10-next.0",
|
|
79
|
+
"@backstage/core-components": "0.18.9-next.0",
|
|
80
|
+
"@backstage/core-plugin-api": "1.12.5-next.0",
|
|
81
81
|
"@backstage/errors": "1.2.7",
|
|
82
|
-
"@backstage/filter-predicates": "0.1.
|
|
83
|
-
"@backstage/frontend-plugin-api": "0.15.
|
|
84
|
-
"@backstage/integration-react": "1.2.
|
|
82
|
+
"@backstage/filter-predicates": "0.1.1",
|
|
83
|
+
"@backstage/frontend-plugin-api": "0.15.2-next.0",
|
|
84
|
+
"@backstage/integration-react": "1.2.17-next.0",
|
|
85
85
|
"@backstage/plugin-catalog-common": "1.1.8",
|
|
86
|
-
"@backstage/plugin-permission-common": "0.9.
|
|
87
|
-
"@backstage/plugin-permission-react": "0.4.
|
|
86
|
+
"@backstage/plugin-permission-common": "0.9.7",
|
|
87
|
+
"@backstage/plugin-permission-react": "0.4.42-next.0",
|
|
88
88
|
"@backstage/types": "1.2.2",
|
|
89
|
-
"@backstage/ui": "0.
|
|
89
|
+
"@backstage/ui": "0.14.0-next.0",
|
|
90
90
|
"@backstage/version-bridge": "1.0.12",
|
|
91
91
|
"@material-ui/core": "^4.12.2",
|
|
92
92
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -101,12 +101,12 @@
|
|
|
101
101
|
"zen-observable": "^0.10.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@backstage/cli": "0.36.
|
|
105
|
-
"@backstage/core-app-api": "1.19.
|
|
106
|
-
"@backstage/frontend-test-utils": "0.5.
|
|
104
|
+
"@backstage/cli": "0.36.1-next.0",
|
|
105
|
+
"@backstage/core-app-api": "1.19.7-next.0",
|
|
106
|
+
"@backstage/frontend-test-utils": "0.5.2-next.0",
|
|
107
107
|
"@backstage/plugin-catalog-common": "1.1.8",
|
|
108
|
-
"@backstage/plugin-scaffolder-common": "2.0.0
|
|
109
|
-
"@backstage/test-utils": "1.7.
|
|
108
|
+
"@backstage/plugin-scaffolder-common": "2.0.0",
|
|
109
|
+
"@backstage/test-utils": "1.7.17-next.0",
|
|
110
110
|
"@testing-library/dom": "^10.0.0",
|
|
111
111
|
"@testing-library/jest-dom": "^6.0.0",
|
|
112
112
|
"@testing-library/react": "^16.0.0",
|
|
@@ -117,10 +117,10 @@
|
|
|
117
117
|
"react-dom": "^18.0.2",
|
|
118
118
|
"react-router-dom": "^6.30.2",
|
|
119
119
|
"react-test-renderer": "^16.13.1",
|
|
120
|
-
"zod": "^3.25.76"
|
|
120
|
+
"zod": "^3.25.76 || ^4.0.0"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
|
-
"@backstage/frontend-test-utils": "0.5.
|
|
123
|
+
"@backstage/frontend-test-utils": "0.5.2-next.0",
|
|
124
124
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
125
125
|
"react": "^17.0.0 || ^18.0.0",
|
|
126
126
|
"react-dom": "^17.0.0 || ^18.0.0",
|