19302: css tweaks Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>
[arvados-workbench2.git] / src / views-components / side-panel / side-panel-collapsed.tsx
index 2c66630a6168c4af6cad9cffb4d4b0c4f1ba8552..18e4df25272d69a8212eb359326e9b26a7013590 100644 (file)
@@ -5,7 +5,8 @@
 import React, { ReactElement } from 'react'
 import { connect } from 'react-redux'
 import { ProjectsIcon, ProcessIcon, FavoriteIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon } from 'components/icon/icon'
-import { List, ListItem, Tooltip } from '@material-ui/core'
+import { TerminalIcon } from 'components/icon/icon'
+import { IconButton, List, ListItem, Tooltip } from '@material-ui/core'
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'
 import { ArvadosTheme } from 'common/custom-theme'
 import { navigateTo } from 'store/navigation/navigation-action'
@@ -19,14 +20,21 @@ import {
     navigateToAllProcesses,
     navigateToTrash,
 } from 'store/navigation/navigation-action'
+import { navigateToUserVirtualMachines } from 'store/navigation/navigation-action'
 import { RouterAction } from 'react-router-redux'
 
-type CssRules = 'root' | 'unselected' | 'selected'
+type CssRules = 'button' | 'unselected' | 'selected'
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
-    root: {},
+    button: {
+        width: '40px',
+        height: '40px',
+        paddingLeft: '-2rem',
+        marginLeft: '-0.6rem',
+        marginBottom: '-1rem'
+    },
     unselected: {
-        color: theme.customs.colors.grey700,
+        color: theme.customs.colors.grey600,
     },
     selected: {
         color: theme.palette.primary.main,
@@ -39,6 +47,7 @@ enum SidePanelCollapsedCategory {
     PUBLIC_FAVORITES = 'Public Favorites',
     SHARED_WITH_ME = 'Shared with me',
     ALL_PROCESSES = 'All Processes',
+    SHELL_ACCESS = 'Shell Access',
     GROUPS = 'Groups',
     TRASH = 'Trash',
 }
@@ -75,9 +84,14 @@ const sidePanelCollapsedCategories: TCollapsedCategory[] = [
         icon: <ProcessIcon />,
         navTarget: navigateToAllProcesses,
     },
+    {
+        name: SidePanelCollapsedCategory.SHELL_ACCESS,
+        icon: <TerminalIcon />,
+        navTarget: navigateToUserVirtualMachines,
+    },
     {
         name: SidePanelCollapsedCategory.GROUPS,
-        icon: <GroupsIcon />,
+        icon: <GroupsIcon style={{marginLeft: '2px', scale: '85%'}}/>,
         navTarget: navigateToGroups,
     },
     {
@@ -88,10 +102,14 @@ const sidePanelCollapsedCategories: TCollapsedCategory[] = [
 ]
 
 const mapStateToProps = ({auth, properties }: RootState) => {
-    return {
-        user: auth.user,
-        selectedPath: properties.breadcrumbs ? properties.breadcrumbs[0].label : SidePanelCollapsedCategory.PROJECTS,
-    }
+        return {
+            user: auth.user,
+            selectedPath: properties.breadcrumbs
+                ? properties.breadcrumbs[0].label !== 'Virtual Machines'
+                ? properties.breadcrumbs[0].label
+                : SidePanelCollapsedCategory.SHELL_ACCESS
+                : SidePanelCollapsedCategory.PROJECTS,
+        }
 }
 
 const mapDispatchToProps = (dispatch: Dispatch) => {
@@ -109,21 +127,22 @@ export const SidePanelCollapsed = withStyles(styles)(
             else navTo(cat.navTarget)
         }
 
-        const { root, unselected, selected } = classes
+        const { button, unselected, selected } = classes
         return (
-            <List data-cy="side-panel-collapsed" className={root}>
+            <List data-cy="side-panel-collapsed">
                 {sidePanelCollapsedCategories.map((cat) => (
+                    
                     <ListItem
                         key={cat.name}
                         data-cy={`collapsed-${cat.name.toLowerCase().replace(/\s+/g, '-')}`}
-                        className={selectedPath === cat.name ? selected : unselected}
                         onClick={() => handleClick(cat)}
-                    >
+                        >
                         <Tooltip
+                            className={selectedPath === cat.name ? selected : unselected}
                             title={cat.name}
                             disableFocusListener
-                        >
-                            {cat.icon}
+                            >
+                            <IconButton className={button}>{cat.icon}</IconButton>
                         </Tooltip>
                     </ListItem>
                 ))}