diff --git a/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.tsx.snap b/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.tsx.snap index bbbb94c383..9faa6c60eb 100644 --- a/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.tsx.snap +++ b/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.tsx.snap @@ -346,6 +346,28 @@ exports[`renders with the available plugins 1`] = ` GFF3Plugin

+
  • + +

    + JobsManagementPlugin +

    +
  • diff --git a/plugins/jobs-management/src/JobsListWidget/components/CurrentJobCard.tsx b/plugins/jobs-management/src/JobsListWidget/components/CurrentJobCard.tsx index acbe0c1191..9fef8cebf5 100644 --- a/plugins/jobs-management/src/JobsListWidget/components/CurrentJobCard.tsx +++ b/plugins/jobs-management/src/JobsListWidget/components/CurrentJobCard.tsx @@ -62,6 +62,7 @@ const CurrentJobCard = observer(function CurrentJobCard({ color="inherit" disabled={clicked || job.progressPct === 0} onClick={() => { + job.setStatusMessage('Aborted via cancel button') job.cancelCallback && job.cancelCallback() setClicked(true) }} diff --git a/plugins/jobs-management/src/JobsListWidget/components/JobCard.tsx b/plugins/jobs-management/src/JobsListWidget/components/JobCard.tsx index 40f8919e91..a287343fbb 100644 --- a/plugins/jobs-management/src/JobsListWidget/components/JobCard.tsx +++ b/plugins/jobs-management/src/JobsListWidget/components/JobCard.tsx @@ -11,6 +11,12 @@ const JobCard = observer(function JobCard({ job }: { job: NewJob }) { {'Name: '} {job.name} + {job.statusMessage ? ( + + {'Message: '} + {job.statusMessage} + + ) : null} ) diff --git a/plugins/jobs-management/src/JobsListWidget/components/JobsListWidget.tsx b/plugins/jobs-management/src/JobsListWidget/components/JobsListWidget.tsx index 857de3757a..60da008c88 100644 --- a/plugins/jobs-management/src/JobsListWidget/components/JobsListWidget.tsx +++ b/plugins/jobs-management/src/JobsListWidget/components/JobsListWidget.tsx @@ -27,14 +27,14 @@ const useStyles = makeStyles()(theme => ({ const JobsListWidget = observer(function ({ model }: { model: JobsListModel }) { const { classes } = useStyles() - const { jobs, finished, queued } = model + const { jobs, finished, queued, aborted } = model return (
    } > - Jobs + Running jobs {jobs.length ? ( jobs.map((job: NewJob, index: number) => ( @@ -43,7 +43,7 @@ const JobsListWidget = observer(function ({ model }: { model: JobsListModel }) { ) : ( - No jobs + No running jobs )} @@ -70,7 +70,7 @@ const JobsListWidget = observer(function ({ model }: { model: JobsListModel }) { } > - Jobs completed + Completed jobs {finished.length ? ( finished.map((job: NewJob, index: number) => ( @@ -79,7 +79,25 @@ const JobsListWidget = observer(function ({ model }: { model: JobsListModel }) { ) : ( - No jobs completed + No completed jobs + + + )} + + + } + > + Aborted jobs + + {aborted.length ? ( + aborted.map((job: NewJob, index: number) => ( + + )) + ) : ( + + + No aborted jobs )} diff --git a/plugins/jobs-management/src/JobsListWidget/model.ts b/plugins/jobs-management/src/JobsListWidget/model.ts index f81f57924e..72e0e18ffd 100644 --- a/plugins/jobs-management/src/JobsListWidget/model.ts +++ b/plugins/jobs-management/src/JobsListWidget/model.ts @@ -25,6 +25,7 @@ export const Job = types export interface NewJob extends SnapshotIn { cancelCallback(): void + setStatusMessage(msg?: string): void } export default function f(_pluginManager: PluginManager) { @@ -35,6 +36,7 @@ export default function f(_pluginManager: PluginManager) { jobs: types.array(Job), finished: types.array(Job), queued: types.array(Job), + aborted: types.array(Job), }) .actions(self => ({ addJob(job: NewJob) { @@ -58,6 +60,10 @@ export default function f(_pluginManager: PluginManager) { self.queued.push(job) return self.finished }, + addAbortedJob(job: NewJob) { + self.aborted.push(job) + return self.aborted + }, removeQueuedJob(jobName: string) { const indx = self.queued.findIndex(job => job.name === jobName) const removed = self.queued[indx] diff --git a/plugins/jobs-management/src/index.ts b/plugins/jobs-management/src/index.ts index b165eef10f..e46f86490e 100644 --- a/plugins/jobs-management/src/index.ts +++ b/plugins/jobs-management/src/index.ts @@ -17,7 +17,7 @@ export default class extends Plugin { pluginManager.addWidgetType(() => { return new WidgetType({ name: 'JobsListWidget', - heading: 'Running jobs', + heading: 'Jobs list', configSchema: JobsListConfigSchema, stateModel: JobsListStateModelFactory(pluginManager), ReactComponent: lazy( @@ -40,6 +40,7 @@ export default class extends Plugin { let jobStatusWidget = widgets.get('JobsList') if (!jobStatusWidget) { jobStatusWidget = session.addWidget('JobsListWidget', 'JobsList') + session.showWidget(jobStatusWidget) } else { session.showWidget(jobStatusWidget) } diff --git a/products/jbrowse-web/src/corePlugins.ts b/products/jbrowse-web/src/corePlugins.ts index 311df6f256..97d2ba1761 100644 --- a/products/jbrowse-web/src/corePlugins.ts +++ b/products/jbrowse-web/src/corePlugins.ts @@ -9,6 +9,7 @@ import DataManagement from '@jbrowse/plugin-data-management' import DotplotView from '@jbrowse/plugin-dotplot-view' import GtfPlugin from '@jbrowse/plugin-gtf' import Gff3 from '@jbrowse/plugin-gff3' +import JobsManagementPlugin from '@jbrowse/plugin-jobs-management' import LegacyJBrowse from '@jbrowse/plugin-legacy-jbrowse' import LinearGenomeView from '@jbrowse/plugin-linear-genome-view' import LinearComparativeView from '@jbrowse/plugin-linear-comparative-view' @@ -39,6 +40,7 @@ const corePlugins = [ DotplotView, GtfPlugin, Gff3, + JobsManagementPlugin, LegacyJBrowse, LinearComparativeView, Lollipop,