@backstage/plugin-catalog-react 1.10.1-next.0 → 1.10.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 1.10.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b2a9926: Adds an argument for which filters should be applied when fetching/counting available values
8
+ - a6e237f: Added `DefaultFilters` component
9
+ - Updated dependencies
10
+ - @backstage/core-components@0.14.1-next.1
11
+ - @backstage/core-plugin-api@1.9.1-next.1
12
+ - @backstage/integration-react@1.1.25-next.1
13
+ - @backstage/plugin-permission-common@0.7.13-next.1
14
+ - @backstage/plugin-permission-react@0.4.21-next.1
15
+ - @backstage/frontend-plugin-api@0.6.1-next.1
16
+ - @backstage/catalog-client@1.6.1-next.0
17
+ - @backstage/catalog-model@1.4.5-next.0
18
+ - @backstage/errors@1.2.4-next.0
19
+ - @backstage/types@1.1.1
20
+ - @backstage/version-bridge@1.0.7
21
+ - @backstage/plugin-catalog-common@1.0.22-next.1
22
+
3
23
  ## 1.10.1-next.0
4
24
 
5
25
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "1.10.1-next.0",
3
+ "version": "1.10.1-next.1",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/index.d.ts CHANGED
@@ -210,6 +210,55 @@ declare const CatalogFilterLayout: {
210
210
  }) => React.JSX.Element;
211
211
  };
212
212
 
213
+ /** @public */
214
+ type EntityFilter = {
215
+ /**
216
+ * Get filters to add to the catalog-backend request. These are a dot-delimited field with
217
+ * value(s) to accept, extracted on the backend by parseEntityFilterParams. For example:
218
+ * `{ field: 'kind', values: ['component'] }`
219
+ * `{ field: 'metadata.name', values: ['component-1', 'component-2'] }`
220
+ */
221
+ getCatalogFilters?: () => Record<string, string | symbol | (string | symbol)[]>;
222
+ /**
223
+ * Filter entities on the frontend after a catalog-backend request. This function will be called
224
+ * with each backend-resolved entity. This is used when frontend information is required for
225
+ * filtering, such as a user's starred entities.
226
+ */
227
+ filterEntity?: (entity: Entity) => boolean;
228
+ /**
229
+ * Serialize the filter value to a string for query params. The UI component responsible for
230
+ * handling this filter should retrieve this from useEntityList.queryParameters. The
231
+ * value restored should be in the precedence: queryParameters `>` initialValue prop `>` default.
232
+ */
233
+ toQueryValue?: () => string | string[];
234
+ };
235
+ /** @public */
236
+ type UserListFilterKind = 'owned' | 'starred' | 'all';
237
+
238
+ /** @public */
239
+ type CatalogReactEntityOwnerPickerClassKey = 'input';
240
+ /**
241
+ * @public
242
+ */
243
+ type EntityOwnerPickerProps = {
244
+ mode?: 'owners-only' | 'all';
245
+ };
246
+ /** @public */
247
+ declare const EntityOwnerPicker: (props?: EntityOwnerPickerProps) => React.JSX.Element | null;
248
+
249
+ /**
250
+ * Props for default filters.
251
+ *
252
+ * @public
253
+ */
254
+ type DefaultFiltersProps = {
255
+ initialKind?: string;
256
+ initiallySelectedFilter?: UserListFilterKind;
257
+ ownerPickerMode?: EntityOwnerPickerProps['mode'];
258
+ };
259
+ /** @public */
260
+ declare const DefaultFilters: (props: DefaultFiltersProps) => React.JSX.Element;
261
+
213
262
  /**
214
263
  * Props for {@link EntityKindPicker}.
215
264
  *
@@ -234,17 +283,6 @@ declare const EntityLifecyclePicker: (props: {
234
283
  initialFilter?: string[];
235
284
  }) => React.JSX.Element;
236
285
 
237
- /** @public */
238
- type CatalogReactEntityOwnerPickerClassKey = 'input';
239
- /**
240
- * @public
241
- */
242
- type EntityOwnerPickerProps = {
243
- mode?: 'owners-only' | 'all';
244
- };
245
- /** @public */
246
- declare const EntityOwnerPicker: (props?: EntityOwnerPickerProps) => React.JSX.Element | null;
247
-
248
286
  /**
249
287
  * The available style class keys for {@link EntityDisplayName}, under the name
250
288
  * "CatalogReactEntityDisplayName".
@@ -466,31 +504,6 @@ type UnregisterEntityDialogProps = {
466
504
  /** @public */
467
505
  declare const UnregisterEntityDialog: (props: UnregisterEntityDialogProps) => React.JSX.Element;
468
506
 
469
- /** @public */
470
- type EntityFilter = {
471
- /**
472
- * Get filters to add to the catalog-backend request. These are a dot-delimited field with
473
- * value(s) to accept, extracted on the backend by parseEntityFilterParams. For example:
474
- * `{ field: 'kind', values: ['component'] }`
475
- * `{ field: 'metadata.name', values: ['component-1', 'component-2'] }`
476
- */
477
- getCatalogFilters?: () => Record<string, string | symbol | (string | symbol)[]>;
478
- /**
479
- * Filter entities on the frontend after a catalog-backend request. This function will be called
480
- * with each backend-resolved entity. This is used when frontend information is required for
481
- * filtering, such as a user's starred entities.
482
- */
483
- filterEntity?: (entity: Entity) => boolean;
484
- /**
485
- * Serialize the filter value to a string for query params. The UI component responsible for
486
- * handling this filter should retrieve this from useEntityList.queryParameters. The
487
- * value restored should be in the precedence: queryParameters `>` initialValue prop `>` default.
488
- */
489
- toQueryValue?: () => string | string[];
490
- };
491
- /** @public */
492
- type UserListFilterKind = 'owned' | 'starred' | 'all';
493
-
494
507
  /** @public */
