[ARVADOS-WORKBENCH2] updated: 1.3.0-277-g0a8f679e

Git user git at public.curoverse.com
Fri Dec 28 07:04:09 EST 2018


Summary of changes:
 src/store/details-panel/details-panel-action.ts    |  3 +++
 src/store/details-panel/details-panel-reducer.ts   |  3 ++-
 .../collection-panel-files.ts                      |  4 ++--
 .../details-panel/file-details.tsx                 |  9 ++++++--
 src/views/collection-panel/collection-panel.tsx    | 26 +++++++++++++++++++---
 5 files changed, 37 insertions(+), 8 deletions(-)

       via  0a8f679e97c4579af833afad02b74816b666c7af (commit)
       via  67e3a05b8c90b7ebd506db768e427141fd958e66 (commit)
       via  63853fe0bfe0f3c12ba3689586907987975abed3 (commit)
       via  4549183cc07c5655be2108585d4d8c704cf31ff1 (commit)
      from  dbd2dcaeb2c4f3f3df83c3d127e99ce4705a4723 (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 0a8f679e97c4579af833afad02b74816b666c7af
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Dec 28 13:03:51 2018 +0100

    Display file preview if file is an image
    
    Feature #14684
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views-components/details-panel/file-details.tsx b/src/views-components/details-panel/file-details.tsx
index 7d43bd4b..db7c9cfe 100644
--- a/src/views-components/details-panel/file-details.tsx
+++ b/src/views-components/details-panel/file-details.tsx
@@ -9,6 +9,7 @@ import { getIcon } from '~/components/file-tree/file-tree-item';
 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
 import { formatFileSize } from '~/common/formatters';
 import { FileThumbnail } from '~/components/file-tree/file-thumbnail';
+import isImage from 'is-image';
 
 export class FileDetails extends DetailsData<CollectionFile | CollectionDirectory> {
 
@@ -22,8 +23,12 @@ export class FileDetails extends DetailsData<CollectionFile | CollectionDirector
         return item.type === CollectionFileType.FILE
             ? <>
                 <DetailsAttribute label='Size' value={formatFileSize(item.size)} />
-                <DetailsAttribute label='Preview' />
-                <FileThumbnail file={item}/>
+                {
+                    isImage(item.url) && <>
+                        <DetailsAttribute label='Preview' />
+                        <FileThumbnail file={item} />
+                    </>
+                }
             </>
             : <div />;
     }

commit 67e3a05b8c90b7ebd506db768e427141fd958e66
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Dec 28 13:01:57 2018 +0100

    Open details panel on file click
    
    Feature #14684
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views-components/collection-panel-files/collection-panel-files.ts b/src/views-components/collection-panel-files/collection-panel-files.ts
index cfd32dcf..7836e1f7 100644
--- a/src/views-components/collection-panel-files/collection-panel-files.ts
+++ b/src/views-components/collection-panel-files/collection-panel-files.ts
@@ -23,7 +23,7 @@ import { CollectionFileType, createCollectionDirectory } from "~/models/collecti
 import { openContextMenu, openCollectionFilesContextMenu } from '~/store/context-menu/context-menu-actions';
 import { openUploadCollectionFilesDialog } from '~/store/collections/collection-upload-actions';
 import { ResourceKind } from "~/models/resource";
-import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
+import { openDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 const memoizedMapStateToProps = () => {
     let prevState: CollectionPanelFilesState;
@@ -58,7 +58,7 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick<CollectionPanelFilesProps,
         dispatch<any>(openCollectionFilesContextMenu(event));
     },
     onFileClick: (id) => {
-        dispatch(loadDetailsPanel(id));
+        dispatch(openDetailsPanel(id));
     },
 });
 

commit 63853fe0bfe0f3c12ba3689586907987975abed3
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Dec 28 12:59:07 2018 +0100

    Handle opening collection detail panel on click on collection panel title
    
    Feature #14684
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index 41a685f3..4ec39ca8 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -25,6 +25,7 @@ import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
 import { formatFileSize } from "~/common/formatters";
 import { getResourceData } from "~/store/resources-data/resources-data";
 import { ResourceData } from "~/store/resources-data/resources-data-reducer";
