[ARVADOS-WORKBENCH2] updated: 1.3.0-82-gff2d7aa
Git user
git at public.curoverse.com
Mon Dec 10 17:44:59 EST 2018
Summary of changes:
src/components/data-explorer/data-explorer.tsx | 22 +++++++++++-----------
src/views/user-panel/user-panel.tsx | 19 ++++++++++++-------
2 files changed, 23 insertions(+), 18 deletions(-)
via ff2d7aa039e4d7a4ab6e77b778f161d6ab45dd2e (commit)
from 88f16d1a87decacf3dc395126912684ed90dc16f (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 ff2d7aa039e4d7a4ab6e77b778f161d6ab45dd2e
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Dec 10 23:44:21 2018 +0100
Refactor data-explorer to make it background more customizable, add slot for custom actions
Feature #14505
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index d906a32..b6b9a83 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, WithStyles, TablePagination, IconButton, Tooltip } from '@material-ui/core';
+import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, WithStyles, TablePagination, IconButton, Tooltip, Button } from '@material-ui/core';
import { ColumnSelector } from "~/components/column-selector/column-selector";
import { DataTable, DataColumns } from "~/components/data-table/data-table";
import { DataColumn, SortDirection } from "~/components/data-table/data-column";
@@ -12,8 +12,9 @@ import { ArvadosTheme } from "~/common/custom-theme";
import { createTree } from '~/models/tree';
import { DataTableFilters } from '~/components/data-table-filters/data-table-filters-tree';
import { MoreOptionsIcon } from '~/components/icon/icon';
+import { PaperProps } from '@material-ui/core/Paper';
-type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton' | 'rootUserPanel';
+type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
searchBox: {
@@ -28,10 +29,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
height: '100%'
},
- rootUserPanel: {
- height: '100%',
- boxShadow: 'none'
- },
moreOptionsButton: {
padding: 0
}
@@ -48,7 +45,9 @@ interface DataExplorerDataProps<T> {
contextMenuColumn: boolean;
dataTableDefaultView?: React.ReactNode;
working?: boolean;
- isUserPanel?: boolean;
+ hideColumnSelector?: boolean;
+ paperProps?: PaperProps;
+ actions?: React.ReactNode;
}
interface DataExplorerActionProps<T> {
@@ -79,17 +78,18 @@ export const DataExplorer = withStyles(styles)(
columns, onContextMenu, onFiltersChange, onSortToggle, working, extractKey,
rowsPerPage, rowsPerPageOptions, onColumnToggle, searchValue, onSearch,
items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
- dataTableDefaultView, isUserPanel
+ dataTableDefaultView, hideColumnSelector, actions, paperProps,
} = this.props;
- return <Paper className={!isUserPanel ? classes.root : classes.rootUserPanel}>
- <Toolbar className={!isUserPanel ? classes.toolbar : ''}>
+ return <Paper className={classes.root} {...paperProps}>
+ <Toolbar className={classes.toolbar}>
<Grid container justify="space-between" wrap="nowrap" alignItems="center">
<div className={classes.searchBox}>
<SearchInput
value={searchValue}
onSearch={onSearch} />
</div>
- {!isUserPanel && <ColumnSelector
+ {actions}
+ {!hideColumnSelector && <ColumnSelector
columns={columns}
onColumnToggle={onColumnToggle} />}
</Grid>
diff --git a/src/views/user-panel/user-panel.tsx b/src/views/user-panel/user-panel.tsx
index f28cca3..b152896 100644
--- a/src/views/user-panel/user-panel.tsx
+++ b/src/views/user-panel/user-panel.tsx
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { WithStyles, withStyles, Typography, Tabs, Tab, Paper, Button } from '@material-ui/core';
+import { WithStyles, withStyles, Typography, Tabs, Tab, Paper, Button, Grid } from '@material-ui/core';
import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
import { connect, DispatchProp } from 'react-redux';
import { DataColumns } from '~/components/data-table/data-table';
@@ -163,18 +163,23 @@ export const UserPanel = compose(
</Tabs>
{value === 0 &&
<span>
- <div className={this.props.classes.button}>
- <Button variant="contained" color="primary" onClick={this.props.openUserCreateDialog}>
- <AddIcon /> NEW USER
- </Button>
- </div>
<DataExplorer
id={USERS_PANEL_ID}
onRowClick={this.handleRowClick}
onRowDoubleClick={this.handleRowDoubleClick}
onContextMenu={this.handleContextMenu}
contextMenuColumn={true}
- isUserPanel={true}
+ hideColumnSelector
+ actions={
+ <Grid container justify='flex-end'>
+ <Button variant="contained" color="primary" onClick={this.props.openUserCreateDialog}>
+ <AddIcon /> NEW USER
+ </Button>
+ </Grid>
+ }
+ paperProps={{
+ elevation: 0,
+ }}
dataTableDefaultView={
<DataTableDefaultView
icon={ShareMeIcon}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list