-
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.
NP Migration: Rollup plugin (#53503)
* Start shimming rollup plugin * continued shimming rollup ui * Remove unnecessarily return * Register management section * Replace ui/chrome * Replace ui/documentation_links * Replace ui/kfetch and ui/courier * Start shimming rollup plugin * continued shimming rollup ui * Remove unnecessarily return * Register management section * Replace ui/chrome * Replace ui/documentation_links * Replace ui/kfetch and ui/courier * Replace ui/notify * Move ui/ imports to legacy_imports.ts * Update NP mock for management * Refactoring * Read body from error object * Update setup_environment.js * Update unit tests * Get rid of injectI18n * Replace npStart and npSetup usage to services * Import search strategy stuff from the top level of the data plugin * Update unit tests * Do not prepend the url * Fix merge conflicts * Refactoring * Revert removal of setUserHasLeftApp * Export getSearchErrorType * Remove extra wrapper - Router * Fix cause prop. * Leave just static imports in legacy_imports.js * Add TS * Pass statusCode instead of statusText * Move template in a separate file * Move app register to setup * Add karma mock for management setup * Add EditorConfigProviderRegistry export Co-authored-by: Maryia Lapata <mary.lopato@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
326afbc
commit 0d03ade
Showing
70 changed files
with
716 additions
and
667 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
70 changes: 0 additions & 70 deletions
70
x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/http_requests.js
This file was deleted.
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
23 changes: 23 additions & 0 deletions
23
x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_context.tsx
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,23 @@ | ||
/* | ||
* 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, { FunctionComponent } from 'react'; | ||
|
||
import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; | ||
import { coreMock } from '../../../../../../../src/core/public/mocks'; | ||
const startMock = coreMock.createStart(); | ||
|
||
const services = { | ||
setBreadcrumbs: startMock.chrome.setBreadcrumbs, | ||
}; | ||
|
||
const wrapComponent = (Component: FunctionComponent) => (props: any) => ( | ||
<KibanaContextProvider services={services}> | ||
<Component {...props} /> | ||
</KibanaContextProvider> | ||
); | ||
|
||
export { wrapComponent }; |
23 changes: 0 additions & 23 deletions
23
x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_environment.js
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_environment.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,44 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
interface RequestMocks { | ||
jobs?: object; | ||
createdJob?: object; | ||
indxPatternVldtResp?: object; | ||
[key: string]: any; | ||
} | ||
|
||
const mockHttpRequest = ( | ||
http: any, | ||
{ jobs = {}, createdJob = {}, indxPatternVldtResp = {} }: RequestMocks = {} | ||
) => { | ||
http.get.mockImplementation(async (url: string) => { | ||
if (url === '/api/rollup/jobs') { | ||
return jobs; | ||
} | ||
|
||
if (url.startsWith('/api/rollup/index_pattern_validity')) { | ||
return { | ||
doesMatchIndices: true, | ||
doesMatchRollupIndices: false, | ||
dateFields: ['foo', 'bar'], | ||
numericFields: [], | ||
keywordFields: [], | ||
...indxPatternVldtResp, | ||
}; | ||
} | ||
|
||
return {}; | ||
}); | ||
|
||
// mock '/api/rollup/start' | ||
http.post.mockImplementation(async (url: string) => ({})); | ||
|
||
// mock '/api/rollup/create | ||
http.put.mockImplementation(async (url: string) => createdJob); | ||
}; | ||
|
||
export { mockHttpRequest }; |
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
Oops, something went wrong.