[ARVADOS-WORKBENCH2] updated: 1.2.0-229-gec00e13
Git user
git at public.curoverse.com
Mon Sep 3 11:17:31 EDT 2018
Summary of changes:
src/components/data-explorer/data-explorer.tsx | 5 +--
src/components/icon/icon.tsx | 2 +-
src/views/favorite-panel/favorite-panel.tsx | 3 +-
src/views/project-panel/project-panel.tsx | 3 +-
src/views/trash-panel/trash-panel.tsx | 44 ++++++++++++++++++++++++--
5 files changed, 49 insertions(+), 8 deletions(-)
via ec00e13345fd6731287124ee776e0e4892c1cf13 (commit)
from 59ee572e791985a36bdd2015c9b494145109e8ed (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 ec00e13345fd6731287124ee776e0e4892c1cf13
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date: Mon Sep 3 17:17:26 2018 +0200
Add restore icon in trash panel
Feature #13828
Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index af14db9..ea400b1 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -48,6 +48,7 @@ interface DataExplorerDataProps<T> {
page: number;
defaultIcon: IconType;
defaultMessages: string[];
+ contextMenuColumn: boolean;
}
interface DataExplorerActionProps<T> {
@@ -95,7 +96,7 @@ export const DataExplorer = withStyles(styles)(
</Grid>
</Toolbar>
<DataTable
- columns={[...columns, this.contextMenuColumn]}
+ columns={this.props.contextMenuColumn ? [...columns, this.contextMenuColumn] : columns}
items={items}
onRowClick={(_, item: T) => onRowClick(item)}
onContextMenu={onContextMenu}
@@ -142,7 +143,7 @@ export const DataExplorer = withStyles(styles)(
</IconButton>
</Grid>
- contextMenuColumn = {
+ contextMenuColumn: DataColumn<any> = {
name: "Actions",
selected: true,
configurable: false,
diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index 86a1a68..2af70d8 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -32,7 +32,7 @@ import Person from '@material-ui/icons/Person';
import PersonAdd from '@material-ui/icons/PersonAdd';
import PlayArrow from '@material-ui/icons/PlayArrow';
import RateReview from '@material-ui/icons/RateReview';
-import RestoreFromTrash from '@material-ui/icons/RestoreFromTrash';
+import RestoreFromTrash from '@material-ui/icons/History';
import Search from '@material-ui/icons/Search';
import SettingsApplications from '@material-ui/icons/SettingsApplications';
import Star from '@material-ui/icons/Star';
diff --git a/src/views/favorite-panel/favorite-panel.tsx b/src/views/favorite-panel/favorite-panel.tsx
index b915f98..003a319 100644
--- a/src/views/favorite-panel/favorite-panel.tsx
+++ b/src/views/favorite-panel/favorite-panel.tsx
@@ -176,7 +176,8 @@ export const FavoritePanel = withStyles(styles)(
onRowDoubleClick={this.props.onItemDoubleClick}
onContextMenu={this.props.onContextMenu}
defaultIcon={FavoriteIcon}
- defaultMessages={['Your favorites list is empty.']} />;
+ defaultMessages={['Your favorites list is empty.']}
+ contextMenuColumn={true}/>;
}
}
)
diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx
index d3b0474..cfdeec9 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -183,7 +183,8 @@ export const ProjectPanel = withStyles(styles)(
onRowDoubleClick={this.handleRowDoubleClick}
onContextMenu={this.handleContextMenu}
defaultIcon={ProjectIcon}
- defaultMessages={['Your project is empty.', 'Please create a project or create a collection and upload a data.']} />
+ defaultMessages={['Your project is empty.', 'Please create a project or create a collection and upload a data.']}
+ contextMenuColumn={true}/>
</div>;
}
diff --git a/src/views/trash-panel/trash-panel.tsx b/src/views/trash-panel/trash-panel.tsx
index 4922656..56724ea 100644
--- a/src/views/trash-panel/trash-panel.tsx
+++ b/src/views/trash-panel/trash-panel.tsx
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
+import { IconButton, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
import { DispatchProp, connect } from 'react-redux';
import { DataColumns } from '~/components/data-table/data-table';
@@ -13,13 +13,14 @@ import { SortDirection } from '~/components/data-table/data-column';
import { ResourceKind, TrashableResource } from '~/models/resource';
import { resourceLabel } from '~/common/labels';
import { ArvadosTheme } from '~/common/custom-theme';
-import { TrashIcon } from '~/components/icon/icon';
+import { RestoreFromTrashIcon, TrashIcon } from '~/components/icon/icon';
import { TRASH_PANEL_ID } from "~/store/trash-panel/trash-panel-action";
import { getProperty } from "~/store/properties/properties";
import { PROJECT_PANEL_CURRENT_UUID } from "~/store/project-panel/project-panel-action";
import { openContextMenu, resourceKindToContextMenuKind } from "~/store/context-menu/context-menu-actions";
import { getResource, ResourcesState } from "~/store/resources/resources";
import {
+ renderDate,
ResourceDeleteDate,
ResourceFileSize,
ResourceName,
@@ -28,6 +29,8 @@ import {
} from "~/views-components/data-explorer/renderers";
import { navigateTo } from "~/store/navigation/navigation-action";
import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
+import { toggleCollectionTrashed, toggleProjectTrashed } from "~/store/trash/trash-actions";
+import { Dispatch } from "redux";
type CssRules = "toolbar" | "button";
@@ -53,6 +56,31 @@ export interface TrashPanelFilter extends DataTableFilterItem {
type: ResourceKind;
}
+export const ResourceRestore =
+ connect((state: RootState, props: { uuid: string, dispatch?: Dispatch<any> }) => {
+ const resource = getResource<TrashableResource>(props.uuid)(state.resources);
+ return { resource, dispatch: props.dispatch };
+ })((props: { resource?: TrashableResource, dispatch?: Dispatch<any> }) =>
+ <IconButton onClick={() => {
+ if (props.resource && props.dispatch) {
+ const ctxRes = {
+ name: '',
+ uuid: props.resource.uuid,
+ isTrashed: props.resource.isTrashed,
+ ownerUuid: props.resource.ownerUuid
+ };
+
+ if (props.resource.kind === ResourceKind.PROJECT) {
+ props.dispatch(toggleProjectTrashed(ctxRes));
+ } else if (props.resource.kind === ResourceKind.COLLECTION) {
+ props.dispatch(toggleCollectionTrashed(ctxRes));
+ }
+ }
+ }}>
+ <RestoreFromTrashIcon/>
+ </IconButton>
+ );
+
export const trashPanelColumns: DataColumns<string, TrashPanelFilter> = [
{
name: TrashPanelColumnNames.NAME,
@@ -115,6 +143,15 @@ export const trashPanelColumns: DataColumns<string, TrashPanelFilter> = [
render: uuid => <ResourceDeleteDate uuid={uuid} />,
width: "50px"
},
+ {
+ name: '',
+ selected: true,
+ configurable: false,
+ sortDirection: SortDirection.NONE,
+ filters: [],
+ render: uuid => <ResourceRestore uuid={uuid}/>,
+ width: "50px"
+ }
];
interface TrashPanelDataProps {
@@ -137,7 +174,8 @@ export const TrashPanel = withStyles(styles)(
onRowDoubleClick={this.handleRowDoubleClick}
onContextMenu={this.handleContextMenu}
defaultIcon={TrashIcon}
- defaultMessages={['Your trash list is empty.']}/>
+ defaultMessages={['Your trash list is empty.']}
+ contextMenuColumn={false}/>
;
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list