-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataViews: extract search
from filters
#55722
Conversation
Size Change: -45 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
import { ViewGrid } from './view-grid'; | ||
|
||
export default function DataViews( { | ||
view, | ||
onChangeView, | ||
fields, | ||
filters, | ||
search = true, | ||
searchLabel = undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we need to have these props to start with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are actions consumers may need to do. Happy to remove them if you rather don't allow them for now.
@@ -10,12 +10,12 @@ import { SearchControl } from '@wordpress/components'; | |||
*/ | |||
import useDebouncedInput from '../../utils/use-debounced-input'; | |||
|
|||
export default function TextFilter( { filter, view, onChangeView } ) { | |||
export default function TextFilter( { label, view, onChangeView } ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be renamed Search
or something like that as it's not generic anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, though didn't want to do it in this PR to make reviews easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments but otherwise looks good to me.
Going to go ahead and merge as I have work that depends on this. These can be follow-ups. |
Part of #55083
Follow up to #55475 (comment)
What?
So far, the text
search
feature had been modeled as another filter. This PR extract it and makes it standalone.Testing Instructions