Skip to content

Commit

Permalink
Rename global search field config
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Mar 21, 2024
1 parent 8cf63f6 commit 982ddff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/dataviews/src/filter-and-sort-data-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function filterAndSortDataView( data, view, fields ) {
const normalizedSearch = normalizeSearchInput( view.search );
filteredData = filteredData.filter( ( item ) => {
return _fields
.filter( ( field ) => field.isSearchField )
.filter( ( field ) => field.enableGlobalSearch )
.map( ( field ) => {
return normalizeSearchInput( field.getValue( { item } ) );
} )
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/stories/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const fields = [
id: 'title',
maxWidth: 400,
enableHiding: false,
isSearchField: true,
enableGlobalSearch: true,
},
{
header: 'Type',
Expand All @@ -184,7 +184,7 @@ export const fields = [
id: 'description',
maxWidth: 200,
enableSorting: false,
isSearchField: true,
enableGlobalSearch: true,
},
{
header: 'Categories',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
),
maxWidth: 400,
enableHiding: false,
isSearchField: true,
enableGlobalSearch: true,
},
];
if ( postType === TEMPLATE_POST_TYPE ) {
Expand Down Expand Up @@ -315,7 +315,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
maxWidth: 400,
minWidth: 320,
enableSorting: false,
isSearchField: true,
enableGlobalSearch: true,
} );
}
// TODO: The plan is to support fields reordering, which would require an API like `order` or something
Expand Down

0 comments on commit 982ddff

Please sign in to comment.