Merge pull request #25225 from CptnFizzbin/tech-docs-search-by-title
fix: Allow for searching TechDocs by Title
This commit is contained in:
@@ -52,6 +52,7 @@ export type DocsTableProps = {
|
||||
};
|
||||
|
||||
const defaultColumns: TableColumn<DocsTableRow>[] = [
|
||||
columnFactories.createTitleColumn({ hidden: true }),
|
||||
columnFactories.createNameColumn(),
|
||||
columnFactories.createOwnerColumn(),
|
||||
columnFactories.createKindColumn(),
|
||||
|
||||
@@ -30,11 +30,20 @@ function customTitle(entity: Entity): string {
|
||||
* @public
|
||||
*/
|
||||
export const columnFactories = {
|
||||
createTitleColumn(options?: { hidden?: boolean }): TableColumn<DocsTableRow> {
|
||||
const nameCol = columnFactories.createNameColumn();
|
||||
return {
|
||||
...nameCol,
|
||||
field: 'entity.metadata.title',
|
||||
hidden: options?.hidden,
|
||||
};
|
||||
},
|
||||
createNameColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
title: 'Document',
|
||||
field: 'entity.metadata.name',
|
||||
highlight: true,
|
||||
searchable: true,
|
||||
defaultSort: 'asc',
|
||||
customSort: (row1, row2) => {
|
||||
const title1 = customTitle(row1.entity).toLocaleLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user