-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Index management] Client-side NP ready #57295
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
Changes from 23 commits
13fecc7
a566571
f7b41a0
e249d54
6773b15
78af8fc
0985aa3
b0b2258
77a2700
b786f42
9a0071b
7d65680
9b9f740
53c2fe3
dc1ee41
172bccb
f1629fa
98333eb
dd7ac26
d5ef537
91e3f83
23a210c
0303cc5
e6142ce
2896ee1
9bfdb03
f649890
be6ce0a
8d3715b
fc16a70
ae32167
2f1110a
0e9427d
845a666
c927cc1
50836d6
5ea0f5c
f495a31
eb306e1
aed1ec3
0cef518
a32ac8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * 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 React from 'react'; | ||
| import axios from 'axios'; | ||
| import axiosXhrAdapter from 'axios/lib/adapters/xhr'; | ||
| import { init as initHttpRequests } from './http_requests'; | ||
| import { AppContextProvider } from '../../../public/application/app_context'; | ||
| import { httpService } from '../../../public/application/services/http'; | ||
| import { breadcrumbService } from '../../../public/application/services/breadcrumbs'; | ||
| import { documentationService } from '../../../public/application/services/documentation'; | ||
| import { notificationService } from '../../../public/application/services/notification'; | ||
| import { ExtensionsService } from '../../../public/services'; | ||
| import { UiMetricService } from '../../../public/application/services/ui_metric'; | ||
| import { setUiMetricService } from '../../../public/application/services/api'; | ||
| import { setExtensionsService } from '../../../public/application/store/selectors'; | ||
|
|
||
| /* eslint-disable @kbn/eslint/no-restricted-paths */ | ||
| import { notificationServiceMock } from '../../../../../../../src/core/public/notifications/notifications_service.mock'; | ||
|
Contributor
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. nit: all core mocks should be available via |
||
| import { chromeServiceMock } from '../../../../../../../src/core/public/chrome/chrome_service.mock'; | ||
| import { docLinksServiceMock } from '../../../../../../../src/core/public/doc_links/doc_links_service.mock'; | ||
|
|
||
| const mockHttpClient = axios.create({ adapter: axiosXhrAdapter }); | ||
|
|
||
| export const services = { | ||
| extensionsService: new ExtensionsService(), | ||
| uiMetricService: new UiMetricService('index_management'), | ||
| }; | ||
| services.uiMetricService.setup({ reportUiStats() {} } as any); | ||
| setExtensionsService(services.extensionsService); | ||
| setUiMetricService(services.uiMetricService); | ||
| const appDependencies = { services, core: {}, plugins: {} } as any; | ||
|
|
||
| export const setupEnvironment = () => { | ||
| // Mock initialization of services | ||
| // @ts-ignore | ||
| httpService.setup(mockHttpClient); | ||
|
Contributor
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. Can you import the
Contributor
Author
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. Thanks for the suggestion. I ended up trying with // httpServiceMock.createSetupContract() returns an HttpSetupMock from core
httpService.setup(httpServiceMock.createSetupContract());but this breaks our tests. Probably because our
Contributor
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. FWIW I did get this working for
Contributor
Author
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. Cool. Did you try by providing directly the |
||
| breadcrumbService.setup(chromeServiceMock.createStartContract(), ''); | ||
| documentationService.setup(docLinksServiceMock.createStartContract()); | ||
| notificationService.setup(notificationServiceMock.createStartContract()); | ||
|
Contributor
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. should this be
Contributor
Author
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. They are both the same, but for consistency let's use the |
||
|
|
||
| const { server, httpRequestsMockHelpers } = initHttpRequests(); | ||
|
|
||
| return { | ||
| server, | ||
| httpRequestsMockHelpers, | ||
| }; | ||
| }; | ||
|
|
||
| export const WithAppDependencies = (Comp: any) => (props: any[]) => ( | ||
| <AppContextProvider value={appDependencies}> | ||
| <Comp {...props} /> | ||
| </AppContextProvider> | ||
| ); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
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.
Why did
UIM_EDIT_CLICKget moved tocommon? If these constants aren't being consumed by both public and server code, then I think they belong in public.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.
This is probably from the merge conflict resolution. There are no
UIM_EDIT_CLICKin the common folder so importing it is probablyundefined.. Will revert that change. 👍