-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Search Sessions] Search session example app #89583
[Search Sessions] Search session example app #89583
Conversation
…arch-session-example
…arch-session-example
@@ -4,7 +4,7 @@ | |||
"kibanaVersion": "kibana", | |||
"server": true, | |||
"ui": true, | |||
"requiredPlugins": ["navigation", "data", "developerExamples", "kibanaUtils"], | |||
"requiredPlugins": ["navigation", "data", "developerExamples", "kibanaUtils", "share"], |
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.
share is needed for URL generator to get back to search session
import { SearchSessionsExampleApp } from './search_sessions/app'; | ||
import { RedirectAppLinks } from '../../../src/plugins/kibana_react/public'; | ||
|
||
const LINKS: ExampleLink[] = [ |
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.
Needed to introduce some kind of sub-routes for more examples
@@ -51,9 +53,28 @@ export class SearchExamplesPlugin | |||
developerExamples.register({ | |||
appId: 'searchExamples', | |||
title: 'Search Examples', | |||
description: `Search Examples`, | |||
description: `Examples on searching elasticsearch using data plugin: low-level search client (data.search.search), high-level search client (SearchSource), search sessions (data.search.sessions)`, |
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 improving with nicer description, image, and readme.
@@ -0,0 +1,433 @@ | |||
/* |
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.
MOVED THIS.
Didn't change the older example
@@ -80,8 +80,8 @@ export class QueryService { | |||
savedQueries: createSavedQueryService(savedObjectsClient), | |||
state$: this.state$, | |||
timefilter: this.timefilter, | |||
getEsQuery: (indexPattern: IndexPattern) => { | |||
const timeFilter = this.timefilter.timefilter.createFilter(indexPattern); | |||
getEsQuery: (indexPattern: IndexPattern, timeRange?: TimeRange) => { |
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.
Added additional parameter (createFilter
already had 2nd optional argument).
It was convenient to use this in an example
): Record<string, unknown> { | ||
const query = parseUrlHash(url)?.query; | ||
keys?: Array<keyof State>, | ||
{ getFromHashQuery = true }: { getFromHashQuery: boolean } = { getFromHashQuery: true } |
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.
Needed to extend the functionality of this helper because the example plugin doesn't use hash routing and stores state not inside the hash part of the URL but inside of the location.search
instead
setStateToKbnURL
already had this param in place
}: SearchSessionIndicatorDeps): React.FC => { | ||
const searchSessionsManagementUrl = basePath.prepend('/app/management/kibana/search_sessions'); |
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.
Noticed a bug that wasn't visible in discover/dashboard.
Pinging @elastic/kibana-app-services (Team:AppServices) |
jpg is not supported in dev env. didn’t want to change configs
…arch-session-example
…arch-session-example
fef8f2f
to
828a90b
Compare
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment 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.
Tested and I love the way the example works.
One UX nit: I'm not a huge fan of the list items appearing as you interact with them.
Maybe instead they should be disabled as long as previous steps were not completed?
@lizozom, I agree that having new steps appearing out of nowhere is not the best UX, but I also think that having all steps out there and just disabling buttons wouldn't be enough. I am thinking of some content-overlays on top of "disabled" states which would help to focus attention on the current step. But not sure it worth spending more time on this. I think currently it is pretty good. |
Summary
Adds a search session developer example plugin.
Following the demo application you will:
Step 1. Configure the Query
Step 2. Start a search
Step 3. Save a session (you can do this while the search is still running or when it is finished)
Step 4. Restore a session
Step 5-6. Navigate to management and then navigate back from there to restore a session
demo-search-sessions.mov
I have a functional test separately #92133 it needs some infra/ops changes to make it work (we can't run example tests with x-pack yet)