From f6044afd07c0a9c6f872edbbac8f4cf51ae8c0b1 Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Mon, 6 Apr 2020 23:22:42 +0200 Subject: [PATCH] Fix WBProcessState - mark processes as Failed when exit_code is not 0, as Cancelled when priority is 0. --- frontend/src/js/component/wb-process-state.js | 8 ++++---- frontend/src/js/misc/wb-process-state-name.js | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/js/component/wb-process-state.js b/frontend/src/js/component/wb-process-state.js index b334ae1..3aab5a4 100644 --- a/frontend/src/js/component/wb-process-state.js +++ b/frontend/src/js/component/wb-process-state.js @@ -1,5 +1,6 @@ import { h, Component } from 'preact'; import makeArvadosRequest from 'make-arvados-request'; +import wbProcessStateName from 'wb-process-state-name'; class WBProcessState extends Component { componentDidMount() { @@ -37,14 +38,13 @@ class WBProcessState extends Component { return (
- { process.state } + { wbProcessStateName(process, container) } { apiError ? { [ ' / ', apiError ] } : null } - { container ? [ " / ", container.state ] : null } - { !(error || warning) && container && container.state === 'Complete' ? " / Success" : null } { error ? [" / ", E ] : null } { warning ? [ " / ", W ] : null } { lazy && !container && !apiError ? ( + title={ warning }>W ] : null } {} + { lazy && !container && !apiError ? ( { e.preventDefault(); this.fetchData(); } }> diff --git a/frontend/src/js/misc/wb-process-state-name.js b/frontend/src/js/misc/wb-process-state-name.js index 876d529..2ecf5a3 100644 --- a/frontend/src/js/misc/wb-process-state-name.js +++ b/frontend/src/js/misc/wb-process-state-name.js @@ -1,9 +1,11 @@ function wbProcessStateName(containerRequest, container) { const cr = containerRequest; const c = container; + if (!c) + return cr.state; if (cr.state !== 'Uncommitted' && cr.priority === 0) return 'Cancelled'; - if (cr.state === 'Uncommitted' || !c || c.state === 'Queued' || c.state === 'Locked') + if (cr.state === 'Uncommitted' || !cr.container_uuid || c.state === 'Queued' || c.state === 'Locked') return 'Pending'; if (c.state === 'Running') return 'Running';