[ARVADOS-WORKBENCH2] updated: 1.2.0-228-g59caadc

Git user git at public.curoverse.com
Fri Aug 31 07:51:55 EDT 2018


Summary of changes:
 src/common/formatters.ts                              |  4 ++--
 src/store/processes/process.ts                        |  4 ++--
 src/views/process-panel/process-information-card.tsx  |  4 ++--
 src/views/process-panel/process-panel-root.tsx        |  5 +++--
 src/views/process-panel/process-subprocesses-card.tsx | 10 +++++-----
 5 files changed, 14 insertions(+), 13 deletions(-)

       via  59caadc58a0b7ffc92fa95c90b16c99a9af6d942 (commit)
      from  99d7e235883f0c88b135e3ee10599cfea031e4f6 (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 59caadc58a0b7ffc92fa95c90b16c99a9af6d942
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Fri Aug 31 13:51:47 2018 +0200

    cr changes
    
    Feature #13859
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/common/formatters.ts b/src/common/formatters.ts
index a7680a0..0402f39 100644
--- a/src/common/formatters.ts
+++ b/src/common/formatters.ts
@@ -19,14 +19,14 @@ export const formatFileSize = (size?: number) => {
     return "";
 };
 
-export const msToTime = (time: number) => {
+export const formatTime = (time: number) => {
     const minutes = Math.floor(time / (1000 * 60) % 60).toFixed(0);
     const hours = Math.floor(time / (1000 * 60 * 60)).toFixed(0);
 
     return hours + "h " + minutes + "m";
 };
 
-export const getDiffTime = (endTime: string, startTime: string) => {
+export const getTimeDiff = (endTime: string, startTime: string) => {
     return new Date(endTime).getTime() - new Date(startTime).getTime();
 };
 
diff --git a/src/store/processes/process.ts b/src/store/processes/process.ts
index 98a84fd..afd27b2 100644
--- a/src/store/processes/process.ts
+++ b/src/store/processes/process.ts
@@ -7,7 +7,7 @@ import { ContainerResource } from '../../models/container';
 import { ResourcesState, getResource } from '~/store/resources/resources';
 import { filterResources } from '../resources/resources';
 import { ResourceKind, Resource } from '~/models/resource';
-import { getDiffTime } from '~/common/formatters';
+import { getTimeDiff } from '~/common/formatters';
 
 export interface Process {
     containerRequest: ContainerRequestResource;
@@ -44,7 +44,7 @@ export const getSubprocesses = (uuid: string) => (resources: ResourcesState) =>
 
 export const getProcessRuntime = (subprocess: Process) =>
     subprocess.container
-        ? getDiffTime(subprocess.container.finishedAt || '', subprocess.container.startedAt || '')
+        ? getTimeDiff(subprocess.container.finishedAt || '', subprocess.container.startedAt || '')
         : 0;
 
 export const getProcessStatus = (process: Process) =>
diff --git a/src/views/process-panel/process-information-card.tsx b/src/views/process-panel/process-information-card.tsx
index acc1d8f..e1c3b94 100644
--- a/src/views/process-panel/process-information-card.tsx
+++ b/src/views/process-panel/process-information-card.tsx
@@ -13,7 +13,7 @@ import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon';
 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
 import { Process } from '~/store/processes/process';
 import { getProcessStatus } from '~/store/processes/process';
-import { getBackgroundColorStatus } from '~/views/process-panel/process-panel-root';
+import { getStatusColor } from '~/views/process-panel/process-panel-root';
 
 type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar'
     | 'headerActive' | 'headerCompleted' | 'headerQueued' | 'headerFailed' | 'headerCanceled';
@@ -101,7 +101,7 @@ export const ProcessInformationCard = withStyles(styles)(
                 action={
                     <div>
                         <Chip label={getProcessStatus(process)}
-                            className={classnames([classes.chip, getBackgroundColorStatus(getProcessStatus(process), classes)])} />
+                            className={classnames([classes.chip, getStatusColor(getProcessStatus(process), classes)])} />
                         <IconButton
                             aria-label="More options"
                             onClick={event => onContextMenu(event)}>
diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx
index b4e0c2d..f6d1739 100644
--- a/src/views/process-panel/process-panel-root.tsx
+++ b/src/views/process-panel/process-panel-root.tsx
@@ -72,13 +72,14 @@ export const ProcessPanelRoot = (props: ProcessPanelRootProps) =>
         </Grid>
         : <Grid container
             alignItems='center'
-            justify='center'>
+            justify='center'
+            style={{ minHeight: '100%' }}>
             <DefaultView
                 icon={ProcessIcon}
                 messages={['Process not found']} />
         </Grid>;
 
-export const getBackgroundColorStatus = (status: string, classes: Record<CssRules, string>) => {
+export const getStatusColor = (status: string, classes: Record<CssRules, string>) => {
     switch (status) {
         case SubprocessesStatus.COMPLETED:
             return classes.headerCompleted;
diff --git a/src/views/process-panel/process-subprocesses-card.tsx b/src/views/process-panel/process-subprocesses-card.tsx
index 72104a7..340e3c6 100644
--- a/src/views/process-panel/process-subprocesses-card.tsx
+++ b/src/views/process-panel/process-subprocesses-card.tsx
@@ -11,9 +11,9 @@ import * as classnames from "classnames";
 import { ArvadosTheme } from '~/common/custom-theme';
 import { MoreOptionsIcon } from '~/components/icon/icon';
 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
-import { getBackgroundColorStatus } from '~/views/process-panel/process-panel-root';
+import { getStatusColor } from '~/views/process-panel/process-panel-root';
 import { Process, getProcessStatus, getProcessRuntime } from '~/store/processes/process';
-import { msToTime } from '~/common/formatters';
+import { formatTime } from '~/common/formatters';
 
 export type CssRules = 'label' | 'value' | 'title' | 'content' | 'action' | 'options' | 'status' | 'rightSideHeader' | 'titleHeader'
     | 'header' | 'headerActive' | 'headerCompleted' | 'headerQueued' | 'headerFailed' | 'headerCanceled';
@@ -100,7 +100,7 @@ export const ProcessSubprocessesCard = withStyles(styles)(
     ({ classes, onContextMenu, subprocess }: ProcessSubprocessesCardProps) => {
         return <Card>
             <CardHeader
-                className={classnames([classes.header, getBackgroundColorStatus(getProcessStatus(subprocess), classes)])}
+                className={classnames([classes.header, getStatusColor(getProcessStatus(subprocess), classes)])}
                 classes={{ content: classes.title, action: classes.action }}
                 action={
                     <div className={classes.rightSideHeader}>
@@ -110,7 +110,7 @@ export const ProcessSubprocessesCard = withStyles(styles)(
                         <IconButton
                             className={classes.options}
                             aria-label="More options"
-                            onClick={event => onContextMenu(event)}>
+                            onClick={onContextMenu}>
                             <MoreOptionsIcon />
                         </IconButton>
                     </div>
@@ -124,7 +124,7 @@ export const ProcessSubprocessesCard = withStyles(styles)(
                 } />
             <CardContent className={classes.content}>
                 <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                    label="Runtime" value={msToTime(getProcessRuntime(subprocess))} />
+                    label="Runtime" value={formatTime(getProcessRuntime(subprocess))} />
             </CardContent>
         </Card>;
     });
\ No newline at end of file

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list