diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index cb4c2a2533..2663dc7fd2 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -44,7 +44,7 @@ import React from 'react'; import { createComponentRouteRef } from '../../routes'; import { CatalogTableRow } from '../CatalogTable'; import { DefaultCatalogPage } from './DefaultCatalogPage'; -import { ColumnsFunc } from '../CatalogTable/CatalogTable'; +import { CatalogTableColumnsFunc } from '../CatalogTable/CatalogTable'; describe('DefaultCatalogPage', () => { const origReplaceState = window.history.replaceState; @@ -219,7 +219,7 @@ describe('DefaultCatalogPage', () => { }, 20_000); it('should render the custom column function passed as prop', async () => { - const columns: ColumnsFunc = ({ filters, entities }) => { + const columns: CatalogTableColumnsFunc = ({ filters, entities }) => { return filters.kind?.value === 'component' && entities.length ? [ { title: 'Foo', field: 'entity.foo' }, diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index bcabbed991..9aca36a4e1 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -43,7 +43,7 @@ import { createComponentRouteRef } from '../../routes'; import { CatalogTable, CatalogTableRow } from '../CatalogTable'; import { catalogTranslationRef } from '../../translation'; import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; -import { ColumnsFunc } from '../CatalogTable/CatalogTable'; +import { CatalogTableColumnsFunc } from '../CatalogTable/CatalogTable'; /** @internal */ export interface BaseCatalogPageProps { @@ -87,7 +87,7 @@ export function BaseCatalogPage(props: BaseCatalogPageProps) { */ export interface DefaultCatalogPageProps { initiallySelectedFilter?: UserListFilterKind; - columns?: TableColumn[] | ColumnsFunc; + columns?: TableColumn[] | CatalogTableColumnsFunc; actions?: TableProps['actions']; initialKind?: string; tableOptions?: TableProps['options']; diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx index cfcba1fedd..c55b058ec5 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx @@ -31,7 +31,7 @@ import { import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils'; import { act, fireEvent, screen } from '@testing-library/react'; import * as React from 'react'; -import { CatalogTable, ColumnsFunc } from './CatalogTable'; +import { CatalogTable, CatalogTableColumnsFunc } from './CatalogTable'; const entities: Entity[] = [ { @@ -381,7 +381,10 @@ describe('CatalogTable component', () => { }); it('should render the label column with customised title and value as specified using function', async () => { - const columns: ColumnsFunc = ({ filters, entities: entities1 }) => { + const columns: CatalogTableColumnsFunc = ({ + filters, + entities: entities1, + }) => { return filters.kind?.value === 'api' && entities1.length ? [ CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 4cbdf64a88..dd18984b8e 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -53,7 +53,7 @@ import { CatalogTableRow } from './types'; * * @public */ -export type ColumnsFunc = ( +export type CatalogTableColumnsFunc = ( entityListContext: EntityListContextProps, ) => TableColumn[]; @@ -63,7 +63,7 @@ export type ColumnsFunc = ( * @public */ export interface CatalogTableProps { - columns?: TableColumn[] | ColumnsFunc; + columns?: TableColumn[] | CatalogTableColumnsFunc; actions?: TableProps['actions']; tableOptions?: TableProps['options']; emptyContent?: ReactNode;