[ARVADOS-WORKBENCH2] updated: 1.1.4-137-ga292318

Git user git at public.curoverse.com
Mon Jun 25 07:11:21 EDT 2018


Summary of changes:
 src/components/side-panel/side-panel.tsx   | 18 ++++++++++--------
 src/store/side-panel/side-panel-reducer.ts |  2 ++
 2 files changed, 12 insertions(+), 8 deletions(-)

       via  a292318d2307543333fd5c2ea06610c6b82b0566 (commit)
      from  c90e813adcec89899d9db95843295a84fb058c3e (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 a292318d2307543333fd5c2ea06610c6b82b0566
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Mon Jun 25 13:11:14 2018 +0200

    new flags in side panel
    
    Feature ##13598
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/components/side-panel/side-panel.tsx b/src/components/side-panel/side-panel.tsx
index 36e4c74..ac20730 100644
--- a/src/components/side-panel/side-panel.tsx
+++ b/src/components/side-panel/side-panel.tsx
@@ -19,6 +19,8 @@ export interface SidePanelItem {
     icon: string;
     active?: boolean;
     open?: boolean;
+    margin?: boolean;
+    openAble?: boolean;
 }
 
 interface SidePanelProps {
@@ -29,8 +31,8 @@ interface SidePanelProps {
 
 class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
     render(): ReactElement<any> {
-        const { classes, toggleOpen, toggleActive, sidePanelItems } = this.props;
-        const { listItemText, leftSidePanelContainer, row, list, icon, projectIcon, active, activeArrow, inactiveArrow, arrowTransition, arrowRotate } = classes;
+        const { classes, toggleOpen, toggleActive, sidePanelItems, children } = this.props;
+        const { listItemText, leftSidePanelContainer, row, list, icon, projectIconMargin, active, activeArrow, inactiveArrow, arrowTransition, arrowRotate } = classes;
         return (
             <div className={leftSidePanelContainer}>
                 <List>
@@ -38,17 +40,17 @@ class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
                         <span key={it.name}>
                             <ListItem button className={list} onClick={() => toggleActive(it.id)}>
                                 <span className={row}>
-                                    {it.name === "Projects" ? <i onClick={() => toggleOpen(it.id)} className={`${it.active ? activeArrow : inactiveArrow} 
+                                    {it.openAble ? <i onClick={() => toggleOpen(it.id)} className={`${it.active ? activeArrow : inactiveArrow} 
                                         ${it.open ? `fas fa-caret-down ${arrowTransition}` : `fas fa-caret-down ${arrowRotate}`}`} /> : null}
                                     <ListItemIcon className={it.active ? active : ''}>
-                                        <i className={`${it.icon} ${icon} ${it.name === "Projects" ? projectIcon : ''}`} />
+                                        <i className={`${it.icon} ${icon} ${it.margin ? projectIconMargin : ''}`} />
                                     </ListItemIcon>
                                     <ListItemText className={listItemText} primary={<Typography className={it.active ? active : ''}>{it.name}</Typography>} />
                                 </span>
                             </ListItem>
-                            {it.name === "Projects" ? (
+                            {it.openAble ? (
                                 <Collapse in={it.open} timeout="auto" unmountOnExit>
-                                    {this.props.children}
+                                    {children}
                                 </Collapse>) : null}
                         </span>
                     ))}
@@ -58,7 +60,7 @@ class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
     }
 }
 
-type CssRules = 'active' | 'listItemText' | 'row' | 'leftSidePanelContainer' | 'list' | 'icon' | 'projectIcon' |
+type CssRules = 'active' | 'listItemText' | 'row' | 'leftSidePanelContainer' | 'list' | 'icon' | 'projectIconMargin' |
     'activeArrow' | 'inactiveArrow' | 'arrowRotate' | 'arrowTransition';
 
 const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
@@ -103,7 +105,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
     icon: {
         minWidth: '20px',
     },
-    projectIcon: {
+    projectIconMargin: {
         marginLeft: '17px',
     }
 });
diff --git a/src/store/side-panel/side-panel-reducer.ts b/src/store/side-panel/side-panel-reducer.ts
index 8051017..9fc5df1 100644
--- a/src/store/side-panel/side-panel-reducer.ts
+++ b/src/store/side-panel/side-panel-reducer.ts
@@ -42,6 +42,8 @@ export const sidePanelData = [
         icon: "fas fa-th fa-fw",
         open: false,
         active: false,
+        margin: true,
+        openAble: true
     },
     {
         id: "2",

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list