+import { openDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 type CssRules = 'card' | 'iconHeader' | 'tag' | 'copyIcon' | 'label' | 'value' | 'link';
 
@@ -77,13 +78,18 @@ export const CollectionPanel = withStyles(styles)(
         return { item, data };
     })(
         class extends React.Component<CollectionPanelProps> {
+
             render() {
                 const { classes, item, data, dispatch } = this.props;
                 return item
                     ? <>
                         <Card className={classes.card}>
                             <CardHeader
-                                avatar={<CollectionIcon className={classes.iconHeader} />}
+                                avatar={
+                                    <IconButton onClick={this.openCollectionDetails}>
+                                        <CollectionIcon className={classes.iconHeader} />
+                                    </IconButton>
+                                }
                                 action={
                                     <Tooltip title="More options" disableFocusListener>
                                         <IconButton
@@ -94,7 +100,9 @@ export const CollectionPanel = withStyles(styles)(
                                     </Tooltip>
                                 }
                                 title={item && item.name}
-                                subheader={item && item.description} />
+                                titleTypographyProps={this.titleProps}
+                                subheader={item && item.description}
+                                subheaderTypographyProps={this.titleProps} />
                             <CardContent>
                                 <Grid container direction="column">
                                     <Grid item xs={6}>
@@ -113,7 +121,7 @@ export const CollectionPanel = withStyles(styles)(
                                             label='Content size' value={data && formatFileSize(data.fileSize)} />
                                         <DetailsAttribute classLabel={classes.label} classValue={classes.value}
                                             label='Owner' value={item && item.ownerUuid} />
-                                        <span onClick={() => dispatch<any>(navigateToProcess(item.properties.container_request  || item.properties.containerRequest))}>
+                                        <span onClick={() => dispatch<any>(navigateToProcess(item.properties.container_request || item.properties.containerRequest))}>
                                             <DetailsAttribute classLabel={classes.link} label='Link to process' />
                                         </span>
                                     </Grid>
@@ -172,6 +180,18 @@ export const CollectionPanel = withStyles(styles)(
                     hideDuration: 2000
                 }));
             }
+
+            openCollectionDetails = () => {
+                const { item } = this.props;
+                if (item) {
+                    this.props.dispatch(openDetailsPanel(item.uuid));
+                }
+            }
+
+            titleProps = {
+                onClick: this.openCollectionDetails
+            };
+
         }
     )
 );

commit 4549183cc07c5655be2108585d4d8c704cf31ff1
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Dec 28 12:58:11 2018 +0100

    Add OPEN_DETAILS_PANEL action
    
    Feature #14684
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts
index 2c742a1f..a5ff5873 100644
--- a/src/store/details-panel/details-panel-action.ts
+++ b/src/store/details-panel/details-panel-action.ts
@@ -18,6 +18,7 @@ export const SLIDE_TIMEOUT = 500;
 
 export const detailsPanelActions = unionize({
     TOGGLE_DETAILS_PANEL: ofType<{}>(),
+    OPEN_DETAILS_PANEL: ofType<string>(),
     LOAD_DETAILS_PANEL: ofType<string>()
 });
 
@@ -28,6 +29,8 @@ export const PROJECT_PROPERTIES_DIALOG_NAME = 'projectPropertiesDialogName';
 
 export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAILS_PANEL(uuid);
 
+export const openDetailsPanel = (uuid: string) => detailsPanelActions.OPEN_DETAILS_PANEL(uuid);
+
 export const openProjectPropertiesDialog = () =>
     (dispatch: Dispatch) => {
         dispatch<any>(dialogActions.OPEN_DIALOG({ id: PROJECT_PROPERTIES_DIALOG_NAME, data: { } }));
diff --git a/src/store/details-panel/details-panel-reducer.ts b/src/store/details-panel/details-panel-reducer.ts
index 091b2fa2..38c0edd5 100644
--- a/src/store/details-panel/details-panel-reducer.ts
+++ b/src/store/details-panel/details-panel-reducer.ts
@@ -18,5 +18,6 @@ export const detailsPanelReducer = (state: DetailsPanelState = initialState, act
     detailsPanelActions.match(action, {
         default: () => state,
         LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
-        TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened })
+        OPEN_DETAILS_PANEL: resourceUuid => ({ resourceUuid, isOpened: true }),
+        TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),
     });

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list