Skip to content

Commit

Permalink
initServicesAndConstants in the start method instead of in the react …
Browse files Browse the repository at this point in the history
…component
  • Loading branch information
Aaron Caldwell committed Nov 21, 2019
1 parent 8c64c06 commit 9bfc86d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { IndexSettings } from './index_settings';
import { JsonIndexFilePicker } from './json_index_file_picker';
import { JsonImportProgress } from './json_import_progress';
import _ from 'lodash';
import { initServicesAndConstants } from '../kibana_services';

const INDEXING_STAGE = {
INDEXING_STARTED: i18n.translate(
Expand Down Expand Up @@ -66,11 +65,6 @@ export class JsonUploadAndParse extends Component {
indexPatternResp: '',
};

constructor(props) {
super(props);
initServicesAndConstants(props);
}

componentDidMount() {
this._isMounted = true;
}
Expand Down
9 changes: 3 additions & 6 deletions x-pack/legacy/plugins/file_upload/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { Plugin, CoreStart } from 'src/core/public';
import { initResources } from './util/indexing_service';
// @ts-ignore
import { JsonUploadAndParse } from './components/json_upload_and_parse';
// @ts-ignore
import { initServicesAndConstants } from './kibana_services';

/**
* These are the interfaces with your public contracts. You should export these
Expand All @@ -23,12 +25,7 @@ export class FileUploadPlugin implements Plugin<FileUploadPluginSetup, FileUploa
public setup() {}

public start(core: CoreStart) {
const { savedObjects, http, injectedMetadata } = core;
Object.assign(JsonUploadAndParse.defaultProps, {
savedObjects,
http,
injectedMetadata,
});
initServicesAndConstants(core);
return {
JsonUploadAndParse,
};
Expand Down

0 comments on commit 9bfc86d

Please sign in to comment.