-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[esaggs][inspector]: Refactor to prep for esaggs move to server. #83199
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
294a960
Split esaggs and request handler.
lukeelmers 2d22686
Add inspector TabularData typings.
lukeelmers 6b3dc60
Refactor esaggs & courier request handler.
lukeelmers b9cedf9
Improve inspector adapter typings.
lukeelmers c9bfc2f
Extract esaggs start dependencies.
lukeelmers 6e7ff36
Remove service getters which are no longer used.
lukeelmers a35018f
Update generated docs.
lukeelmers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...gins/embeddable/public/kibana-plugin-plugins-embeddable-public.adapters.data.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [Adapters](./kibana-plugin-plugins-embeddable-public.adapters.md) > [data](./kibana-plugin-plugins-embeddable-public.adapters.data.md) | ||
|
||
## Adapters.data property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
data?: DataAdapter; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../embeddable/public/kibana-plugin-plugins-embeddable-public.adapters.requests.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [Adapters](./kibana-plugin-plugins-embeddable-public.adapters.md) > [requests](./kibana-plugin-plugins-embeddable-public.adapters.requests.md) | ||
|
||
## Adapters.requests property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
requests?: RequestAdapter; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,16 +41,14 @@ import { | |
UiSettingsPublicToCommon, | ||
} from './index_patterns'; | ||
import { | ||
setFieldFormats, | ||
setIndexPatterns, | ||
setNotifications, | ||
setOverlays, | ||
setQueryService, | ||
setSearchService, | ||
setUiSettings, | ||
} from './services'; | ||
import { createSearchBar } from './ui/search_bar/create_search_bar'; | ||
import { esaggs } from './search/expressions'; | ||
import { getEsaggs } from './search/expressions'; | ||
import { | ||
SELECT_RANGE_TRIGGER, | ||
VALUE_CLICK_TRIGGER, | ||
|
@@ -111,8 +109,22 @@ export class DataPublicPlugin | |
): DataPublicPluginSetup { | ||
const startServices = createStartServicesGetter(core.getStartServices); | ||
|
||
expressions.registerFunction(esaggs); | ||
expressions.registerFunction(indexPatternLoad); | ||
expressions.registerFunction( | ||
getEsaggs({ | ||
getStartDependencies: async () => { | ||
const [, , self] = await core.getStartServices(); | ||
const { fieldFormats, indexPatterns, query, search } = self; | ||
return { | ||
addFilters: query.filterManager.addFilters.bind(query.filterManager), | ||
aggs: search.aggs, | ||
deserializeFieldFormat: fieldFormats.deserialize.bind(fieldFormats), | ||
indexPatterns, | ||
searchSource: search.searchSource, | ||
}; | ||
}, | ||
Comment on lines
+115
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these service dependencies are now wired up in the top-level Some of these dependencies may also be adjusted when we clean up the esaggs index patterns & aggs args in a follow up PR. |
||
}) | ||
); | ||
|
||
this.usageCollection = usageCollection; | ||
|
||
|
@@ -145,7 +157,7 @@ export class DataPublicPlugin | |
}); | ||
|
||
return { | ||
autocomplete: this.autocomplete.setup(core), | ||
autocomplete: this.autocomplete.setup(core, { timefilter: queryService.timefilter }), | ||
search: searchService, | ||
fieldFormats: this.fieldFormatsService.setup(core), | ||
query: queryService, | ||
|
@@ -162,7 +174,6 @@ export class DataPublicPlugin | |
setUiSettings(uiSettings); | ||
|
||
const fieldFormats = this.fieldFormatsService.start(); | ||
setFieldFormats(fieldFormats); | ||
|
||
const indexPatterns = new IndexPatternsService({ | ||
uiSettings: new UiSettingsPublicToCommon(uiSettings), | ||
|
@@ -186,7 +197,6 @@ export class DataPublicPlugin | |
savedObjectsClient: savedObjects.client, | ||
uiSettings, | ||
}); | ||
setQueryService(query); | ||
|
||
const search = this.searchService.start(core, { fieldFormats, indexPatterns }); | ||
setSearchService(search); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
When I removed the
getQueryService
service getter, I realized it was still being used here. Rather than revert the change, I simply updated theautocomplete
service since it was a straightforward fix.