[arvados-workbench2] updated: 2.5.0-58-gd86374ac

git repository hosting git at public.arvados.org
Thu Feb 16 20:26:52 UTC 2023


Summary of changes:
 src/components/icon/icon.tsx                     |  2 ++
 src/store/processes/processes-actions.ts         |  8 +++++
 src/views/process-panel/process-details-card.tsx | 44 ++++++++++++++++--------
 3 files changed, 40 insertions(+), 14 deletions(-)

       via  d86374acae51a7706b55c1333491f297df173a0a (commit)
       via  b71cb584942873132af6df8bc65ae28e35f13065 (commit)
       via  9924ecbc30ccde2482b5f77ec9030cdd4260af90 (commit)
      from  4968c1548af68dde9760766f6f0db667edaae7de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d86374acae51a7706b55c1333491f297df173a0a
Author: Stephen Smith <stephen at curii.com>
Date:   Thu Feb 16 15:25:33 2023 -0500

    20000: Change process cancel button to button style
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index 48cd8bed..20b87b20 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -74,6 +74,7 @@ import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
 import RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';
 import NotInterested from '@material-ui/icons/NotInterested';
 import Image from '@material-ui/icons/Image';
+import Stop from '@material-ui/icons/Stop';
 
 // Import FontAwesome icons
 import { library } from '@fortawesome/fontawesome-svg-core';
@@ -215,3 +216,4 @@ export const SetupIcon: IconType = (props) => <RemoveCircleOutline {...props} />
 export const InactiveIcon: IconType = (props) => <NotInterested {...props} />;
 export const ImageIcon: IconType = (props) => <Image {...props} />;
 export const StartIcon: IconType = (props) => <PlayArrow {...props} />;
+export const StopIcon: IconType = (props) => <Stop {...props} />;
diff --git a/src/views/process-panel/process-details-card.tsx b/src/views/process-panel/process-details-card.tsx
index 6ee576b5..501d8644 100644
--- a/src/views/process-panel/process-details-card.tsx
+++ b/src/views/process-panel/process-details-card.tsx
@@ -16,15 +16,16 @@ import {
     Button,
 } from '@material-ui/core';
 import { ArvadosTheme } from 'common/custom-theme';
-import { CloseIcon, MoreOptionsIcon, ProcessIcon, StartIcon } from 'components/icon/icon';
+import { CloseIcon, MoreOptionsIcon, ProcessIcon, StartIcon, StopIcon } from 'components/icon/icon';
 import { Process } from 'store/processes/process';
 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
 import { ProcessDetailsAttributes } from './process-details-attributes';
 import { ProcessStatus } from 'views-components/data-explorer/renderers';
 import { ContainerState } from 'models/container';
 import { ContainerRequestState } from 'models/container-request';
+import classNames from 'classnames';
 
-type CssRules = 'card' | 'content' | 'title' | 'header' | 'cancelButton' | 'avatar' | 'iconHeader' | 'runButton';
+type CssRules = 'card' | 'content' | 'title' | 'header' | 'cancelButton' | 'avatar' | 'iconHeader' | 'actionButton';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     card: {
@@ -54,17 +55,20 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         paddingTop: theme.spacing.unit * 0.5,
         color: theme.customs.colors.green700,
     },
-    cancelButton: {
-        paddingRight: theme.spacing.unit * 2,
-        fontSize: '14px',
-        color: theme.customs.colors.red900,
-        "&:hover": {
-            cursor: 'pointer'
-        }
-    },
-    runButton: {
+    actionButton: {
         padding: "0px 5px 0 0",
         marginRight: "5px",
+        fontSize: '0.78rem',
+    },
+    cancelButton: {
+        color: theme.customs.colors.red900,
+        borderColor: theme.customs.colors.red900,
+        '&:hover': {
+            borderColor: theme.customs.colors.red900,
+        },
+        '& svg': {
+            fontSize: '22px',
+        },
     },
 });
 
@@ -119,7 +123,7 @@ export const ProcessDetailsCard = withStyles(styles)(
                                 variant="contained"
                                 size="small"
                                 color="primary"
-                                className={classes.runButton}
+                                className={classes.actionButton}
                                 onClick={() => runAction && runAction(process.containerRequest.uuid)}>
                                 <StartIcon />
                                 Run
@@ -130,7 +134,16 @@ export const ProcessDetailsCard = withStyles(styles)(
                             process.container.state === ContainerState.RUNNING) &&
                             process.containerRequest.priority !== null &&
                             process.containerRequest.priority > 0 &&
-                            <span data-cy="process-cancel" className={classes.cancelButton} onClick={() => cancelProcess(process.containerRequest.uuid)}>Cancel</span>}
+                            <Button
+                                data-cy="process-cancel"
+                                variant="outlined"
+                                size="small"
+                                color="primary"
+                                className={classNames(classes.actionButton, classes.cancelButton)}
+                                onClick={() => cancelProcess(process.containerRequest.uuid)}>
+                                <StopIcon />
+                                Cancel
+                            </Button>}
                         <ProcessStatus uuid={process.containerRequest.uuid} />
                         <Tooltip title="More options" disableFocusListener>
                             <IconButton

commit b71cb584942873132af6df8bc65ae28e35f13065
Author: Stephen Smith <stephen at curii.com>
Date:   Thu Feb 16 15:23:20 2023 -0500

    20000: Hide run button when container is running or cancelled even when priority=0
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views/process-panel/process-details-card.tsx b/src/views/process-panel/process-details-card.tsx
index be046004..6ee576b5 100644
--- a/src/views/process-panel/process-details-card.tsx
+++ b/src/views/process-panel/process-details-card.tsx
@@ -84,7 +84,10 @@ export const ProcessDetailsCard = withStyles(styles)(
         if (process.containerRequest.state === ContainerRequestState.UNCOMMITTED) {
             runAction = startProcess;
         } else if (process.containerRequest.state === ContainerRequestState.COMMITTED &&
-                    process.containerRequest.priority === 0) {
+                    process.containerRequest.priority === 0 &&
+                    // Don't show run button when container is present & running or cancelled
+                    !(process.container && (process.container.state === ContainerState.RUNNING ||
+                                            process.container.state === ContainerState.CANCELLED))) {
             runAction = resumeOnHoldWorkflow;
         }
 

commit 9924ecbc30ccde2482b5f77ec9030cdd4260af90
Author: Stephen Smith <stephen at curii.com>
Date:   Thu Feb 16 15:21:56 2023 -0500

    20000: Refresh container record after cancel or resume to reduce flickering
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index cfda51dd..0b2de837 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -115,6 +115,10 @@ export const cancelRunningWorkflow = (uuid: string) =>
         try {
             const process = await services.containerRequestService.update(uuid, { priority: 0 });
             dispatch<any>(updateResources([process]));
+            if (process.containerUuid) {
+                const container = await services.containerService.get(process.containerUuid, false);
+                dispatch<any>(updateResources([container]));
+            }
             return process;
         } catch (e) {
             throw new Error('Could not cancel the process.');
@@ -126,6 +130,10 @@ export const resumeOnHoldWorkflow = (uuid: string) =>
         try {
             const process = await services.containerRequestService.update(uuid, { priority: 500 });
             dispatch<any>(updateResources([process]));
+            if (process.containerUuid) {
+                const container = await services.containerService.get(process.containerUuid, false);
+                dispatch<any>(updateResources([container]));
+            }
             return process;
         } catch (e) {
             throw new Error('Could not resume the process.');

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list