Skip to content

Commit 800e441

Browse files
Merge branch '7.x' into backport/7.x/pr-70413
2 parents 4a5eda0 + 1dd665e commit 800e441

38 files changed

Lines changed: 1770 additions & 120 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ Summarize your PR. If it involves visual changes include a screenshot or gif.
44

55
### Checklist
66

7-
Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.
7+
Delete any items that are not applicable to this PR.
88

9-
- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
109
- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
1110
- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
1211
- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
1312
- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)
13+
- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)
14+
- [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
1415

1516
### For maintainers
1617

1718
- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
18-
- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
19-

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
121121
"@babel/register": "^7.10.1",
122122
"@elastic/apm-rum": "^5.2.0",
123-
"@elastic/charts": "19.6.3",
123+
"@elastic/charts": "19.7.0",
124124
"@elastic/datemath": "5.0.3",
125125
"@elastic/ems-client": "7.9.3",
126126
"@elastic/eui": "24.1.0",

packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap

Lines changed: 0 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/kbn-ui-shared-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"kbn:watch": "node scripts/build --dev --watch"
1010
},
1111
"dependencies": {
12-
"@elastic/charts": "19.6.3",
12+
"@elastic/charts": "19.7.0",
1313
"@elastic/eui": "24.1.0",
1414
"@elastic/numeral": "^2.5.0",
1515
"@kbn/i18n": "1.0.0",

x-pack/plugins/global_search/server/mocks.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
RouteHandlerGlobalSearchContext,
1212
} from './types';
1313
import { searchServiceMock } from './services/search_service.mock';
14+
import { contextMock } from './services/context.mock';
1415

1516
const createSetupMock = (): jest.Mocked<GlobalSearchPluginSetup> => {
1617
const searchMock = searchServiceMock.createSetupContract();
@@ -29,17 +30,18 @@ const createStartMock = (): jest.Mocked<GlobalSearchPluginStart> => {
2930
};
3031

3132
const createRouteHandlerContextMock = (): jest.Mocked<RouteHandlerGlobalSearchContext> => {
32-
const contextMock = {
33+
const handlerContextMock = {
3334
find: jest.fn(),
3435
};
3536

36-
contextMock.find.mockReturnValue(of([]));
37+
handlerContextMock.find.mockReturnValue(of([]));
3738

38-
return contextMock;
39+
return handlerContextMock;
3940
};
4041

4142
export const globalSearchPluginMock = {
4243
createSetupContract: createSetupMock,
4344
createStartContract: createStartMock,
4445
createRouteHandlerContext: createRouteHandlerContextMock,
46+
createProviderContext: contextMock.create,
4547
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import {
8+
savedObjectsTypeRegistryMock,
9+
savedObjectsClientMock,
10+
elasticsearchServiceMock,
11+
uiSettingsServiceMock,
12+
} from '../../../../../src/core/server/mocks';
13+
14+
const createContextMock = () => {
15+
return {
16+
core: {
17+
savedObjects: {
18+
client: savedObjectsClientMock.create(),
19+
typeRegistry: savedObjectsTypeRegistryMock.create(),
20+
},
21+
elasticsearch: {
22+
legacy: {
23+
client: elasticsearchServiceMock.createScopedClusterClient(),
24+
},
25+
},
26+
uiSettings: {
27+
client: uiSettingsServiceMock.createClient(),
28+
},
29+
},
30+
};
31+
};
32+
33+
const createFactoryMock = () => () => () => createContextMock();
34+
35+
export const contextMock = {
36+
create: createContextMock,
37+
createFactory: createFactoryMock,
38+
};

x-pack/plugins/global_search_providers/kibana.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "globalSearchProviders",
33
"version": "8.0.0",
44
"kibanaVersion": "kibana",
5-
"server": false,
5+
"server": true,
66
"ui": true,
77
"requiredPlugins": ["globalSearch"],
88
"optionalPlugins": [],
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { PluginInitializer } from 'src/core/server';
8+
import { GlobalSearchProvidersPlugin, GlobalSearchProvidersPluginSetupDeps } from './plugin';
9+
10+
export const plugin: PluginInitializer<{}, {}, GlobalSearchProvidersPluginSetupDeps, {}> = () =>
11+
new GlobalSearchProvidersPlugin();
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { coreMock } from '../../../../src/core/server/mocks';
8+
import { globalSearchPluginMock } from '../../global_search/server/mocks';
9+
import { GlobalSearchProvidersPlugin } from './plugin';
10+
11+
describe('GlobalSearchProvidersPlugin', () => {
12+
let plugin: GlobalSearchProvidersPlugin;
13+
let globalSearchSetup: ReturnType<typeof globalSearchPluginMock.createSetupContract>;
14+
15+
beforeEach(() => {
16+
plugin = new GlobalSearchProvidersPlugin();
17+
globalSearchSetup = globalSearchPluginMock.createSetupContract();
18+
});
19+
20+
describe('#setup', () => {
21+
it('registers the `savedObjects` result provider', () => {
22+
const coreSetup = coreMock.createSetup();
23+
plugin.setup(coreSetup, { globalSearch: globalSearchSetup });
24+
25+
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledTimes(1);
26+
expect(globalSearchSetup.registerResultProvider).toHaveBeenCalledWith(
27+
expect.objectContaining({
28+
id: 'savedObjects',
29+
})
30+
);
31+
});
32+
});
33+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { CoreSetup, Plugin } from 'src/core/server';
8+
import { GlobalSearchPluginSetup } from '../../global_search/server';
9+
import { createSavedObjectsResultProvider } from './providers';
10+
11+
export interface GlobalSearchProvidersPluginSetupDeps {
12+
globalSearch: GlobalSearchPluginSetup;
13+
}
14+
15+
export class GlobalSearchProvidersPlugin
16+
implements Plugin<{}, {}, GlobalSearchProvidersPluginSetupDeps, {}> {
17+
setup(
18+
{ getStartServices }: CoreSetup<{}, {}>,
19+
{ globalSearch }: GlobalSearchProvidersPluginSetupDeps
20+
) {
21+
globalSearch.registerResultProvider(createSavedObjectsResultProvider());
22+
return {};
23+
}
24+
25+
start() {
26+
return {};
27+
}
28+
}

0 commit comments

Comments
 (0)