Skip to content

Commit

Permalink
[ML] Fix jobs so it limit job menu actions for jobs that are closing (#…
Browse files Browse the repository at this point in the history
…79303) (#79782)

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
qn895 and kibanamachine authored Oct 7, 2020
1 parent 9f34384 commit dadd32f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export function loadFullJob(jobId) {
}

export function isStartable(jobs) {
return jobs.some((j) => j.datafeedState === DATAFEED_STATE.STOPPED);
return jobs.some(
(j) => j.datafeedState === DATAFEED_STATE.STOPPED && j.jobState !== JOB_STATE.CLOSING
);
}

export function isStoppable(jobs) {
Expand All @@ -49,7 +51,10 @@ export function isStoppable(jobs) {

export function isClosable(jobs) {
return jobs.some(
(j) => j.datafeedState === DATAFEED_STATE.STOPPED && j.jobState !== JOB_STATE.CLOSED
(j) =>
j.datafeedState === DATAFEED_STATE.STOPPED &&
j.jobState !== JOB_STATE.CLOSED &&
j.jobState !== JOB_STATE.CLOSING
);
}

Expand Down

0 comments on commit dadd32f

Please sign in to comment.