cr changes
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 4 Sep 2018 12:51:25 +0000 (14:51 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 4 Sep 2018 12:51:25 +0000 (14:51 +0200)
Feature #13860

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/common/formatters.ts
src/store/process-panel/process-panel-actions.ts
src/store/process-panel/process-panel-reducer.ts
src/views/process-panel/process-information-card.tsx
src/views/process-panel/subprocesses-card.tsx

index 737ca96f0b54a492ad50823c3d50c5ed6f18b861..e2097878a9f98276ffe1d78cf49ac6ca4468d894 100644 (file)
@@ -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();
index 85a7314d2e7a1e2d84164a32cacd7fa651bf58ae..832d4d5118749088ca39fae276d0f7cb9e8faa44 100644 (file)
@@ -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,
index 487b092b123a19f6e0cb8264138dc3fdcfda25e7..3e31f56446171aa92dafbfbb58a5c54158f6b753 100644 (file)
@@ -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 };
         },
index 287b725b040ceea2a9b83eb0027875f4a62adc91..efabe22b01750b5ada922227a38aba649a6dec34 100644 (file)
@@ -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)';
index 85de7033340f8bde984c41a4e0e751e24a20bf35..0607c4711e2238ea26dcefff22663ca66568d258 100644 (file)
@@ -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}/>