-
Notifications
You must be signed in to change notification settings - Fork 8.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
Implement saved queries and filters #39140
Conversation
SavedQueryRow component
when the passed in props have changed from the previous props.
💔 Build Failed |
💚 Build Succeeded |
@@ -19,7 +19,7 @@ | |||
|
|||
import { EuiIcon } from '@elastic/eui'; | |||
import classNames from 'classnames'; | |||
import React, { SFC } from 'react'; | |||
import React, { FunctionComponent } from 'react'; |
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.
Just FYI, in case you weren't aware of it so far (if so ignore me): FunctionComponent
has also a version (like SFC
beforehand) just called FC
for people who don't like typing ;-)
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.
Tested on Chrome Linux, seems to work as expected. I've left a couple of minor code suggestions and nitpicks.
There is only one thing that I am wondering about: We discussed earlier some future enhancement, of being able to use saved queries as part of another query, by using a syntax like: #savedQuery and something:else
. We currently allow whitespace characters in the name for the saved query which makes this parsing a bit trickier, or basically we would need another syntax like #{saved query} and something: else
, since we otherwise have a hard time figuring out which spaces belong to the name and not. Is this something we should already consider now? I especially came across that, since we currently don't trim trailing/leading spaces, so you can have saved queries named "test", "test ", and "test " all at the same time, though this doesn't really make the scenario above more difficult then allowing spaces at all in the query name.
src/legacy/plugin_discovery/plugin_spec/plugin_spec_options.d.ts
Outdated
Show resolved
Hide resolved
..._plugins/data/public/search/search_bar/components/saved_query_management/save_query_form.tsx
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
@timroes names with whitespace in them are actually easy to handle in KQL because we require explicit |
…akes nested ternary more explicit in the SaveQueryForm
💚 Build Succeeded |
Introduces "saved queries". Saved queries are a new saved object type similar to saved searches but more limited in scope. They allow users to store the the query string in the query bar and optionally the set of filters and timefilter in order to reload them anywhere a query is expected: Discover, Visualize, Dashboard, anywhere that uses our full SearchBar component.
Introduces "saved queries". Saved queries are a new saved object type similar to saved searches but more limited in scope. They allow users to store the the query string in the query bar and optionally the set of filters and timefilter in order to reload them anywhere a query is expected: Discover, Visualize, Dashboard, anywhere that uses our full SearchBar component.
Summary
This PR introduces "saved queries". Saved queries are a new saved object type similar to saved searches but more limited in scope. They allow users to store the the query string in the query bar and optionally the set of filters and timefilter in order to reload them anywhere a query is expected: Discover, Visualize, Dashboard, anywhere that uses our full SearchBar component.
TODO
not implementing, decided to keep saved query UI contained in popover
- [ ] Support partial matches on saved query names in the autocomplete- [ ] Make a decision on how to handle saved queries where the full search bar is not used- [ ] Accessibility: ensure all functionality inside the autocomplete’s saved query row is mirrored in “manage” popover- [ ] Accessibility: try to make the saved query row in autocomplete tabable- [ ] Implement dirty state indicator and quick save in the right hand side of the query bar input- [ ] Saved queries not loading in filters aggChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers