Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Discover-next] Add query editor extensions #7034
[Discover-next] Add query editor extensions #7034
Changes from all commits
71bba11
d90734a
08a81e0
5b2ad95
84a2013
e798287
8b0af9d
edb0390
886ace5
7f0e39e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 12 in src/plugins/data/public/ui/query_editor/query_editor_extensions/index.tsx
Codecov / codecov/patch
src/plugins/data/public/ui/query_editor/query_editor_extensions/index.tsx#L12
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.
nit: use braces even for single line if statements
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.
i think this would be a good linter rule. I personally prefer one line if-returns, but i agree using braces is a better practice
i'll create an issue to track this and enable eslint curly, without linter there might be missed ones or mistakes
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.
q: is there a reason this has to be a map vs an array?
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.
consistency with existing code, see #7034 (comment)
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.
nit: is there a better name for this given its both a collection of extensions as well as specifying their destinations (and its easy to confuse components that are one character apart). perhaps its a manager as its responsibilities could include managing what gets rendered if we want more rules than rendering everything
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.
maybe
QueryEditorExtensionManager
andQueryEditorExtension
? but I'm not very sure if a manager is something that should be rendered on the page, current impl needsQueryEditor
to renderQueryEditorExtensions
. The one character naming existed in other places, likesuggestion_component
andsuggestions_component
, although i do find it to be confusingThere 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.
Object.keys
will either return an array or throw.![]
is false always. If this was meant to prevent wasting time on an empty object, it fails to do that.This will need linting though.
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.
thanks good point on
.length === 0
, i missed thatis the object check necessary or conventional in OSD?