From 901cc8886fe35ec968c16da0a486465c2cae26cd Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 21 Nov 2023 13:35:45 +0100 Subject: [PATCH] catalog: remove Pagination type Signed-off-by: Vincenzo Scamporlino --- plugins/catalog-react/api-report.md | 13 +++++-------- plugins/catalog-react/src/hooks/index.ts | 1 - .../src/hooks/useEntityListProvider.tsx | 7 +------ .../components/CatalogPage/DefaultCatalogPage.tsx | 3 +-- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index 7e5e2fc5e7..8c6b3a729f 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -297,7 +297,11 @@ export const EntityListProvider: ( // @public (undocumented) export type EntityListProviderProps = PropsWithChildren<{ - pagination?: Pagination; + pagination?: + | boolean + | { + limit?: number; + }; }>; // @public (undocumented) @@ -653,13 +657,6 @@ export class MockStarredEntitiesApi implements StarredEntitiesApi { toggleStarred(entityRef: string): Promise; } -// @public (undocumented) -export type Pagination = - | boolean - | { - limit?: number; - }; - // @public export interface StarredEntitiesApi { starredEntitie$(): Observable>; diff --git a/plugins/catalog-react/src/hooks/index.ts b/plugins/catalog-react/src/hooks/index.ts index c2f9604de9..c3021f8992 100644 --- a/plugins/catalog-react/src/hooks/index.ts +++ b/plugins/catalog-react/src/hooks/index.ts @@ -33,7 +33,6 @@ export type { DefaultEntityFilters, EntityListContextProps, EntityListProviderProps, - Pagination, } from './useEntityListProvider'; export { useEntityTypeFilter } from './useEntityTypeFilter'; export { useRelatedEntities } from './useRelatedEntities'; diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 4b7adfd26a..1ce87c262e 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -130,14 +130,9 @@ type OutputState = { * @public */ export type EntityListProviderProps = PropsWithChildren<{ - pagination?: Pagination; + pagination?: boolean | { limit?: number }; }>; -/** - * @public - */ -export type Pagination = boolean | { limit?: number }; - /** * Provides entities and filters for a catalog listing. * @public diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index 21f8351127..1f724d10fc 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -37,7 +37,6 @@ import { EntityKindPicker, EntityNamespacePicker, EntityOwnerPickerProps, - Pagination, } from '@backstage/plugin-catalog-react'; import React, { ReactNode } from 'react'; import { createComponentRouteRef } from '../../routes'; @@ -51,7 +50,7 @@ import { CatalogTableColumnsFunc } from '../CatalogTable/types'; export type BaseCatalogPageProps = { filters: ReactNode; content?: ReactNode; - pagination?: Pagination; + pagination?: boolean | { limit?: number }; }; /** @internal */