-
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
Merged
sebelga
merged 42 commits into
elastic:master
from
sebelga:np-migration/index-management-public-2
Feb 17, 2020
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
13fecc7
Move app to "application" folder
a566571
Remove legacy dependencies
f7b41a0
Refactor UiMetricService to follow np setup() pattern
e249d54
Add unmount() handler
6773b15
Provide UiMetricService through app context
78af8fc
Use uiMetricService instance from setup() in store reducer
0985aa3
Create class for IndexManagementExtensions
b0b2258
Refactor DetailPanel to functional component
77a2700
Provide extensions service to renderBadges()
b786f42
Refactor naming to ExtensionsService
9a0071b
Expose and consume ExtensionsService through app context
7d65680
Rename extensions service file name
9b9f740
Align on "setup()" name to initialize services
53c2fe3
Fix store dependencies
dc1ee41
Fix tests for index table
172bccb
Fix component integration tests
f1629fa
Refactor to use ExtensionsService from other plugins
98333eb
Remove unnecessary "register_routes" file
dd7ac26
Provide core and plugins deps to the app dependencies
d5ef537
Add "Service" suffix to app dependencies
91e3f83
Fix service dependency name
23a210c
Export "extensionsService" instead of "extensions"
0303cc5
Fix tests app dependencies
e6142ce
Fix tests app dependencies (2)
2896ee1
Fix TS issue
9bfdb03
Fix TS issue (2)
f649890
Fix test dependencies (3)
be6ce0a
Rename extensions.ts to extensions_service.ts
8d3715b
Export IndexManagementMock for tests
fc16a70
Expose ManagementAppMountParams from management plugin
ae32167
Use setBreadcrumbsHandler from management app
2f1110a
Merge remote-tracking branch 'upstream/master' into np-migration/inde…
0e9427d
Fix breadcrumbsService setup in tests
845a666
Merge branch 'master' into np-migration/index-management-public-2
elasticmachine c927cc1
Merge remote-tracking branch 'upstream/master' into np-migration/inde…
50836d6
Reenable commented tests
5ea0f5c
Address CR feedback
f495a31
Revert `UIM_EDIT_CLICK` import from common constants folder
eb306e1
Merge remote-tracking branch 'upstream/master' into np-migration/inde…
aed1ec3
Merge branch 'master' into np-migration/index-management-public-2
elasticmachine 0cef518
Merge branch 'master' into np-migration/index-management-public-2
a32ac8d
Merge remote-tracking branch 'upstream/master' into np-migration/inde…
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
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
39 changes: 0 additions & 39 deletions
39
.../legacy/plugins/index_management/__jest__/client_integration/helpers/setup_environment.ts
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...legacy/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx
This file contains hidden or 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,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 { | ||
| notificationServiceMock, | ||
| docLinksServiceMock, | ||
| } from '../../../../../../../src/core/public/mocks'; | ||
| 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'; | ||
| import { init as initHttpRequests } from './http_requests'; | ||
|
|
||
| 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); | ||
| breadcrumbService.setup(() => undefined); | ||
| documentationService.setup(docLinksServiceMock.createStartContract()); | ||
| notificationService.setup(notificationServiceMock.createSetupContract()); | ||
|
|
||
| const { server, httpRequestsMockHelpers } = initHttpRequests(); | ||
|
|
||
| return { | ||
| server, | ||
| httpRequestsMockHelpers, | ||
| }; | ||
| }; | ||
|
|
||
| export const WithAppDependencies = (Comp: any) => (props: any) => ( | ||
| <AppContextProvider value={appDependencies}> | ||
| <Comp {...props} /> | ||
| </AppContextProvider> | ||
| ); | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
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.
Can you import the
HttpServiceand use it instead ofaxios? Something like this: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.
Thanks for the suggestion. I ended up trying with
but this breaks our tests. Probably because our
sinon.fakeServer() requires a real http client likeaxios`. Will need to be investigated and changed in all our apps 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.
FWIW I did get this working for
remote_clusters(PR: #57365). I did have to adjust the timeouts though.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.
Cool. Did you try by providing directly the
httpServiceMock.createSetupContract())fromcore?