forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[file_upload] move ml Importer classes to file_upload plugin (elastic…
…#91559) * [ml] move importer to file_upload plugin * move file_parse logic into GeoJsonImporter * move file_parser tests to geojson_importer tests * rename geo_json_clean_and_validate to geojson_clean_and_validate * replace file_upload import with Importer.import * simplify JsonIndexFilePicker props * tslint * i18n fixes and tslint fixes * update functional test to account for change in layer name * review feedback * dependency_cache review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
4911540
commit 31ed9bc
Showing
45 changed files
with
901 additions
and
1,206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { FileUploadComponentProps, lazyLoadFileUploadModules } from '../lazy_load_bundle'; | ||
import type { IImporter, ImportFactoryOptions } from '../importer'; | ||
|
||
export interface FileUploadStartApi { | ||
getFileUploadComponent(): Promise<React.ComponentType<FileUploadComponentProps>>; | ||
importerFactory(format: string, options: ImportFactoryOptions): Promise<IImporter | undefined>; | ||
} | ||
|
||
export async function getFileUploadComponent(): Promise< | ||
React.ComponentType<FileUploadComponentProps> | ||
> { | ||
const fileUploadModules = await lazyLoadFileUploadModules(); | ||
return fileUploadModules.JsonUploadAndParse; | ||
} | ||
|
||
export async function importerFactory( | ||
format: string, | ||
options: ImportFactoryOptions | ||
): Promise<IImporter | undefined> { | ||
const fileUploadModules = await lazyLoadFileUploadModules(); | ||
return fileUploadModules.importerFactory(format, options); | ||
} |
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.