diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js index aa3bbbd4af50f..1734182ff3ebc 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js @@ -77,7 +77,7 @@ export function actionsMenuContent( if (isManagedJob(item)) { showStopDatafeedsConfirmModal([item]); } else { - stopDatafeeds([item], refreshJobs); + stopDatafeeds(toastNotifications, mlJobService, [item], refreshJobs); } closeMenu(true); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts index 6fd9a18cfe4eb..a4c20309129f3 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts @@ -27,6 +27,8 @@ export function forceStartDatafeeds( toastNotifications: ToastsStart, mlJobService: MlJobService, jobs: CombinedJobWithStats[], + start: number | undefined, + end: number | undefined, finish?: () => void ): Promise; export function stopDatafeeds( diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js index 045715cd7efbc..471e56be7a840 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js @@ -92,7 +92,7 @@ export function forceStartDatafeeds( mlJobService .forceStartDatafeeds(datafeedIds, start, end) .then((resp) => { - showResults(resp, DATAFEED_STATE.STARTED); + showResults(toastNotifications, resp, DATAFEED_STATE.STARTED); finish(); }) .catch((error) => { @@ -111,7 +111,7 @@ export function stopDatafeeds(toastNotifications, mlJobService, jobs, finish = ( mlJobService .stopDatafeeds(datafeedIds) .then((resp) => { - showResults(resp, DATAFEED_STATE.STOPPED); + showResults(toastNotifications, resp, DATAFEED_STATE.STOPPED); finish(); }) .catch((error) => { @@ -299,7 +299,7 @@ export function closeJobs(toastNotifications, mlJobService, jobs, finish = () => mlJobService .closeJobs(jobIds) .then((resp) => { - showResults(resp, JOB_STATE.CLOSED); + showResults(toastNotifications, resp, JOB_STATE.CLOSED); finish(); }) .catch((error) => { @@ -323,7 +323,7 @@ export function resetJobs( mlJobService .resetJobs(jobIds, deleteUserAnnotations) .then((resp) => { - showResults(resp, JOB_ACTION.RESET); + showResults(toastNotifications, resp, JOB_ACTION.RESET); finish(); }) .catch((error) => { @@ -349,7 +349,7 @@ export function deleteJobs( mlJobService .deleteJobs(jobIds, deleteUserAnnotations, deleteAlertingRules) .then((resp) => { - showResults(resp, JOB_STATE.DELETED); + showResults(toastNotifications, resp, JOB_STATE.DELETED); finish(); }) .catch((error) => { diff --git a/x-pack/plugins/ml/public/application/services/job_service.d.ts b/x-pack/plugins/ml/public/application/services/job_service.d.ts index a08dfabfb3e68..685a0cf86cf9a 100644 --- a/x-pack/plugins/ml/public/application/services/job_service.d.ts +++ b/x-pack/plugins/ml/public/application/services/job_service.d.ts @@ -41,6 +41,11 @@ export declare interface MlJobService { start: number | undefined, end: number | undefined ): Promise; + forceStartDatafeeds( + dIds: string[], + start: number | undefined, + end: number | undefined + ): Promise; createResultsUrl(jobId: string[], start: number, end: number, location: string): string; getJobAndGroupIds(): Promise; getJob(jobId: string): CombinedJob;