clean code
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 28 Aug 2018 10:41:27 +0000 (12:41 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 28 Aug 2018 10:41:27 +0000 (12:41 +0200)
Feature #13858

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

src/views/process-panel/process-panel.tsx
src/views/workbench/workbench.tsx

index 1ae87470694ea8e07ace381917abe5848ed578cb..08bd37015d228837d3834952bacb4ed8041a40a2 100644 (file)
@@ -15,7 +15,7 @@ import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon';
 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
 import { RootState } from '~/store/store';
 
-type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'content' | 'chip' | 'headerText';
+type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'content' | 'chip' | 'headerText' | 'link';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     card: {
@@ -27,7 +27,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         color: theme.customs.colors.green700
     },
     label: {
-        fontSize: '0.875rem'
+        fontSize: '0.875rem',
     },
     value: {
         textTransform: 'none',
@@ -41,6 +41,13 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
             paddingBottom: '0px ',
         }
     },
+    link: {
+        fontSize: '0.875rem',
+        '&:hover': {
+            color: theme.palette.primary.main,
+            cursor: 'pointer'
+        }
+    },
     chip: {
         height: theme.spacing.unit * 2.5,
         width: theme.spacing.unit * 12,
@@ -53,9 +60,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         fontSize: '0.875rem',
         display: 'flex',
         position: 'relative',
-        justifyContent: 'flex-end',
+        justifyContent: 'flex-start',
         top: -theme.spacing.unit * 4.5,
-        right: theme.spacing.unit * 2,
+        left: theme.spacing.unit * 3,
     }
 });
 
@@ -64,7 +71,6 @@ interface ProcessPanelDataProps {
 }
 
 interface ProcessPanelActionProps {
-    onItemRouteChange: (processId: string) => void;
     onContextMenu: (event: React.MouseEvent<HTMLElement>, item: ProcessResource) => void;
 }
 
@@ -105,11 +111,11 @@ export const ProcessPanel = withStyles(styles)(
                             </Grid>
                             <Grid container direction="column">
                                 <Grid item xs={8}>
-                                    <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+                                    <DetailsAttribute classLabel={classes.link} classValue={classes.value}
                                         label='Container output' />
-                                    <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+                                    <DetailsAttribute classLabel={classes.link} classValue={classes.value}
                                         label='Show inputs' />
-                                    <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+                                    <DetailsAttribute classLabel={classes.link} classValue={classes.value}
                                         label='Show command' />
                                 </Grid>
                             </Grid>
@@ -118,11 +124,6 @@ export const ProcessPanel = withStyles(styles)(
                     </Card>
                 </div>;
             }
-            componentWillReceiveProps({ match, item, onItemRouteChange }: ProcessPanelProps) {
-                if (!item || match.params.id !== item.uuid) {
-                    onItemRouteChange(match.params.id);
-                }
-            }
         }
     )
 );
\ No newline at end of file
index 856a626c088f0dbf027fb6f1417843ef9fead85e..d8daed58b6ce1a421dc724bf47e0fe097b1c08bc 100644 (file)
@@ -267,9 +267,6 @@ export const Workbench = withStyles(styles)(
             }
 
             renderProcessPanel = (props: RouteComponentProps<{ id: string }>) => <ProcessPanel
-                onItemRouteChange={(processId) => {
-                    return <span>a</span>;
-                }}
                 onContextMenu={(event, item) => {
                     this.openContextMenu(event, {
                         uuid: 'item.uuid',