Revert commits, to go in new direction

Signed-off-by: Michael Haley <mike.f.haley@gmail.com>
This commit is contained in:
Michael Haley
2022-06-07 10:15:48 -04:00
parent ed1727148c
commit 5585fa5cff
19 changed files with 43 additions and 178 deletions
-7
View File
@@ -1,7 +0,0 @@
---
'@backstage/plugin-api-docs': patch
'@backstage/plugin-catalog': patch
'@backstage/plugin-catalog-react': patch
---
Extend `<EntityTable />` props to allow `material-table` options to be passed via prop `tableOptions`. Prop is exposed to other components that are composed from `<EntityTable />`
+5 -35
View File
@@ -9,11 +9,8 @@ import { ApiEntity } from '@backstage/catalog-model';
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CatalogTableRow } from '@backstage/plugin-catalog';
import { ComponentEntity } from '@backstage/catalog-model';
import { Entity } from '@backstage/catalog-model';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { Options } from '@material-table/core';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { TableColumn } from '@backstage/core-components';
@@ -94,26 +91,19 @@ export type AsyncApiDefinitionWidgetProps = {
// Warning: (ae-missing-release-tag) "ConsumedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ConsumedApisCard: ({
variant,
tableOptions,
}: Props<ApiEntity>) => JSX.Element;
export const ConsumedApisCard: ({ variant }: Props) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ConsumingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ConsumingComponentsCard: ({
variant,
tableOptions,
}: Props_4<ComponentEntity>) => JSX.Element;
export const ConsumingComponentsCard: ({ variant }: Props_4) => JSX.Element;
// @public
export const DefaultApiExplorerPage: ({
initiallySelectedFilter,
columns,
actions,
tableOptions,
}: DefaultApiExplorerPageProps) => JSX.Element;
// @public
@@ -121,7 +111,6 @@ export type DefaultApiExplorerPageProps = {
initiallySelectedFilter?: UserListFilterKind;
columns?: TableColumn<CatalogTableRow>[];
actions?: TableProps<CatalogTableRow>['actions'];
tableOptions?: TableProps<CatalogTableRow>['options'];
};
// Warning: (ae-missing-release-tag) "defaultDefinitionWidgets" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -139,10 +128,8 @@ export const EntityApiDefinitionCard: () => JSX.Element;
// @public (undocumented)
export const EntityConsumedApisCard: ({
variant,
tableOptions,
}: {
variant?: InfoCardVariants | undefined;
tableOptions?: Options<ApiEntity> | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityConsumingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -150,10 +137,8 @@ export const EntityConsumedApisCard: ({
// @public (undocumented)
export const EntityConsumingComponentsCard: ({
variant,
tableOptions,
}: {
variant?: InfoCardVariants | undefined;
tableOptions?: Options<ComponentEntity> | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityHasApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -161,10 +146,8 @@ export const EntityConsumingComponentsCard: ({
// @public (undocumented)
export const EntityHasApisCard: ({
variant,
tableOptions,
}: {
variant?: InfoCardVariants | undefined;
tableOptions?: Options<ApiEntity> | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -172,10 +155,8 @@ export const EntityHasApisCard: ({
// @public (undocumented)
export const EntityProvidedApisCard: ({
variant,
tableOptions,
}: {
variant?: InfoCardVariants | undefined;
tableOptions?: Options<ApiEntity> | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -183,10 +164,8 @@ export const EntityProvidedApisCard: ({
// @public (undocumented)
export const EntityProvidingComponentsCard: ({
variant,
tableOptions,
}: {
variant?: InfoCardVariants | undefined;
tableOptions?: Options<ComponentEntity> | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "GraphQlDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -207,10 +186,7 @@ export type GraphQlDefinitionWidgetProps = {
// Warning: (ae-missing-release-tag) "HasApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const HasApisCard: ({
variant,
tableOptions,
}: Props_2<ApiEntity>) => JSX.Element;
export const HasApisCard: ({ variant }: Props_2) => JSX.Element;
// Warning: (ae-missing-release-tag) "OpenApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -245,17 +221,11 @@ export type PlainApiDefinitionWidgetProps = {
// Warning: (ae-missing-release-tag) "ProvidedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ProvidedApisCard: ({
variant,
tableOptions,
}: Props_3<ApiEntity>) => JSX.Element;
export const ProvidedApisCard: ({ variant }: Props_3) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ProvidingComponentsCard: ({
variant,
tableOptions,
}: Props_5<ComponentEntity>) => JSX.Element;
export const ProvidingComponentsCard: ({ variant }: Props_5) => JSX.Element;
```
@@ -57,7 +57,6 @@ export type DefaultApiExplorerPageProps = {
initiallySelectedFilter?: UserListFilterKind;
columns?: TableColumn<CatalogTableRow>[];
actions?: TableProps<CatalogTableRow>['actions'];
tableOptions?: TableProps<CatalogTableRow>['options'];
};
/**
@@ -68,7 +67,6 @@ export const DefaultApiExplorerPage = ({
initiallySelectedFilter = 'all',
columns,
actions,
tableOptions = {},
}: DefaultApiExplorerPageProps) => {
const configApi = useApi(configApiRef);
const generatedSubtitle = `${
@@ -105,7 +103,6 @@ export const DefaultApiExplorerPage = ({
<CatalogTable
columns={columns || defaultColumns}
actions={actions}
tableOptions={tableOptions}
/>
</CatalogFilterLayout.Content>
</CatalogFilterLayout>
@@ -14,11 +14,7 @@
* limitations under the License.
*/
import {
ApiEntity,
Entity,
RELATION_CONSUMES_API,
} from '@backstage/catalog-model';
import { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model';
import { Typography } from '@material-ui/core';
import {
EntityTable,
@@ -33,19 +29,14 @@ import {
InfoCardVariants,
Link,
Progress,
TableProps,
WarningPanel,
} from '@backstage/core-components';
type Props<T extends Entity> = {
type Props = {
variant?: InfoCardVariants;
tableOptions?: TableProps<T>['options'];
};
export const ConsumedApisCard = ({
variant = 'gridItem',
tableOptions = {},
}: Props<ApiEntity>) => {
export const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => {
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_CONSUMES_API,
@@ -90,7 +81,6 @@ export const ConsumedApisCard = ({
}
columns={apiEntityColumns}
entities={entities as ApiEntity[]}
tableOptions={tableOptions}
/>
);
};
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ApiEntity, Entity, RELATION_HAS_PART } from '@backstage/catalog-model';
import { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model';
import { Typography } from '@material-ui/core';
import {
EntityTable,
@@ -30,13 +30,11 @@ import {
Link,
Progress,
TableColumn,
TableProps,
WarningPanel,
} from '@backstage/core-components';
type Props<T extends Entity> = {
type Props = {
variant?: InfoCardVariants;
tableOptions?: TableProps<T>['options'];
};
const columns: TableColumn<ApiEntity>[] = [
@@ -47,10 +45,7 @@ const columns: TableColumn<ApiEntity>[] = [
EntityTable.columns.createMetadataDescriptionColumn(),
];
export const HasApisCard = ({
variant = 'gridItem',
tableOptions = {},
}: Props<ApiEntity>) => {
export const HasApisCard = ({ variant = 'gridItem' }: Props) => {
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_HAS_PART,
@@ -96,7 +91,6 @@ export const HasApisCard = ({
}
columns={columns}
entities={entities as ApiEntity[]}
tableOptions={tableOptions}
/>
);
};
@@ -14,11 +14,7 @@
* limitations under the License.
*/
import {
ApiEntity,
Entity,
RELATION_PROVIDES_API,
} from '@backstage/catalog-model';
import { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model';
import { Typography } from '@material-ui/core';
import {
EntityTable,
@@ -33,19 +29,14 @@ import {
InfoCardVariants,
Link,
Progress,
TableProps,
WarningPanel,
} from '@backstage/core-components';
type Props<T extends Entity> = {
type Props = {
variant?: InfoCardVariants;
tableOptions?: TableProps<T>['options'];
};
export const ProvidedApisCard = ({
variant = 'gridItem',
tableOptions = {},
}: Props<ApiEntity>) => {
export const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => {
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_PROVIDES_API,
@@ -90,7 +81,6 @@ export const ProvidedApisCard = ({
}
columns={apiEntityColumns}
entities={entities as ApiEntity[]}
tableOptions={tableOptions}
/>
);
};
@@ -16,7 +16,6 @@
import {
ComponentEntity,
Entity,
RELATION_API_CONSUMED_BY,
} from '@backstage/catalog-model';
import { Typography } from '@material-ui/core';
@@ -32,19 +31,14 @@ import {
InfoCardVariants,
Link,
Progress,
TableProps,
WarningPanel,
} from '@backstage/core-components';
type Props<T extends Entity> = {
type Props = {
variant?: InfoCardVariants;
tableOptions?: TableProps<T>['options'];
};
export const ConsumingComponentsCard = ({
variant = 'gridItem',
tableOptions = {},
}: Props<ComponentEntity>) => {
export const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => {
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_API_CONSUMED_BY,
@@ -88,7 +82,6 @@ export const ConsumingComponentsCard = ({
}
columns={EntityTable.componentEntityColumns}
entities={entities as ComponentEntity[]}
tableOptions={tableOptions}
/>
);
};
@@ -16,7 +16,6 @@
import {
ComponentEntity,
Entity,
RELATION_API_PROVIDED_BY,
} from '@backstage/catalog-model';
import { Typography } from '@material-ui/core';
@@ -32,19 +31,14 @@ import {
InfoCardVariants,
Link,
Progress,
TableProps,
WarningPanel,
} from '@backstage/core-components';
type Props<T extends Entity> = {
type Props = {
variant?: InfoCardVariants;
tableOptions?: TableProps<T>['options'];
};
export const ProvidingComponentsCard = ({
variant = 'gridItem',
tableOptions = {},
}: Props<ComponentEntity>) => {
export const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => {
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_API_PROVIDED_BY,
@@ -88,7 +82,6 @@ export const ProvidingComponentsCard = ({
}
columns={EntityTable.componentEntityColumns}
entities={entities as ComponentEntity[]}
tableOptions={tableOptions}
/>
);
};
-3
View File
@@ -26,7 +26,6 @@ import { ScmIntegrationRegistry } from '@backstage/integration';
import { StyleRules } from '@material-ui/core/styles/withStyles';
import { SystemEntity } from '@backstage/catalog-model';
import { TableColumn } from '@backstage/core-components';
import { TableProps } from '@backstage/core-components';
// @public
export const AsyncEntityProvider: ({
@@ -333,8 +332,6 @@ export interface EntityTableProps<T extends Entity> {
// (undocumented)
entities: T[];
// (undocumented)
tableOptions?: TableProps<T>['options'];
// (undocumented)
title: string;
// (undocumented)
variant?: InfoCardVariants;
@@ -23,7 +23,6 @@ import {
InfoCardVariants,
Table,
TableColumn,
TableProps,
} from '@backstage/core-components';
/**
@@ -37,7 +36,6 @@ export interface EntityTableProps<T extends Entity> {
entities: T[];
emptyContent?: ReactNode;
columns: TableColumn<T>[];
tableOptions?: TableProps<T>['options'];
}
const useStyles = makeStyles(theme => ({
@@ -61,7 +59,6 @@ export const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {
emptyContent,
variant = 'gridItem',
columns,
tableOptions = {},
} = props;
const classes = useStyles();
@@ -83,14 +80,11 @@ export const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {
emptyContent && <div className={classes.empty}>{emptyContent}</div>
}
options={{
...{
// TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;
search: false,
paging: false,
actionsColumnIndex: -1,
padding: 'dense',
},
...tableOptions,
// TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;
search: false,
paging: false,
actionsColumnIndex: -1,
padding: 'dense',
}}
data={entities}
/>
-18
View File
@@ -7,7 +7,6 @@
import { ApiHolder } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { ComponentEntity } from '@backstage/catalog-model';
import { CompoundEntityRef } from '@backstage/catalog-model';
import { Entity } from '@backstage/catalog-model';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
@@ -18,13 +17,11 @@ import { Observable } from '@backstage/types';
import { Overrides } from '@material-ui/core/styles/overrides';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { ResourceEntity } from '@backstage/catalog-model';
import { ResultHighlight } from '@backstage/plugin-search-common';
import { RouteRef } from '@backstage/core-plugin-api';
import { StarredEntitiesApi } from '@backstage/plugin-catalog-react';
import { StorageApi } from '@backstage/core-plugin-api';
import { StyleRules } from '@material-ui/core/styles/withStyles';
import { SystemEntity } from '@backstage/catalog-model';
import { TableColumn } from '@backstage/core-components';
import { TableProps } from '@backstage/core-components';
import { TabProps } from '@material-ui/core';
@@ -187,8 +184,6 @@ export class DefaultStarredEntitiesApi implements StarredEntitiesApi {
// @public (undocumented)
export interface DependencyOfComponentsCardProps {
// (undocumented)
tableOptions?: TableProps<ComponentEntity>['options'];
// (undocumented)
title?: string;
// (undocumented)
@@ -197,8 +192,6 @@ export interface DependencyOfComponentsCardProps {
// @public (undocumented)
export interface DependsOnComponentsCardProps {
// (undocumented)
tableOptions?: TableProps<ComponentEntity>['options'];
// (undocumented)
title?: string;
// (undocumented)
@@ -207,8 +200,6 @@ export interface DependsOnComponentsCardProps {
// @public (undocumented)
export interface DependsOnResourcesCardProps {
// (undocumented)
tableOptions?: TableProps<ResourceEntity>['options'];
// (undocumented)
variant?: InfoCardVariants;
}
@@ -357,32 +348,24 @@ export function hasCatalogProcessingErrors(
// @public (undocumented)
export interface HasComponentsCardProps {
// (undocumented)
tableOptions?: TableProps<ComponentEntity>['options'];
// (undocumented)
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasResourcesCardProps {
// (undocumented)
tableOptions?: TableProps<ResourceEntity>['options'];
// (undocumented)
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasSubcomponentsCardProps {
// (undocumented)
tableOptions?: TableProps<ComponentEntity>['options'];
// (undocumented)
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasSystemsCardProps {
// (undocumented)
tableOptions?: TableProps<SystemEntity>['options'];
// (undocumented)
variant?: InfoCardVariants;
}
@@ -423,7 +406,6 @@ export type RelatedEntitiesCardProps<T extends Entity> = {
relationType: string;
emptyMessage: string;
emptyHelpLink: string;
tableOptions?: TableProps<T>['options'];
asRenderableEntities: (entities: Entity[]) => T[];
};
@@ -14,11 +14,8 @@
* limitations under the License.
*/
import {
ComponentEntity,
RELATION_DEPENDENCY_OF,
} from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_DEPENDENCY_OF } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -31,17 +28,12 @@ import {
export interface DependencyOfComponentsCardProps {
variant?: InfoCardVariants;
title?: string;
tableOptions?: TableProps<ComponentEntity>['options'];
}
export function DependencyOfComponentsCard(
props: DependencyOfComponentsCardProps,
) {
const {
variant = 'gridItem',
title = 'Dependency of components',
tableOptions = {},
} = props;
const { variant = 'gridItem', title = 'Dependency of components' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -52,7 +44,6 @@ export function DependencyOfComponentsCard(
emptyMessage="No component depends on this component"
emptyHelpLink={componentEntityHelpLink}
asRenderableEntities={asComponentEntities}
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { ComponentEntity, RELATION_DEPENDS_ON } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_DEPENDS_ON } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -28,15 +28,10 @@ import {
export interface DependsOnComponentsCardProps {
variant?: InfoCardVariants;
title?: string;
tableOptions?: TableProps<ComponentEntity>['options'];
}
export function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {
const {
variant = 'gridItem',
title = 'Depends on components',
tableOptions = {},
} = props;
const { variant = 'gridItem', title = 'Depends on components' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -47,7 +42,6 @@ export function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {
emptyMessage="No component is a dependency of this component"
emptyHelpLink={componentEntityHelpLink}
asRenderableEntities={asComponentEntities}
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { RELATION_DEPENDS_ON, ResourceEntity } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_DEPENDS_ON } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asResourceEntities,
@@ -27,11 +27,10 @@ import {
/** @public */
export interface DependsOnResourcesCardProps {
variant?: InfoCardVariants;
tableOptions?: TableProps<ResourceEntity>['options'];
}
export function DependsOnResourcesCard(props: DependsOnResourcesCardProps) {
const { variant = 'gridItem', tableOptions = {} } = props;
const { variant = 'gridItem' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -42,7 +41,6 @@ export function DependsOnResourcesCard(props: DependsOnResourcesCardProps) {
emptyMessage="No resource is a dependency of this component"
emptyHelpLink={componentEntityHelpLink}
asRenderableEntities={asResourceEntities}
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { ComponentEntity, RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -27,11 +27,10 @@ import {
/** @public */
export interface HasComponentsCardProps {
variant?: InfoCardVariants;
tableOptions?: TableProps<ComponentEntity>['options'];
}
export function HasComponentsCard(props: HasComponentsCardProps) {
const { variant = 'gridItem', tableOptions = {} } = props;
const { variant = 'gridItem' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -42,7 +41,6 @@ export function HasComponentsCard(props: HasComponentsCardProps) {
emptyMessage="No component is part of this system"
emptyHelpLink={componentEntityHelpLink}
asRenderableEntities={asComponentEntities}
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { RELATION_HAS_PART, ResourceEntity } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asResourceEntities,
@@ -27,11 +27,10 @@ import {
/** @public */
export interface HasResourcesCardProps {
variant?: InfoCardVariants;
tableOptions?: TableProps<ResourceEntity>['options'];
}
export function HasResourcesCard(props: HasResourcesCardProps) {
const { variant = 'gridItem', tableOptions = {} } = props;
const { variant = 'gridItem' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -42,7 +41,6 @@ export function HasResourcesCard(props: HasResourcesCardProps) {
asRenderableEntities={asResourceEntities}
emptyMessage="No resource is part of this system"
emptyHelpLink={resourceEntityHelpLink}
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { ComponentEntity, RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -26,11 +26,10 @@ import {
/** @public */
export interface HasSubcomponentsCardProps {
variant?: InfoCardVariants;
tableOptions?: TableProps<ComponentEntity>['options'];
}
export function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {
const { variant = 'gridItem', tableOptions = {} } = props;
const { variant = 'gridItem' } = props;
return (
<RelatedEntitiesCard
variant={variant}
@@ -41,7 +40,6 @@ export function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {
asRenderableEntities={asComponentEntities}
emptyMessage="No subcomponent is part of this component"
emptyHelpLink="https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional"
tableOptions={tableOptions}
/>
);
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { RELATION_HAS_PART, SystemEntity } from '@backstage/catalog-model';
import { InfoCardVariants, TableProps } from '@backstage/core-components';
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asSystemEntities,
@@ -27,7 +27,6 @@ import {
/** @public */
export interface HasSystemsCardProps {
variant?: InfoCardVariants;
tableOptions?: TableProps<SystemEntity>['options'];
}
export function HasSystemsCard(props: HasSystemsCardProps) {
@@ -29,7 +29,6 @@ import {
Progress,
ResponseErrorPanel,
TableColumn,
TableProps,
} from '@backstage/core-components';
/** @public */
@@ -41,7 +40,6 @@ export type RelatedEntitiesCardProps<T extends Entity> = {
relationType: string;
emptyMessage: string;
emptyHelpLink: string;
tableOptions?: TableProps<T>['options'];
asRenderableEntities: (entities: Entity[]) => T[];
};
@@ -68,7 +66,6 @@ export function RelatedEntitiesCard<T extends Entity>(
relationType,
emptyMessage,
emptyHelpLink,
tableOptions = {},
asRenderableEntities,
} = props;
@@ -108,7 +105,6 @@ export function RelatedEntitiesCard<T extends Entity>(
}
columns={columns}
entities={asRenderableEntities(entities || [])}
tableOptions={tableOptions}
/>
);
}