Skip to content

Commit

Permalink
fix anomaly table actions
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Aug 21, 2024
1 parent 977b9bf commit f7b99c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function actionsMenuContent(
if (isManagedJob(item)) {
showStopDatafeedsConfirmModal([item]);
} else {
stopDatafeeds([item], refreshJobs);
stopDatafeeds(toastNotifications, mlJobService, [item], refreshJobs);
}

closeMenu(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export function forceStartDatafeeds(
toastNotifications: ToastsStart,
mlJobService: MlJobService,
jobs: CombinedJobWithStats[],
start: number | undefined,
end: number | undefined,
finish?: () => void
): Promise<void>;
export function stopDatafeeds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand All @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export declare interface MlJobService {
start: number | undefined,
end: number | undefined
): Promise<any>;
forceStartDatafeeds(
dIds: string[],
start: number | undefined,
end: number | undefined
): Promise<any>;
createResultsUrl(jobId: string[], start: number, end: number, location: string): string;
getJobAndGroupIds(): Promise<ExistingJobsAndGroups>;
getJob(jobId: string): CombinedJob;
Expand Down

0 comments on commit f7b99c2

Please sign in to comment.