495
508
  type CatalogReactUserListPickerClassKey = 'root' | 'title' | 'listIcon' | 'menuItem' | 'groupWrapper';
496
509
  /** @public */
@@ -728,6 +741,7 @@ type EntityAutocompletePickerProps<T extends DefaultEntityFilters = DefaultEntit
728
741
  };
729
742
  InputProps?: TextFieldProps;
730
743
  initialSelectedOptions?: string[];
744
+ filtersForAvailableValues?: Array<keyof T>;
731
745
  };
732
746
  /** @public */
733
747
  type CatalogReactEntityAutocompletePickerClassKey = 'root' | 'label';
@@ -924,4 +938,4 @@ type EntitySourceLocation = {
924
938
  /** @public */
925
939
  declare function getEntitySourceLocation(entity: Entity, scmIntegrationsApi: typeof scmIntegrationsApiRef.T): EntitySourceLocation | undefined;
926
940
 
927
- export { AllowedEntityFilters, AsyncEntityProvider, AsyncEntityProviderProps, BackstageOverrides, CatalogFilterLayout, CatalogReactComponentsNameToClassKey, CatalogReactEntityAutocompletePickerClassKey, CatalogReactEntityDisplayNameClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityNamespacePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntityProcessingStatusPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, EntityAutocompletePicker, EntityAutocompletePickerProps, EntityDisplayName, EntityDisplayNameProps, EntityErrorFilter, EntityFilter, EntityKindFilter, EntityKindPicker, EntityKindPickerProps, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListContextProps, EntityListProvider, EntityListProviderProps, EntityLoadingStatus, EntityNamespaceFilter, EntityNamespacePicker, EntityOrphanFilter, EntityOwnerFilter, EntityOwnerPicker, EntityOwnerPickerProps, EntityPeekAheadPopover, EntityPeekAheadPopoverProps, EntityPresentationApi, EntityProcessingStatusPicker, EntityProvider, EntityProviderProps, EntityRefLink, EntityRefLinkProps, EntityRefLinks, EntityRefLinksProps, EntityRefPresentation, EntityRefPresentationSnapshot, EntitySearchBar, EntitySourceLocation, EntityTable, EntityTableProps, EntityTagFilter, EntityTagPicker, EntityTagPickerProps, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityTypePickerProps, EntityUserFilter, FavoriteEntity, FavoriteEntityProps, InspectEntityDialog, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, MockEntityListContextProvider, MockStarredEntitiesApi, StarredEntitiesApi, UnregisterEntityDialog, UnregisterEntityDialogProps, UserListFilter, UserListFilterKind, UserListPicker, UserListPickerProps, catalogApiRef, columnFactories, defaultEntityPresentation, entityPresentationApiRef, entityRouteParams, entityRouteRef, getEntityRelations, getEntitySourceLocation, humanizeEntityRef, starredEntitiesApiRef, useAsyncEntity, useEntity, useEntityList, useEntityOwnership, useEntityPresentation, useEntityTypeFilter, useRelatedEntities, useStarredEntities, useStarredEntity };
941
+ export { AllowedEntityFilters, AsyncEntityProvider, AsyncEntityProviderProps, BackstageOverrides, CatalogFilterLayout, CatalogReactComponentsNameToClassKey, CatalogReactEntityAutocompletePickerClassKey, CatalogReactEntityDisplayNameClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityNamespacePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntityProcessingStatusPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultFilters, DefaultFiltersProps, EntityAutocompletePicker, EntityAutocompletePickerProps, EntityDisplayName, EntityDisplayNameProps, EntityErrorFilter, EntityFilter, EntityKindFilter, EntityKindPicker, EntityKindPickerProps, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListContextProps, EntityListProvider, EntityListProviderProps, EntityLoadingStatus, EntityNamespaceFilter, EntityNamespacePicker, EntityOrphanFilter, EntityOwnerFilter, EntityOwnerPicker, EntityOwnerPickerProps, EntityPeekAheadPopover, EntityPeekAheadPopoverProps, EntityPresentationApi, EntityProcessingStatusPicker, EntityProvider, EntityProviderProps, EntityRefLink, EntityRefLinkProps, EntityRefLinks, EntityRefLinksProps, EntityRefPresentation, EntityRefPresentationSnapshot, EntitySearchBar, EntitySourceLocation, EntityTable, EntityTableProps, EntityTagFilter, EntityTagPicker, EntityTagPickerProps, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityTypePickerProps, EntityUserFilter, FavoriteEntity, FavoriteEntityProps, InspectEntityDialog, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, MockEntityListContextProvider, MockStarredEntitiesApi, StarredEntitiesApi, UnregisterEntityDialog, UnregisterEntityDialogProps, UserListFilter, UserListFilterKind, UserListPicker, UserListPickerProps, catalogApiRef, columnFactories, defaultEntityPresentation, entityPresentationApiRef, entityRouteParams, entityRouteRef, getEntityRelations, getEntitySourceLocation, humanizeEntityRef, starredEntitiesApiRef, useAsyncEntity, useEntity, useEntityList, useEntityOwnership, useEntityPresentation, useEntityTypeFilter, useRelatedEntities, useStarredEntities, useStarredEntity };