-
Notifications
You must be signed in to change notification settings - Fork 843
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
Provide tools to search bar as nodes #458
Conversation
2561c67
to
878f740
Compare
I like the flexibility that passing in actions as nodes provides. This gives the table consumer a lot of control and future proofs the component for future use cases. |
@@ -105,6 +106,22 @@ export class SearchBar extends Component { | |||
this.setState(prevState => ({ incremental: !prevState.incremental })); | |||
}; | |||
|
|||
renderToolsLeft() { | |||
return null; |
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.
2 returns in method. Second return that renders node never gets used
Can you paste an example snippet in the description (so you can compare)? Flexibility comes in different shapes any forms... But I'll wait for the snippet |
I'll let @cjcenizal clarify exactly, but I think the discussion is around:
is less expressive than:
With the general spirit being that we can create expressive UIs through React componentry and that expressiveness leads to better clarity, rather than potentially needing to infer meaning based on config property names (obviously, React component props can suffer from this too, so it's not perfect). Like in this example, I actually wasn't clear on what |
Thanks @chrisronline, I couldn't have put it nearly as well as you just did. |
878f740
to
083ae96
Compare
Is this still an experiment or can it be merged? |
@nreese I'd like to update a couple other examples and add some tests and I then I think it will be ready for a final review & merge. |
a55420b
to
f21d167
Compare
@bmcconaghy @jen-huang @chrisronline @nreese Well, turns out I just needed to add a test. This is ready for review. @uboness mentioned lingering concerns about the necessary boilerplate. The only boilerplate I can see that we need is the check against |
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.
lgtm
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.
LGTM
4e67ba2
to
20d4873
Compare
@cjcenizal where is the comparison your referring to? am I missing something? (we said we're going to have a comprehensive example and compare). |
ah... I see it now... yea... that's a boilerplate I'd rather avoid... I'll take this:
over this:
any day of the week. And... you now need to track selection state yet again... more boilerplate... but... seems like kibana likes to boilerplate... 🤷♂️... do whatever you think is right |
Thanks @uboness. We're going to try the approach of passing in nodes first. If the boilerplate proves to be too burdensome then it will be good that we have your config-based approach to fall back to. |
Let's compare and contrast this with the config-object-based approach of #452: