Merge pull request #25225 from CptnFizzbin/tech-docs-search-by-title
fix: Allow for searching TechDocs by Title
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>;
|
||||
|
||||
@@ -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