import JobStatus from 'girder_plugins/jobs/JobStatus';

JobStatus.registerStatus({
    WORKER_FETCHING_INPUT: {
        value: 820,
        text: 'Fetching input',
        icon: 'icon-download',
        color: '#89d2e2'
    },
    WORKER_CONVERTING_INPUT: {
        value: 821,
        text: 'Converting input',
        icon: 'icon-shuffle',
        color: '#92f5b5'
    },
    WORKER_CONVERTING_OUTPUT: {
        value: 822,
        text: 'Converting output',
        icon: 'icon-shuffle',
        color: '#92f5b5'
    },
    WORKER_PUSHING_OUTPUT: {
        value: 823,
        text: 'Pushing output',
        icon: 'icon-upload',
        color: '#89d2e2'
    },
    WORKER_CANCELING: {
        value: 824,
        text: 'Canceling',
        icon: 'icon-spin3 animate-spin',
        color: '#f89406'
    }
});

@@ -805,8 +805,641 @@
   %7D%0A%7D);%0A
+%0Aconst jobPluginIsCancelable = JobStatus.isCancelable;%0AJobStatus.isCancelable = function(job) %7B%0A  const handler = job.get('handler');%0A  if (handler === 'worker_handler') %7B%0A    return %5BJobStatus.CANCELED, JobStatus.WORKER_CANCELING,%0A      JobStatus.SUCCESS, JobStatus.ERROR%5D.indexOf(job.get('status')) === -1;%0A  %7D%0A  else if (handler === 'celery_handler') %7B%0A    // Currently celery_handler jobs can't be cancelled in the running state%0A    return %5BJobStatus.RUNNING, JobStatus.CANCELED, JobStatus.WORKER_CANCELING,%0A      JobStatus.SUCCESS, JobStatus.ERROR%5D.indexOf(job.get('status')) === -1;%0A  %7D%0A%0A  return jobPluginIsCancelable(job);%0A%7D%0A

Add isCancelable(..) function to JobStatus