[ARVADOS-WORKBENCH2] updated: 1.1.4-67-gdbb23fe
Git user
git at public.curoverse.com
Thu Jun 14 09:25:06 EDT 2018
Summary of changes:
src/components/data-explorer/column.ts | 8 ++-
.../columns-configurator/columns-configurator.tsx | 20 +++----
src/components/data-explorer/data-explorer.tsx | 6 +-
.../project-explorer/project-explorer.tsx | 70 ++++++++++++----------
4 files changed, 57 insertions(+), 47 deletions(-)
via dbb23fe7623260b495ad64f0601feefdd103d376 (commit)
from 799ab572df62562e8634e0e76683c3973c8337c4 (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 dbb23fe7623260b495ad64f0601feefdd103d376
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Thu Jun 14 15:24:51 2018 +0200
Extend column with headerRender and configurable properties, apply these properties
Feature #13601
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/components/data-explorer/column.ts b/src/components/data-explorer/column.ts
index bbbc6ef..6681f63 100644
--- a/src/components/data-explorer/column.ts
+++ b/src/components/data-explorer/column.ts
@@ -5,5 +5,11 @@
export interface Column<T> {
header: string;
selected: boolean;
+ configurable?: boolean;
render: (item: T) => React.ReactElement<void>;
-}
\ No newline at end of file
+ renderHeader?: () => React.ReactElement<void>;
+}
+
+export const isColumnConfigurable = <T>(column: Column<T>) => {
+ return column.configurable === undefined || column.configurable === true;
+};
\ No newline at end of file
diff --git a/src/components/data-explorer/columns-configurator/columns-configurator.tsx b/src/components/data-explorer/columns-configurator/columns-configurator.tsx
index a46d224..c729ca8 100644
--- a/src/components/data-explorer/columns-configurator/columns-configurator.tsx
+++ b/src/components/data-explorer/columns-configurator/columns-configurator.tsx
@@ -5,7 +5,7 @@
import * as React from 'react';
import { WithStyles, StyleRulesCallback, Theme, withStyles, IconButton, Paper, List, Checkbox, ListItemText, ListItem, Typography, ListSubheader } from '@material-ui/core';
import MenuIcon from "@material-ui/icons/Menu";
-import { Column } from '../column';
+import { Column, isColumnConfigurable } from '../column';
import { PopoverOrigin } from '@material-ui/core/Popover';
import Popover from "../../popover/popover";
import { IconButtonProps } from '@material-ui/core/IconButton';
@@ -20,17 +20,15 @@ const ColumnsConfigurator: React.SFC<ColumnsConfiguratorProps & WithStyles<CssRu
<Popover triggerComponent={ColumnsConfiguratorTrigger}>
<Paper>
<List dense>
- <ListSubheader>
- Configure table columns
- </ListSubheader>
{
- columns.map((column, index) => (
- <ListItem key={index} button onClick={() => onColumnToggle(column)}>
- <Checkbox disableRipple color="primary" checked={column.selected} className={classes.checkbox} />
- <ListItemText>{column.header}</ListItemText>
- </ListItem>
-
- ))
+ columns
+ .filter(isColumnConfigurable)
+ .map((column, index) => (
+ <ListItem key={index} button onClick={() => onColumnToggle(column)}>
+ <Checkbox disableRipple color="primary" checked={column.selected} className={classes.checkbox} />
+ <ListItemText>{column.header}</ListItemText>
+ </ListItem>
+ ))
}
</List>
</Paper>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index f24d344..05c157f 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -29,8 +29,10 @@ class DataExplorer<T> extends React.Component<DataExplorerProps<T> & WithStyles<
<TableHead>
<TableRow>
{
- columns.filter(column => column.selected).map((column, index) => (
- <TableCell key={index}>{column.header}</TableCell>
+ columns.filter(column => column.selected).map(({ header, renderHeader }, index) => (
+ <TableCell key={index}>
+ {renderHeader ? renderHeader() : header}
+ </TableCell>
))
}
</TableRow>
diff --git a/src/components/project-explorer/project-explorer.tsx b/src/components/project-explorer/project-explorer.tsx
index 73d232b..18910bf 100644
--- a/src/components/project-explorer/project-explorer.tsx
+++ b/src/components/project-explorer/project-explorer.tsx
@@ -90,41 +90,45 @@ class ProjectExplorer extends React.Component<ProjectExplorerProps, ProjectExplo
{
header: "Actions",
selected: true,
+ configurable: false,
+ renderHeader: () => <span/>,
render: item => (
- <Popover triggerComponent={ItemActionsTrigger}>
- <List dense>
- {[
+ <Grid container justify="flex-end">
+ <Popover triggerComponent={ItemActionsTrigger}>
+ <List dense>
+ {[
+ {
+ icon: "fas fa-users",
+ label: "Share"
+ },
+ {
+ icon: "fas fa-sign-out-alt",
+ label: "Move to"
+ },
+ {
+ icon: "fas fa-star",
+ label: "Add to favourite"
+ },
+ {
+ icon: "fas fa-edit",
+ label: "Rename"
+ },
+ {
+ icon: "fas fa-copy",
+ label: "Make a copy"
+ },
+ {
+ icon: "fas fa-download",
+ label: "Download"
+ }].map(renderAction)
+ }
+ < Divider />
{
- icon: "fas fa-users",
- label: "Share"
- },
- {
- icon: "fas fa-sign-out-alt",
- label: "Move to"
- },
- {
- icon: "fas fa-star",
- label: "Add to favourite"
- },
- {
- icon: "fas fa-edit",
- label: "Rename"
- },
- {
- icon: "fas fa-copy",
- label: "Make a copy"
- },
- {
- icon: "fas fa-download",
- label: "Download"
- }].map(renderAction)
- }
- < Divider />
- {
- renderAction({ icon: "fas fa-trash-alt", label: "Remove" })
- }
- </List>
- </Popover>
+ renderAction({ icon: "fas fa-trash-alt", label: "Remove" })
+ }
+ </List>
+ </Popover>
+ </Grid>
)
}
]
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list