[ARVADOS-WORKBENCH2] updated: 1.1.4-292-gd44aed1

Git user git at public.curoverse.com
Mon Jul 16 04:25:02 EDT 2018


Summary of changes:
 .../details-panel-factory/items/empty-item.tsx     |  4 +--
 src/components/icon/icon.tsx                       | 34 +++++++++++-----------
 src/components/side-panel/side-panel.tsx           | 19 +++++++-----
 3 files changed, 31 insertions(+), 26 deletions(-)

       via  d44aed1e3141d8e5491b949415c99f594ee79c21 (commit)
      from  dca911684e2f09e518e976f9e1e3d3c2aec2c86a (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 d44aed1e3141d8e5491b949415c99f594ee79c21
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Wed Jul 11 15:15:49 2018 +0200

    clean code after CR
    
    Feature #13764
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/components/details-panel-factory/items/empty-item.tsx b/src/components/details-panel-factory/items/empty-item.tsx
index 16394c8..e0f60d4 100644
--- a/src/components/details-panel-factory/items/empty-item.tsx
+++ b/src/components/details-panel-factory/items/empty-item.tsx
@@ -11,11 +11,11 @@ import { EmptyResource } from '../../../models/empty';
 export default class EmptyItem extends AbstractItem<EmptyResource> {
     
     getIcon(): IconTypes {
-        return IconTypes.FOLDER;
+        return IconTypes.INBOX;
     }
 
     buildDetails(): React.ReactElement<any> {
-        return <EmptyState icon={IconTypes.ANNOUNCEMENT}
+        return <EmptyState icon={IconTypes.FOLDER}
             message='Select a file or folder to view its details.' />;
     }
 }
\ No newline at end of file
diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index c6a7466..535d469 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -52,23 +52,23 @@ interface IconBaseState {
 }
 
 const getSpecificIcon = (props: any) => ({
-    access_time: <AccessTime className={props.className} />,
-    announcement: <CloseAnnouncement className={props.className} />,
-    code: <CodeIcon className={props.className} />,
-    collection: <i className={classnames([props.className, 'fas fa-archive fa-lg'])} />,
-    close: <CloseIcon className={props.className} />,
-    delete: <DeleteIcon className={props.className} />,
-    folder: <FolderIcon className={props.className} />,
-    help: <HelpIcon className={props.className} />,
-    info: <InfoIcon className={props.className} />,
-    inbox: <InboxIcon className={props.className} />,
-    notifications: <NotificationsIcon className={props.className} />,
-    people: <PeopleIcon className={props.className} />,
-    person: <PersonIcon className={props.className} />,
-    play_arrow: <PlayArrow className={props.className} />,
-    process: <i className={classnames([props.className, 'fas fa-cogs fa-lg'])} />,
-    project: <i className={classnames([props.className, 'fas fa-folder fa-lg'])} />,
-    star: <StarIcon className={props.className} />
+    [IconTypes.ACCESS_TIME]: <AccessTime className={props.className} />,
+    [IconTypes.ANNOUNCEMENT]: <CloseAnnouncement className={props.className} />,
+    [IconTypes.CODE]: <CodeIcon className={props.className} />,
+    [IconTypes.COLLECTION]: <i className={classnames([props.className, 'fas fa-archive fa-lg'])} />,
+    [IconTypes.CLOSE]: <CloseIcon className={props.className} />,
+    [IconTypes.DELETE]: <DeleteIcon className={props.className} />,
+    [IconTypes.FOLDER]: <FolderIcon className={props.className} />,
+    [IconTypes.HELP]: <HelpIcon className={props.className} />,
+    [IconTypes.INFO]: <InfoIcon className={props.className} />,
+    [IconTypes.INBOX]: <InboxIcon className={props.className} />,
+    [IconTypes.NOTIFICATIONS]: <NotificationsIcon className={props.className} />,
+    [IconTypes.PEOPLE]: <PeopleIcon className={props.className} />,
+    [IconTypes.PERSON]: <PersonIcon className={props.className} />,
+    [IconTypes.PLAY_ARROW]: <PlayArrow className={props.className} />,
+    [IconTypes.PROCESS]: <i className={classnames([props.className, 'fas fa-cogs fa-lg'])} />,
+    [IconTypes.PROJECT]: <i className={classnames([props.className, 'fas fa-folder fa-lg'])} />,
+    [IconTypes.STAR]: <StarIcon className={props.className} />
 });
 
 class IconBase extends React.Component<IconBaseProps, IconBaseState> {
diff --git a/src/components/side-panel/side-panel.tsx b/src/components/side-panel/side-panel.tsx
index 8b4398b..670c477 100644
--- a/src/components/side-panel/side-panel.tsx
+++ b/src/components/side-panel/side-panel.tsx
@@ -8,6 +8,7 @@ import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/st
 import { ArvadosTheme } from '../../common/custom-theme';
 import { List, ListItem, ListItemText, ListItemIcon, Collapse, Typography } from "@material-ui/core";
 import IconBase, { IconTypes } from '../icon/icon';
+import * as classnames from "classnames";
 
 export interface SidePanelItem {
     id: string;
@@ -29,8 +30,7 @@ interface SidePanelProps {
 class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
     render(): ReactElement<any> {
         const { classes, toggleOpen, toggleActive, sidePanelItems, children } = this.props;
-        const { listItemText, leftSidePanelContainer, row, list, icon, projectIconMargin, active, 
-            iconOpen, iconClose, iconArrow, iconArrowContainer } = classes;
+        const { listItemText, leftSidePanelContainer, row, list, icon, projectIconMargin, active, iconArrowContainer } = classes;
         return (
             <div className={leftSidePanelContainer}>
                 <List>
@@ -41,11 +41,7 @@ class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
                                     {it.openAble ? (
                                         <i onClick={() => toggleOpen(it.id)} className={iconArrowContainer}>
                                             <IconBase icon={IconTypes.PLAY_ARROW} 
-                                                className={`
-                                                    ${iconArrow}
-                                                    ${it.active ? active : ''}
-                                                    ${it.open ? iconOpen : iconClose} 
-                                                `} />
+                                                className={this.getIconClassNames(it.open, it.active)}/>
                                         </i>
                                     ) : null}
                                     <ListItemIcon className={it.active ? active : ''}>
@@ -68,6 +64,15 @@ class SidePanel extends React.Component<SidePanelProps & WithStyles<CssRules>> {
         );
     }
 
+    getIconClassNames = (itemOpen ?: boolean, itemActive ?: boolean) => {
+        const { classes } = this.props;
+        return classnames(classes.iconArrow, {
+            [classes.iconOpen]: itemOpen,
+            [classes.iconClose]: !itemOpen,
+            [classes.active]: itemActive
+        });
+    }
+
     handleRowContextMenu = (item: SidePanelItem) =>
         (event: React.MouseEvent<HTMLElement>) =>
             item.openAble ? this.props.onContextMenu(event, item) : null

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list