[ARVADOS-WORKBENCH2] created: 1.3.0-5-gc9a1f5a
Git user
git at public.curoverse.com
Mon Dec 3 07:56:20 EST 2018
at c9a1f5adcc0722a71c3930291e2965f3a2054f7f (commit)
commit c9a1f5adcc0722a71c3930291e2965f3a2054f7f
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Dec 3 10:53:39 2018 +0100
Add OpenCollectionFileAction to file context menu
Feature #13540
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
index b556489..23fd305 100644
--- a/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
@@ -6,9 +6,13 @@ import { ContextMenuActionSet } from "../context-menu-action-set";
import { RenameIcon, RemoveIcon } from "~/components/icon/icon";
import { DownloadCollectionFileAction } from "../actions/download-collection-file-action";
import { openFileRemoveDialog, openRenameFileDialog } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
+import { OpenCollectionFileAction } from '~/views-components/context-menu/actions/open-collection-file-action';
export const collectionFilesItemActionSet: ContextMenuActionSet = [[{
+ component: OpenCollectionFileAction,
+ execute: () => { return; }
+},{
name: "Rename",
icon: RenameIcon,
execute: (dispatch, resource) => {
commit ed73b7f27b4aaa66c1434a3cca988e33b71e3c37
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Dec 3 10:53:08 2018 +0100
Set icon for DownloadCollectionFileAction
Feature #13540
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/context-menu/actions/download-collection-file-action.tsx b/src/views-components/context-menu/actions/download-collection-file-action.tsx
index 460e620..310306c 100644
--- a/src/views-components/context-menu/actions/download-collection-file-action.tsx
+++ b/src/views-components/context-menu/actions/download-collection-file-action.tsx
@@ -7,19 +7,22 @@ import { RootState } from "../../../store/store";
import { DownloadAction } from "./download-action";
import { getNodeValue } from "../../../models/tree";
import { CollectionFileType } from "../../../models/collection-file";
+import { DownloadIcon } from '~/components/icon/icon';
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
+ const iconProp = { icon: DownloadIcon };
if (resource) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
if (file) {
return {
href: file.url,
- download: file.type === CollectionFileType.DIRECTORY ? undefined : file.name
+ download: file.type === CollectionFileType.DIRECTORY ? undefined : file.name,
+ ...iconProp,
};
}
}
- return {};
+ return iconProp;
};
export const DownloadCollectionFileAction = connect(mapStateToProps)(DownloadAction);
commit b8fdb29b0f745d6f946a14ca209cc218976ffebf
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Dec 3 10:52:22 2018 +0100
Create OpenCollectionFileAction
Feature #13540
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/context-menu/actions/open-collection-file-action.tsx b/src/views-components/context-menu/actions/open-collection-file-action.tsx
new file mode 100644
index 0000000..e8073d4
--- /dev/null
+++ b/src/views-components/context-menu/actions/open-collection-file-action.tsx
@@ -0,0 +1,26 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { connect } from "react-redux";
+import { RootState } from "~/store/store";
+import { DownloadAction } from "./download-action";
+import { getNodeValue } from "~/models/tree";
+import { OpenFileIcon } from "~/components/icon/icon";
+
+const mapStateToProps = (state: RootState) => {
+ const { resource } = state.contextMenu;
+ const iconProp = { icon: OpenFileIcon };
+ if (resource) {
+ const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
+ if (file) {
+ return {
+ href: file.url,
+ ...iconProp,
+ };
+ }
+ }
+ return iconProp;
+};
+
+export const OpenCollectionFileAction = connect(mapStateToProps)(DownloadAction);
commit af142bf46c18034a007b22c647b5eb418bfff1d2
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Dec 3 10:50:50 2018 +0100
Update DownloadAction to use icon passed via props
Feature #13540
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/context-menu/actions/download-action.tsx b/src/views-components/context-menu/actions/download-action.tsx
index 1f6979d..876b14c 100644
--- a/src/views-components/context-menu/actions/download-action.tsx
+++ b/src/views-components/context-menu/actions/download-action.tsx
@@ -4,9 +4,9 @@
import * as React from "react";
import { ListItemIcon, ListItemText, Button, ListItem } from "@material-ui/core";
-import { DownloadIcon } from "../../../components/icon/icon";
+import { DownloadIcon, IconType } from "../../../components/icon/icon";
-export const DownloadAction = (props: { href?: string, download?: string, onClick?: () => void }) => {
+export const DownloadAction = (props: { href?: string, download?: string, onClick?: () => void, icon?: IconType }) => {
const targetProps = props.download ? {} : { target: '_blank' };
const downloadProps = props.download ? { download: props.download } : {};
return props.href
@@ -17,9 +17,11 @@ export const DownloadAction = (props: { href?: string, download?: string, onClic
{...targetProps}
{...downloadProps}>
<ListItem button>
- <ListItemIcon>
- <DownloadIcon />
- </ListItemIcon>
+ {props.icon &&
+ <ListItemIcon>
+ <props.icon />
+ </ListItemIcon>
+ }
<ListItemText>
Download
</ListItemText>
commit 61b5202865af2648b9b54256eba53ba1c594bcbc
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Fri Nov 30 13:37:42 2018 +0100
Add OpenFileIcon
Feature #13540
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index 8049686..91d4c3e 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -37,6 +37,7 @@ import MoreVert from '@material-ui/icons/MoreVert';
import Mail from '@material-ui/icons/Mail';
import MoveToInbox from '@material-ui/icons/MoveToInbox';
import Notifications from '@material-ui/icons/Notifications';
+import OpenInNew from '@material-ui/icons/OpenInNew';
import People from '@material-ui/icons/People';
import Person from '@material-ui/icons/Person';
import PersonAdd from '@material-ui/icons/PersonAdd';
@@ -81,6 +82,7 @@ export const MoreOptionsIcon: IconType = (props) => <MoreVert {...props} />;
export const MoveToIcon: IconType = (props) => <Input {...props} />;
export const NewProjectIcon: IconType = (props) => <CreateNewFolder {...props} />;
export const NotificationIcon: IconType = (props) => <Notifications {...props} />;
+export const OpenFileIcon: IconType = (props) => <OpenInNew {...props}/>;
export const OutputIcon: IconType = (props) => <MoveToInbox {...props} />;
export const PaginationDownIcon: IconType = (props) => <ArrowDropDown {...props} />;
export const PaginationLeftArrowIcon: IconType = (props) => <ChevronLeft {...props} />;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list