-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cross_cluster_search
- Loading branch information
Showing
68 changed files
with
1,430 additions
and
561 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "globalSearchProviders", | ||
"version": "8.0.0", | ||
"kibanaVersion": "kibana", | ||
"server": false, | ||
"ui": true, | ||
"requiredPlugins": ["globalSearch"], | ||
"optionalPlugins": [], | ||
"configPath": ["xpack", "global_search_providers"] | ||
} |
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 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { PluginInitializer } from 'src/core/public'; | ||
import { GlobalSearchProvidersPlugin, GlobalSearchProvidersPluginSetupDeps } from './plugin'; | ||
|
||
export const plugin: PluginInitializer<{}, {}, GlobalSearchProvidersPluginSetupDeps, {}> = () => | ||
new GlobalSearchProvidersPlugin(); |
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/global_search_providers/public/plugin.test.ts
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,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { coreMock } from '../../../../src/core/public/mocks'; | ||
import { globalSearchPluginMock } from '../../global_search/public/mocks'; | ||
import { GlobalSearchProvidersPlugin } from './plugin'; | ||
|
||
describe('GlobalSearchProvidersPlugin', () => { | ||
let plugin: GlobalSearchProvidersPlugin; | ||
let globalSearchSetup: ReturnType<typeof globalSearchPluginMock.createSetupContract>; | ||
|
||
beforeEach(() => { | ||
globalSearchSetup = globalSearchPluginMock.createSetupContract(); | ||
plugin = new GlobalSearchProvidersPlugin(); | ||
}); | ||
|
||
describe('#setup', () => { | ||
it('registers the `application` result provider', () => { | ||
const coreSetup = coreMock.createSetup(); | ||
plugin.setup(coreSetup, { globalSearch: globalSearchSetup }); | ||
|
||
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledTimes(1); | ||
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
id: 'application', | ||
}) | ||
); | ||
}); | ||
}); | ||
}); |
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,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { CoreSetup, Plugin } from 'src/core/public'; | ||
import { GlobalSearchPluginSetup } from '../../global_search/public'; | ||
import { createApplicationResultProvider } from './providers'; | ||
|
||
export interface GlobalSearchProvidersPluginSetupDeps { | ||
globalSearch: GlobalSearchPluginSetup; | ||
} | ||
|
||
export class GlobalSearchProvidersPlugin | ||
implements Plugin<{}, {}, GlobalSearchProvidersPluginSetupDeps, {}> { | ||
setup( | ||
{ getStartServices }: CoreSetup<{}, {}>, | ||
{ globalSearch }: GlobalSearchProvidersPluginSetupDeps | ||
) { | ||
const applicationPromise = getStartServices().then(([core]) => core.application); | ||
globalSearch.registerResultProvider(createApplicationResultProvider(applicationPromise)); | ||
return {}; | ||
} | ||
|
||
start() { | ||
return {}; | ||
} | ||
} |
Oops, something went wrong.