Remove columns from cards where it's duplicate information
Resolves #4553 Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-api-docs': patch
|
||||
'@backstage/plugin-catalog': patch
|
||||
---
|
||||
|
||||
Remove domain column from `HasSystemsCard` and system from `HasComponentsCard`,
|
||||
`HasSubcomponentsCard`, and `HasApisCard`.
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
InfoCard,
|
||||
Link,
|
||||
Progress,
|
||||
TableColumn,
|
||||
WarningPanel,
|
||||
} from '@backstage/core';
|
||||
import {
|
||||
@@ -28,12 +29,20 @@ import {
|
||||
useRelatedEntities,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import React from 'react';
|
||||
import { apiEntityColumns } from './presets';
|
||||
import { createSpecApiTypeColumn } from './presets';
|
||||
|
||||
type Props = {
|
||||
variant?: 'gridItem';
|
||||
};
|
||||
|
||||
const columns: TableColumn<ApiEntity>[] = [
|
||||
EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),
|
||||
EntityTable.columns.createOwnerColumn(),
|
||||
EntityTable.columns.createSpecLifecycleColumn(),
|
||||
createSpecApiTypeColumn(),
|
||||
EntityTable.columns.createMetadataDescriptionColumn(),
|
||||
];
|
||||
|
||||
export const HasApisCard = ({ variant = 'gridItem' }: Props) => {
|
||||
const { entity } = useEntity();
|
||||
const { entities, loading, error } = useRelatedEntities(entity, {
|
||||
@@ -73,7 +82,7 @@ export const HasApisCard = ({ variant = 'gridItem' }: Props) => {
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
columns={apiEntityColumns}
|
||||
columns={columns}
|
||||
entities={entities as ApiEntity[]}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -33,6 +33,14 @@ type Props = {
|
||||
variant?: 'gridItem';
|
||||
};
|
||||
|
||||
const columns = [
|
||||
EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),
|
||||
EntityTable.columns.createOwnerColumn(),
|
||||
EntityTable.columns.createSpecTypeColumn(),
|
||||
EntityTable.columns.createSpecLifecycleColumn(),
|
||||
EntityTable.columns.createMetadataDescriptionColumn(),
|
||||
];
|
||||
|
||||
export const HasComponentsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
const { entity } = useEntity();
|
||||
const { entities, loading, error } = useRelatedEntities(entity, {
|
||||
@@ -72,7 +80,7 @@ export const HasComponentsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
columns={EntityTable.componentEntityColumns}
|
||||
columns={columns}
|
||||
entities={entities as ComponentEntity[]}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -33,6 +33,14 @@ type Props = {
|
||||
variant?: 'gridItem';
|
||||
};
|
||||
|
||||
const columns = [
|
||||
EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),
|
||||
EntityTable.columns.createOwnerColumn(),
|
||||
EntityTable.columns.createSpecTypeColumn(),
|
||||
EntityTable.columns.createSpecLifecycleColumn(),
|
||||
EntityTable.columns.createMetadataDescriptionColumn(),
|
||||
];
|
||||
|
||||
export const HasSubcomponentsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
const { entity } = useEntity();
|
||||
const { entities, loading, error } = useRelatedEntities(entity, {
|
||||
@@ -72,7 +80,7 @@ export const HasSubcomponentsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
columns={EntityTable.componentEntityColumns}
|
||||
columns={columns}
|
||||
entities={entities as ComponentEntity[]}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -33,6 +33,12 @@ type Props = {
|
||||
variant?: 'gridItem';
|
||||
};
|
||||
|
||||
const columns = [
|
||||
EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),
|
||||
EntityTable.columns.createOwnerColumn(),
|
||||
EntityTable.columns.createMetadataDescriptionColumn(),
|
||||
];
|
||||
|
||||
export const HasSystemsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
const { entity } = useEntity();
|
||||
const { entities, loading, error } = useRelatedEntities(entity, {
|
||||
@@ -71,7 +77,7 @@ export const HasSystemsCard = ({ variant = 'gridItem' }: Props) => {
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
columns={EntityTable.systemEntityColumns}
|
||||
columns={columns}
|
||||
entities={entities as SystemEntity[]}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user