From 26e9e3a95aa7e99c9b15a0181e972f75781169b9 Mon Sep 17 00:00:00 2001
From: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Date: Tue, 4 Sep 2018 14:51:25 +0200
Subject: [PATCH] cr changes

Feature #13860

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
---
 src/common/formatters.ts                            |  2 +-
 src/store/process-panel/process-panel-actions.ts    |  4 ++--
 src/store/process-panel/process-panel-reducer.ts    |  2 +-
 .../process-panel/process-information-card.tsx      | 13 ++++++++-----
 src/views/process-panel/subprocesses-card.tsx       |  7 ++-----
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/common/formatters.ts b/src/common/formatters.ts
index 737ca96f0b..e2097878a9 100644
--- a/src/common/formatters.ts
+++ b/src/common/formatters.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-export const formatDate = (isoDate?: string | null) => {
+export const formatDate = (isoDate?: string) => {
     if (isoDate) {
         const date = new Date(isoDate);
         const text = date.toLocaleString();
diff --git a/src/store/process-panel/process-panel-actions.ts b/src/store/process-panel/process-panel-actions.ts
index 85a7314d2e..832d4d5118 100644
--- a/src/store/process-panel/process-panel-actions.ts
+++ b/src/store/process-panel/process-panel-actions.ts
@@ -8,7 +8,7 @@ import { Dispatch } from 'redux';
 import { ProcessStatus } from '~/store/processes/process';
 
 export const procesPanelActions = unionize({
-    INIT_PROCESS_PANEL_FILTERS: ofType<string[]>(),
+    SET_PROCESS_PANEL_FILTERS: ofType<string[]>(),
     TOGGLE_PROCESS_PANEL_FILTER: ofType<string>(),
 });
 
@@ -22,7 +22,7 @@ export const loadProcessPanel = (uuid: string) =>
         dispatch(initProcessPanelFilters);
     };
 
-export const initProcessPanelFilters = procesPanelActions.INIT_PROCESS_PANEL_FILTERS([
+export const initProcessPanelFilters = procesPanelActions.SET_PROCESS_PANEL_FILTERS([
     ProcessStatus.QUEUED,
     ProcessStatus.COMPLETED,
     ProcessStatus.FAILED,
diff --git a/src/store/process-panel/process-panel-reducer.ts b/src/store/process-panel/process-panel-reducer.ts
index 487b092b12..3e31f56446 100644
--- a/src/store/process-panel/process-panel-reducer.ts
+++ b/src/store/process-panel/process-panel-reducer.ts
@@ -11,7 +11,7 @@ const initialState: ProcessPanel = {
 
 export const processPanelReducer = (state = initialState, action: ProcessPanelAction): ProcessPanel =>
     procesPanelActions.match(action, {
-        INIT_PROCESS_PANEL_FILTERS: statuses => {
+        SET_PROCESS_PANEL_FILTERS: statuses => {
             const filters = statuses.reduce((filters, status) => ({ ...filters, [status]: true }), {});
             return { filters };
         },
diff --git a/src/views/process-panel/process-information-card.tsx b/src/views/process-panel/process-information-card.tsx
index 287b725b04..efabe22b01 100644
--- a/src/views/process-panel/process-information-card.tsx
+++ b/src/views/process-panel/process-information-card.tsx
@@ -101,18 +101,18 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
                     </Tooltip>
                 }
                 subheader={
-                    <Tooltip title={process.containerRequest.description || '(no-description)'} placement="bottom-start">
+                    <Tooltip title={getDescription(process)} placement="bottom-start">
                         <Typography noWrap variant="body2" color='inherit'>
-                            {process.containerRequest.description || '(no-description)'}
+                            {getDescription(process)}
                         </Typography>
                     </Tooltip>} />
             <CardContent className={classes.content}>
                 <Grid container>
                     <Grid item xs={6}>
                         <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                            label='From' value={process.container ? formatDate(process.container.startedAt) : 'N/A'} />
+                            label='From' value={process.container ? formatDate(process.container.startedAt!) : 'N/A'} />
                         <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                            label='To' value={process.container ? formatDate(process.container.finishedAt) : 'N/A'} />
+                            label='To' value={process.container ? formatDate(process.container.finishedAt!) : 'N/A'} />
                         <DetailsAttribute classLabel={classes.label} classValue={classes.link}
                             label='Workflow' value='???' />
                     </Grid>
@@ -123,4 +123,7 @@ export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
                 </Grid>
             </CardContent>
         </Card>
-);
\ No newline at end of file
+);
+
+const getDescription = (process: Process) =>
+    process.containerRequest.description || '(no-description)';
diff --git a/src/views/process-panel/subprocesses-card.tsx b/src/views/process-panel/subprocesses-card.tsx
index 85de703334..0607c4711e 100644
--- a/src/views/process-panel/subprocesses-card.tsx
+++ b/src/views/process-panel/subprocesses-card.tsx
@@ -8,16 +8,13 @@ import { StyleRulesCallback, withStyles, WithStyles, Card, CardHeader, CardConte
 import { SubprocessFilter } from '~/components/subprocess-filter/subprocess-filter';
 import { SubprocessFilterDataProps } from '~/components/subprocess-filter/subprocess-filter';
 
-type CssRules = 'root' | 'subtitle' | 'title' | 'gridFilter';
+type CssRules = 'root' | 'title' | 'gridFilter';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         fontSize: '0.875rem',
         height: '100%'
     },
-    subtitle: {
-        paddingBottom: '32px!important'
-    },
     title: {
         color: theme.customs.colors.grey700
     },
@@ -49,7 +46,7 @@ export const SubprocessesCard = withStyles(styles)(
             <CardContent>
                 <Grid container direction="column" spacing={16}>
                     <Grid item xs={12} container spacing={16}>
-                        <Grid item md={12} lg={6} className={classes.subtitle}>
+                        <Grid item md={12} lg={6}>
                             <SubprocessFilter label='Subprocesses' value={subprocessesAmount} />
                         </Grid>
                         <Grid item md={12} lg={6}/>
-- 
2.30.2