revert changes to match prior work in CatalogTable
Signed-off-by: Stephen A. Wilson <code@stephenawilson.ca>
This commit is contained in:
@@ -78,6 +78,13 @@ export type DocsGroupConfig = {
|
||||
export const DocsTable: {
|
||||
(props: DocsTableProps): React_2.JSX.Element | null;
|
||||
columns: {
|
||||
createTitleColumn(
|
||||
options?:
|
||||
| {
|
||||
hidden?: boolean | undefined;
|
||||
}
|
||||
| undefined,
|
||||
): TableColumn<DocsTableRow>;
|
||||
createNameColumn(): TableColumn<DocsTableRow>;
|
||||
createOwnerColumn(): TableColumn<DocsTableRow>;
|
||||
createKindColumn(): TableColumn<DocsTableRow>;
|
||||
@@ -142,6 +149,13 @@ export type EntityListDocsGridPageProps = {
|
||||
export const EntityListDocsTable: {
|
||||
(props: EntityListDocsTableProps): React_2.JSX.Element;
|
||||
columns: {
|
||||
createTitleColumn(
|
||||
options?:
|
||||
| {
|
||||
hidden?: boolean | undefined;
|
||||
}
|
||||
| undefined,
|
||||
): TableColumn<DocsTableRow>;
|
||||
createNameColumn(): TableColumn<DocsTableRow>;
|
||||
createOwnerColumn(): TableColumn<DocsTableRow>;
|
||||
createKindColumn(): TableColumn<DocsTableRow>;
|
||||
|
||||
@@ -24,18 +24,17 @@ function customTitle(entity: Entity): string {
|
||||
return entity.metadata.title || entity.metadata.name;
|
||||
}
|
||||
|
||||
type ColumnOptions = Partial<TableColumn<DocsTableRow>>;
|
||||
|
||||
/**
|
||||
* Not directly exported, but through DocsTable.columns and EntityListDocsTable.columns
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const columnFactories = {
|
||||
createTitleColumn(overrides: ColumnOptions = {}): TableColumn<DocsTableRow> {
|
||||
createTitleColumn(options?: { hidden?: boolean }): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Document',
|
||||
field: 'entity.metadata.title',
|
||||
hidden: options?.hidden,
|
||||
highlight: true,
|
||||
searchable: true,
|
||||
render: (row: DocsTableRow) => (
|
||||
@@ -46,10 +45,9 @@ export const columnFactories = {
|
||||
subvalue={row.entity.metadata.description}
|
||||
/>
|
||||
),
|
||||
...overrides,
|
||||
};
|
||||
},
|
||||
createNameColumn(overrides: ColumnOptions = {}): TableColumn<DocsTableRow> {
|
||||
createNameColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Document',
|
||||
field: 'entity.metadata.name',
|
||||
@@ -63,10 +61,9 @@ export const columnFactories = {
|
||||
subvalue={row.entity.metadata.description}
|
||||
/>
|
||||
),
|
||||
...overrides,
|
||||
};
|
||||
},
|
||||
createOwnerColumn(overrides: ColumnOptions = {}): TableColumn<DocsTableRow> {
|
||||
createOwnerColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Owner',
|
||||
field: 'resolved.ownedByRelationsTitle',
|
||||
@@ -76,21 +73,18 @@ export const columnFactories = {
|
||||
defaultKind="group"
|
||||
/>
|
||||
),
|
||||
...overrides,
|
||||
};
|
||||
},
|
||||
createKindColumn(overrides: ColumnOptions = {}): TableColumn<DocsTableRow> {
|
||||
createKindColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Kind',
|
||||
field: 'entity.kind',
|
||||
...overrides,
|
||||
};
|
||||
},
|
||||
createTypeColumn(overrides: ColumnOptions = {}): TableColumn<DocsTableRow> {
|
||||
createTypeColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Type',
|
||||
field: 'entity.spec.type',
|
||||
...overrides,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user