[ARVADOS-WORKBENCH2] updated: 1.3.0-137-g7e7d0ab

Git user git at public.curoverse.com
Thu Dec 13 09:35:40 EST 2018


Summary of changes:
 public/file-viewers-example.json                               |  3 ++-
 src/models/file-viewers-config.ts                              |  5 +++++
 .../context-menu/actions/file-viewer-actions.tsx               | 10 ++++++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

       via  7e7d0ab455b9e37de66a2d311419454159a4b193 (commit)
      from  506c5d3104812647a34c93690d6d04726edc09d9 (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 7e7d0ab455b9e37de66a2d311419454159a4b193
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 13 15:35:21 2018 +0100

    Add file viewer icon customization
    
    Feature #13540
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/public/file-viewers-example.json b/public/file-viewers-example.json
index 7c8aefc..27adb70 100644
--- a/public/file-viewers-example.json
+++ b/public/file-viewers-example.json
@@ -6,7 +6,8 @@
             ".zip"
         ],
         "url": "https://doc.arvados.org",
-        "filePathParam": "filePath"
+        "filePathParam": "filePath",
+        "iconUrl": "https://material.io/tools/icons/static/icons/baseline-next_week-24px.svg"
     },
     {
         "name": "Collection browser",
diff --git a/src/models/file-viewers-config.ts b/src/models/file-viewers-config.ts
index 5c23dd4..e95116b 100644
--- a/src/models/file-viewers-config.ts
+++ b/src/models/file-viewers-config.ts
@@ -39,4 +39,9 @@ export interface FileViewer {
      * `https://bam-viewer.com?filePath=/path/to/file`
      */
     filePathParam: string;
+
+    /**
+     * Icon that will display next to a label
+     */
+    iconUrl?: string;
 }
diff --git a/src/views-components/context-menu/actions/file-viewer-actions.tsx b/src/views-components/context-menu/actions/file-viewer-actions.tsx
index f1a4695..961e182 100644
--- a/src/views-components/context-menu/actions/file-viewer-actions.tsx
+++ b/src/views-components/context-menu/actions/file-viewer-actions.tsx
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from "react";
-import { ListItemText, ListItem, ListItemIcon } from "@material-ui/core";
+import { ListItemText, ListItem, ListItemIcon, Icon } from "@material-ui/core";
 import { RootState } from '~/store/store';
 import { getNodeValue } from '~/models/tree';
 import { CollectionDirectory, CollectionFile, CollectionFileType } from '~/models/collection-file';
@@ -65,7 +65,13 @@ export const FileViewerActions = connect(mapStateToProps)(
                     onClick={onClick}
                     target='_blank'>
                     <ListItemIcon>
-                        <OpenIcon />
+                        {
+                            viewer.iconUrl
+                                ? <Icon>
+                                    <img src={viewer.iconUrl} />
+                                </Icon>
+                                : <OpenIcon />
+                        }
                     </ListItemIcon>
                     <ListItemText>
                         {viewer.name}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list