Skip to content

Commit a67ba47

Browse files
[ML] Consolidating shared types and util functions (elastic#65247)
* [ML] Consolidating shared types and util functions * including formatter * adding missing includes * removing unused export * ignoring numeral type error Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 0de20b7 commit a67ba47

File tree

24 files changed

+57
-40
lines changed

24 files changed

+57
-40
lines changed

x-pack/plugins/ml/public/application/components/field_type_icon/field_type_icon.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import React from 'react';
99

1010
import { EuiToolTip } from '@elastic/eui';
1111

12-
// don't use something like plugins/ml/../common
13-
// because it won't work with the jest tests
1412
import { getMLJobTypeAriaLabel } from '../../util/field_types_utils';
1513
import { ML_JOB_FIELD_TYPES } from '../../../../common/constants/field_types';
1614
import { i18n } from '@kbn/i18n';

x-pack/plugins/ml/public/application/components/message_call_out/message_call_out.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import PropTypes from 'prop-types';
1414

1515
import { EuiCallOut } from '@elastic/eui';
1616

17-
// don't use something like plugins/ml/../common
18-
// because it won't work with the jest tests
1917
import { MESSAGE_LEVEL } from '../../../../common/constants/message_levels';
2018

2119
function getCallOutAttributes(message, status) {

x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import { FormattedMessage } from '@kbn/i18n/react';
3030

3131
import { getDocLinks } from '../../util/dependency_cache';
3232

33-
// don't use something like plugins/ml/../common
34-
// because it won't work with the jest tests
3533
import { VALIDATION_STATUS } from '../../../../common/constants/validation';
3634
import { getMostSevereMessageStatus } from '../../../../common/util/validation_utils';
3735

x-pack/plugins/ml/public/application/datavisualizer/file_based/components/utils/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { isEqual } from 'lodash';
8+
// @ts-ignore
89
import numeral from '@elastic/numeral';
910
import { ml } from '../../../../services/ml_api_service';
1011
import { AnalysisResult, InputOverrides } from '../../../../../../common/types/file_datavisualizer';

x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import d3 from 'd3';
1717
import $ from 'jquery';
1818
import moment from 'moment';
1919

20-
// don't use something like plugins/ml/../common
21-
// because it won't work with the jest tests
2220
import { formatHumanReadableDateTime } from '../../util/date_utils';
2321
import { formatValue } from '../../formatters/format_value';
2422
import { getSeverityColor, getSeverityWithLow } from '../../../../common/util/anomaly_utils';

x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import d3 from 'd3';
1717
import $ from 'jquery';
1818
import moment from 'moment';
1919

20-
// don't use something like plugins/ml/../common
21-
// because it won't work with the jest tests
2220
import { formatHumanReadableDateTime } from '../../util/date_utils';
2321
import { formatValue } from '../../formatters/format_value';
2422
import {

x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import _ from 'lodash';
1414
import d3 from 'd3';
1515
import moment from 'moment';
1616

17-
// don't use something like plugins/ml/../common
18-
// because it won't work with the jest tests
1917
import { i18n } from '@kbn/i18n';
2018
import { Subscription } from 'rxjs';
2119
import { TooltipValue } from '@elastic/charts';

x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import React, { Component } from 'react';
1515

1616
import { EuiButton, EuiToolTip } from '@elastic/eui';
1717

18-
// don't use something like plugins/ml/../common
19-
// because it won't work with the jest tests
2018
import { FORECAST_REQUEST_STATE, JOB_STATE } from '../../../../../common/constants/states';
2119
import { MESSAGE_LEVEL } from '../../../../../common/constants/message_levels';
2220
import { isJobVersionGte } from '../../../../../common/util/job_utils';

x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/run_controls.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
EuiToolTip,
2424
} from '@elastic/eui';
2525

26-
// don't use something like plugins/ml/../common
27-
// because it won't work with the jest tests
2826
import { JOB_STATE } from '../../../../../common/constants/states';
2927
import { FORECAST_DURATION_MAX_DAYS } from './forecasting_modal';
3028
import { ForecastProgress } from './forecast_progress';

x-pack/plugins/ml/public/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
MlSetupDependencies,
1414
MlStartDependencies,
1515
} from './plugin';
16-
import { getMetricChangeDescription } from './application/formatters/metric_change_description';
1716

1817
export const plugin: PluginInitializer<
1918
MlPluginSetup,
@@ -22,4 +21,5 @@ export const plugin: PluginInitializer<
2221
MlStartDependencies
2322
> = () => new MlPlugin();
2423

25-
export { MlPluginSetup, MlPluginStart, getMetricChangeDescription };
24+
export { MlPluginSetup, MlPluginStart };
25+
export * from './shared';

0 commit comments

Comments
 (0)