Skip to content

Commit

Permalink
add comment to consolidate all duplicated services
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Feb 8, 2024
1 parent 39988a0 commit 1bd6b8b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface AggType {
min: string;
}

// TODO Consolidate with legacy code in
// `x-pack/plugins/ml/public/application/services/forecast_service.js` and
// `x-pack/plugins/ml/public/application/services/forecast_service.d.ts`.
export function forecastServiceProvider(mlApiServices: MlApiServices) {
return {
// Gets a basic summary of the most recently run forecasts for the specified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
isModelPlotEnabled,
} from '../../../../common/util/job_utils';

// Note: This is a duplicated of `timeseries_search_service.ts` updated to move away from dependency cache.
// The original file will be removed once all references are replaced with references to this file.
// TODO Consolidate with legacy code in
// `x-pack/plugins/ml/public/application/timeseriesexplorer/timeseries_search_service.ts`
export function timeSeriesSearchServiceFactory(
mlResultsService: MlResultsService,
mlApiServices: MlApiServices
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/ml/public/application/util/index_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public';
import type { Job } from '../../../common/types/anomaly_detection_jobs';

// TODO Consolidate with legacy code in `ml/public/application/util/index_utils.ts`.
export function indexServiceFactory(dataViewsService: DataViewsContract) {
return {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import moment from 'moment';
import { type TimeRangeBounds, type TimeBucketsInterval, TimeBuckets } from './time_buckets';
import { useMlKibana } from '../contexts/kibana';

// TODO Consolidate with legacy code in `ml/public/application/util/time_buckets.js`.
export function timeBucketsServiceFactory(uiSettings: IUiSettingsClient) {
function getTimeBuckets(): InstanceType<typeof TimeBuckets> {
return new TimeBuckets({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { forecastServiceProvider } from '../services/forecast_service_provider';
import { timeSeriesSearchServiceFactory } from '../timeseriesexplorer/timeseriesexplorer_utils/time_series_search_service';
import { useMlKibana } from '../contexts/kibana';

// TODO Consolidate with legacy code in
// `ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js`.
export function timeSeriesExplorerServiceFactory(
uiSettings: IUiSettingsClient,
mlApiServices: MlApiServices,
Expand Down

0 comments on commit 1bd6b8b

Please sign in to comment.