-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.x' into backport/7.x/pr-67707
- Loading branch information
Showing
138 changed files
with
4,007 additions
and
1,227 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
66 changes: 0 additions & 66 deletions
66
packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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,20 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export { searchSavedObjectType } from './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
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
38 changes: 38 additions & 0 deletions
38
x-pack/plugins/global_search/server/services/context.mock.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,38 @@ | ||
/* | ||
* 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 { | ||
savedObjectsTypeRegistryMock, | ||
savedObjectsClientMock, | ||
elasticsearchServiceMock, | ||
uiSettingsServiceMock, | ||
} from '../../../../../src/core/server/mocks'; | ||
|
||
const createContextMock = () => { | ||
return { | ||
core: { | ||
savedObjects: { | ||
client: savedObjectsClientMock.create(), | ||
typeRegistry: savedObjectsTypeRegistryMock.create(), | ||
}, | ||
elasticsearch: { | ||
legacy: { | ||
client: elasticsearchServiceMock.createScopedClusterClient(), | ||
}, | ||
}, | ||
uiSettings: { | ||
client: uiSettingsServiceMock.createClient(), | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
const createFactoryMock = () => () => () => createContextMock(); | ||
|
||
export const contextMock = { | ||
create: createContextMock, | ||
createFactory: createFactoryMock, | ||
}; |
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,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/server'; | ||
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/server/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/server/mocks'; | ||
import { globalSearchPluginMock } from '../../global_search/server/mocks'; | ||
import { GlobalSearchProvidersPlugin } from './plugin'; | ||
|
||
describe('GlobalSearchProvidersPlugin', () => { | ||
let plugin: GlobalSearchProvidersPlugin; | ||
let globalSearchSetup: ReturnType<typeof globalSearchPluginMock.createSetupContract>; | ||
|
||
beforeEach(() => { | ||
plugin = new GlobalSearchProvidersPlugin(); | ||
globalSearchSetup = globalSearchPluginMock.createSetupContract(); | ||
}); | ||
|
||
describe('#setup', () => { | ||
it('registers the `savedObjects` result provider', () => { | ||
const coreSetup = coreMock.createSetup(); | ||
plugin.setup(coreSetup, { globalSearch: globalSearchSetup }); | ||
|
||
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledTimes(1); | ||
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
id: 'savedObjects', | ||
}) | ||
); | ||
}); | ||
}); | ||
}); |
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,28 @@ | ||
/* | ||
* 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/server'; | ||
import { GlobalSearchPluginSetup } from '../../global_search/server'; | ||
import { createSavedObjectsResultProvider } from './providers'; | ||
|
||
export interface GlobalSearchProvidersPluginSetupDeps { | ||
globalSearch: GlobalSearchPluginSetup; | ||
} | ||
|
||
export class GlobalSearchProvidersPlugin | ||
implements Plugin<{}, {}, GlobalSearchProvidersPluginSetupDeps, {}> { | ||
setup( | ||
{ getStartServices }: CoreSetup<{}, {}>, | ||
{ globalSearch }: GlobalSearchProvidersPluginSetupDeps | ||
) { | ||
globalSearch.registerResultProvider(createSavedObjectsResultProvider()); | ||
return {}; | ||
} | ||
|
||
start() { | ||
return {}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/global_search_providers/server/providers/index.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,7 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { createSavedObjectsResultProvider } from './saved_objects'; |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/global_search_providers/server/providers/saved_objects/index.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,7 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { createSavedObjectsResultProvider } from './provider'; |
Oops, something went wrong.