refactor(api-docs): move type filter and remove api: prefix from names
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': patch
|
||||
---
|
||||
|
||||
Allow `defaultKind` from `CatalogTable.column.creatNameColumn` to be configurable
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-api-docs': patch
|
||||
---
|
||||
|
||||
Move `EntityTypePicker` to be consistent with `CatalogPage` and remove `api:` prefix from entity names
|
||||
@@ -47,6 +47,16 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
const defaultColumns: TableColumn<CatalogTableRow>[] = [
|
||||
CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),
|
||||
CatalogTable.columns.createSystemColumn(),
|
||||
CatalogTable.columns.createOwnerColumn(),
|
||||
CatalogTable.columns.createSpecTypeColumn(),
|
||||
CatalogTable.columns.createSpecLifecycleColumn(),
|
||||
CatalogTable.columns.createMetadataDescriptionColumn(),
|
||||
CatalogTable.columns.createTagsColumn(),
|
||||
];
|
||||
|
||||
export type ApiExplorerPageProps = {
|
||||
initiallySelectedFilter?: UserListFilterKind;
|
||||
columns?: TableColumn<CatalogTableRow>[];
|
||||
@@ -79,13 +89,13 @@ export const ApiExplorerPage = ({
|
||||
<EntityListProvider>
|
||||
<div>
|
||||
<EntityKindPicker initialFilter="api" hidden />
|
||||
<UserListPicker initialFilter={initiallySelectedFilter} />
|
||||
<EntityTypePicker />
|
||||
<UserListPicker initialFilter={initiallySelectedFilter} />
|
||||
<EntityOwnerPicker />
|
||||
<EntityLifecyclePicker />
|
||||
<EntityTagPicker />
|
||||
</div>
|
||||
<CatalogTable columns={columns} />
|
||||
<CatalogTable columns={columns || defaultColumns} />
|
||||
</EntityListProvider>
|
||||
</div>
|
||||
</Content>
|
||||
|
||||
@@ -19,13 +19,22 @@ import { OverflowTooltip, TableColumn } from '@backstage/core';
|
||||
import { Chip } from '@material-ui/core';
|
||||
import { EntityRow } from './types';
|
||||
|
||||
export function createNameColumn(): TableColumn<EntityRow> {
|
||||
type NameColumnProps = {
|
||||
defaultKind?: string;
|
||||
};
|
||||
|
||||
export function createNameColumn(
|
||||
props?: NameColumnProps,
|
||||
): TableColumn<EntityRow> {
|
||||
return {
|
||||
title: 'Name',
|
||||
field: 'resolved.name',
|
||||
highlight: true,
|
||||
render: ({ entity }) => (
|
||||
<EntityRefLink entityRef={entity} defaultKind="Component" />
|
||||
<EntityRefLink
|
||||
entityRef={entity}
|
||||
defaultKind={props?.defaultKind || 'Component'}
|
||||
/>
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user