diff --git a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx index fde41425c9..60d6ffb699 100644 --- a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx @@ -14,7 +14,11 @@ * limitations under the License. */ -import { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model'; +import { + ApiEntity, + Entity, + RELATION_CONSUMES_API, +} from '@backstage/catalog-model'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -29,14 +33,19 @@ import { InfoCardVariants, Link, Progress, + TableProps, WarningPanel, } from '@backstage/core-components'; -type Props = { +type Props = { variant?: InfoCardVariants; + tableOptions?: TableProps['options']; }; -export const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => { +export const ConsumedApisCard = ({ + variant = 'gridItem', + tableOptions = {}, +}: Props) => { const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: RELATION_CONSUMES_API, @@ -81,6 +90,7 @@ export const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => { } columns={apiEntityColumns} entities={entities as ApiEntity[]} + tableOptions={tableOptions} /> ); }; diff --git a/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx b/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx index bb22f82269..3f9e9c8d71 100644 --- a/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model'; +import { ApiEntity, Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -30,11 +30,13 @@ import { Link, Progress, TableColumn, + TableProps, WarningPanel, } from '@backstage/core-components'; -type Props = { +type Props = { variant?: InfoCardVariants; + tableOptions?: TableProps['options']; }; const columns: TableColumn[] = [ @@ -45,7 +47,10 @@ const columns: TableColumn[] = [ EntityTable.columns.createMetadataDescriptionColumn(), ]; -export const HasApisCard = ({ variant = 'gridItem' }: Props) => { +export const HasApisCard = ({ + variant = 'gridItem', + tableOptions = {}, +}: Props) => { const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: RELATION_HAS_PART, @@ -91,6 +96,7 @@ export const HasApisCard = ({ variant = 'gridItem' }: Props) => { } columns={columns} entities={entities as ApiEntity[]} + tableOptions={tableOptions} /> ); }; diff --git a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx index 6ffb6365d2..627a4bba37 100644 --- a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx @@ -14,7 +14,11 @@ * limitations under the License. */ -import { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model'; +import { + ApiEntity, + Entity, + RELATION_PROVIDES_API, +} from '@backstage/catalog-model'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -29,14 +33,19 @@ import { InfoCardVariants, Link, Progress, + TableProps, WarningPanel, } from '@backstage/core-components'; -type Props = { +type Props = { variant?: InfoCardVariants; + tableOptions?: TableProps['options']; }; -export const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => { +export const ProvidedApisCard = ({ + variant = 'gridItem', + tableOptions = {}, +}: Props) => { const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: RELATION_PROVIDES_API, @@ -81,6 +90,7 @@ export const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => { } columns={apiEntityColumns} entities={entities as ApiEntity[]} + tableOptions={tableOptions} /> ); }; diff --git a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx index af3dcb7204..62fa13c027 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx @@ -16,6 +16,7 @@ import { ComponentEntity, + Entity, RELATION_API_CONSUMED_BY, } from '@backstage/catalog-model'; import { Typography } from '@material-ui/core'; @@ -31,14 +32,19 @@ import { InfoCardVariants, Link, Progress, + TableProps, WarningPanel, } from '@backstage/core-components'; -type Props = { +type Props = { variant?: InfoCardVariants; + tableOptions?: TableProps['options']; }; -export const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => { +export const ConsumingComponentsCard = ({ + variant = 'gridItem', + tableOptions = {}, +}: Props) => { const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: RELATION_API_CONSUMED_BY, @@ -82,6 +88,7 @@ export const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => { } columns={EntityTable.componentEntityColumns} entities={entities as ComponentEntity[]} + tableOptions={tableOptions} /> ); }; diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx index 0be746de6d..a16991d57a 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx @@ -16,6 +16,7 @@ import { ComponentEntity, + Entity, RELATION_API_PROVIDED_BY, } from '@backstage/catalog-model'; import { Typography } from '@material-ui/core'; @@ -31,14 +32,19 @@ import { InfoCardVariants, Link, Progress, + TableProps, WarningPanel, } from '@backstage/core-components'; -type Props = { +type Props = { variant?: InfoCardVariants; + tableOptions?: TableProps['options']; }; -export const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => { +export const ProvidingComponentsCard = ({ + variant = 'gridItem', + tableOptions = {}, +}: Props) => { const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: RELATION_API_PROVIDED_BY, @@ -82,6 +88,7 @@ export const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => { } columns={EntityTable.componentEntityColumns} entities={entities as ComponentEntity[]} + tableOptions={tableOptions} /> ); }; diff --git a/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx b/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx index aced5b63e1..9f65640569 100644 --- a/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx +++ b/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx @@ -61,7 +61,7 @@ export const EntityTable = (props: EntityTableProps) => { emptyContent, variant = 'gridItem', columns, - tableOptions, + tableOptions = {}, } = props; const classes = useStyles(); diff --git a/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.tsx b/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.tsx index 3b22ea2aa0..d60785d165 100644 --- a/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.tsx +++ b/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.tsx @@ -40,7 +40,7 @@ export function DependencyOfComponentsCard( const { variant = 'gridItem', title = 'Dependency of components', - tableOptions, + tableOptions = {}, } = props; return ( ( relationType, emptyMessage, emptyHelpLink, - tableOptions, + tableOptions = {}, asRenderableEntities, } = props;