[ARVADOS-WORKBENCH2] updated: 1.4.1-280-g6f5c42c1
Git user
git at public.arvados.org
Mon Apr 13 20:10:58 UTC 2020
Summary of changes:
src/components/column-selector/column-selector.tsx | 4 +-
.../data-table-filters-popover.test.tsx | 24 +++
.../data-table-filters-popover.tsx | 11 +-
.../data-table-filters/data-table-filters-tree.tsx | 10 +-
.../data-table-filters/data-table-filters.test.tsx | 27 ---
.../data-table-filters/data-table-filters.tsx | 200 ---------------------
src/components/data-table/data-table.test.tsx | 25 +--
src/components/tree/tree.tsx | 21 +--
yarn.lock | 57 +++---
9 files changed, 66 insertions(+), 313 deletions(-)
create mode 100644 src/components/data-table-filters/data-table-filters-popover.test.tsx
delete mode 100644 src/components/data-table-filters/data-table-filters.test.tsx
via 6f5c42c1239fe585b805088eb2b4baf783584cc7 (commit)
via 877b4f6e64dcd96b31e2ffc1610520d373c1a033 (commit)
via 17ed55d1651843fc0ecf0ff5d62db80adfc842a1 (commit)
via 188c5c005b522683143d76d26529d37b88171ba9 (commit)
via 9593a6d5074b5aa817583941089207280dc74c64 (commit)
via f1e3bc95a43facf190d5f4250299fab0a267d10b (commit)
via b76d55cc985f22cab2f59ec725f8b8a1b88d003e (commit)
via 65f7ca2fd28e49891f942b639be43dc4f594a379 (commit)
from 5924c2b69f48a6b91243d1593b4f16bab0eace56 (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 6f5c42c1239fe585b805088eb2b4baf783584cc7
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Apr 6 17:15:30 2020 -0300
Upgrades vulnerable minimist module by upgrading handlebars (2 levels up).
No issue #
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/yarn.lock b/yarn.lock
index 876d073e..8ed5fe10 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4549,13 +4549,14 @@ handle-thing@^2.0.0:
integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==
handlebars@^4.0.3:
- version "4.7.2"
- resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.2.tgz#01127b3840156a0927058779482031afe0e730d7"
- integrity sha512-4PwqDL2laXtTWZghzzCtunQUTLbo31pcCJrd/B/9JP8XbhVzpS5ZXuKqlOzsd1rtcaLo4KqAn8nl8mkknS4MHw==
+ version "4.7.6"
+ resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
+ integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
dependencies:
+ minimist "^1.2.5"
neo-async "^2.6.0"
- optimist "^0.6.1"
source-map "^0.6.1"
+ wordwrap "^1.0.0"
optionalDependencies:
uglify-js "^3.1.4"
@@ -6780,16 +6781,11 @@ minimist at 0.0.8:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
-minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
+minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
-minimist@~0.0.1:
- version "0.0.10"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
- integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=
-
mississippi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f"
@@ -7335,14 +7331,6 @@ opn@^5.1.0, opn@^5.5.0:
dependencies:
is-wsl "^1.1.0"
-optimist@^0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
- integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY=
- dependencies:
- minimist "~0.0.1"
- wordwrap "~0.0.2"
-
optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
@@ -11008,10 +10996,10 @@ wordwrap at 0.0.2:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=
-wordwrap@~0.0.2:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
- integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc=
+wordwrap@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
+ integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
worker-farm@^1.3.1, worker-farm@^1.5.2, worker-farm@^1.7.0:
version "1.7.0"
commit 877b4f6e64dcd96b31e2ffc1610520d373c1a033
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Apr 6 16:59:19 2020 -0300
Upgrades minimist package (indirect dependency) to address CVE-2020-7598.
No issue #
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/yarn.lock b/yarn.lock
index 44b098f0..876d073e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6781,9 +6781,9 @@ minimist at 0.0.8:
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
- integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
+ integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
minimist@~0.0.1:
version "0.0.10"
commit 17ed55d1651843fc0ecf0ff5d62db80adfc842a1
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Apr 6 16:51:53 2020 -0300
Upgrades acorn package (indirect dependency) to address a security issue.
https://www.npmjs.com/advisories/1488
No issue #
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/yarn.lock b/yarn.lock
index 41aaa359..44b098f0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -584,19 +584,14 @@ acorn@^4.0.3, acorn@^4.0.4:
integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=
acorn@^5.0.0, acorn@^5.5.3:
- version "5.7.3"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
- integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
-
-acorn@^6.0.1:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
- integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==
-
-acorn@^6.2.1:
- version "6.3.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e"
- integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==
+ version "5.7.4"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e"
+ integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==
+
+acorn@^6.0.1, acorn@^6.2.1:
+ version "6.4.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
+ integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
address at 1.0.3:
version "1.0.3"
commit 188c5c005b522683143d76d26529d37b88171ba9
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Mar 10 19:11:42 2020 -0300
15951: Fixes 'select columns' button tooltip label & behavior.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/column-selector/column-selector.tsx b/src/components/column-selector/column-selector.tsx
index ccff6181..566bb9d6 100644
--- a/src/components/column-selector/column-selector.tsx
+++ b/src/components/column-selector/column-selector.tsx
@@ -55,8 +55,8 @@ export const ColumnSelector = withStyles(styles)(
);
export const ColumnSelectorTrigger = (props: IconButtonProps) =>
- <Tooltip title="Filters">
+ <Tooltip disableFocusListener title="Select columns">
<IconButton {...props}>
- <MenuIcon aria-label="Filters" />
+ <MenuIcon aria-label="Select columns" />
</IconButton>
</Tooltip>;
commit 9593a6d5074b5aa817583941089207280dc74c64
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Mar 3 22:37:21 2020 -0300
15951: Removes dead code, updates tests to work with component being used.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/data-table-filters/data-table-filters-popover.test.tsx b/src/components/data-table-filters/data-table-filters-popover.test.tsx
new file mode 100644
index 00000000..f7bd00f0
--- /dev/null
+++ b/src/components/data-table-filters/data-table-filters-popover.test.tsx
@@ -0,0 +1,24 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { mount, configure } from "enzyme";
+import { DataTableFiltersPopover } from "./data-table-filters-popover";
+import * as Adapter from 'enzyme-adapter-react-16';
+import { Checkbox, IconButton } from "@material-ui/core";
+import { getInitialProcessStatusFilters } from "~/store/resource-type-filters/resource-type-filters"
+
+configure({ adapter: new Adapter() });
+
+describe("<DataTableFiltersPopover />", () => {
+ it("renders filters according to their state", () => {
+ // 1st filter (All) is selected, the rest aren't.
+ const filters = getInitialProcessStatusFilters()
+
+ const dataTableFilter = mount(<DataTableFiltersPopover name="" filters={filters} />);
+ dataTableFilter.find(IconButton).simulate("click");
+ expect(dataTableFilter.find(Checkbox).at(0).prop("checked")).toBeTruthy();
+ expect(dataTableFilter.find(Checkbox).at(1).prop("checked")).toBeFalsy();
+ });
+});
diff --git a/src/components/data-table-filters/data-table-filters.test.tsx b/src/components/data-table-filters/data-table-filters.test.tsx
deleted file mode 100644
index dc1969f4..00000000
--- a/src/components/data-table-filters/data-table-filters.test.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import * as React from "react";
-import { mount, configure } from "enzyme";
-import { DataTableFilters } from "./data-table-filters";
-import * as Adapter from 'enzyme-adapter-react-16';
-import { Checkbox, ButtonBase } from "@material-ui/core";
-
-configure({ adapter: new Adapter() });
-
-describe("<DataTableFilter />", () => {
- it("renders filters according to their state", () => {
- const filters = [{
- name: "Filter 1",
- selected: true
- }, {
- name: "Filter 2",
- selected: false
- }];
- const dataTableFilter = mount(<DataTableFilters name="" filters={filters} />);
- dataTableFilter.find(ButtonBase).simulate("click");
- expect(dataTableFilter.find(Checkbox).at(0).prop("checked")).toBeTruthy();
- expect(dataTableFilter.find(Checkbox).at(1).prop("checked")).toBeFalsy();
- });
-});
diff --git a/src/components/data-table-filters/data-table-filters.tsx b/src/components/data-table-filters/data-table-filters.tsx
index a57f29aa..ed7b30e7 100644
--- a/src/components/data-table-filters/data-table-filters.tsx
+++ b/src/components/data-table-filters/data-table-filters.tsx
@@ -2,207 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import * as React from "react";
-import {
- WithStyles,
- withStyles,
- ButtonBase,
- StyleRulesCallback,
- Theme,
- Popover,
- List,
- ListItem,
- Checkbox,
- ListItemText,
- Button,
- Card,
- CardActions,
- Typography,
- CardContent,
- Tooltip
-} from "@material-ui/core";
-import * as classnames from "classnames";
-import { DefaultTransformOrigin } from "../popover/helpers";
-import { createTree, initTreeNode, mapTree } from '~/models/tree';
-import { DataTableFilters as DataTableFiltersModel, DataTableFiltersTree } from "./data-table-filters-tree";
-import { pipe } from 'lodash/fp';
-import { setNode } from '~/models/tree';
-
-export type CssRules = "root" | "icon" | "active" | "checkbox";
-
-const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
- root: {
- cursor: "pointer",
- display: "inline-flex",
- justifyContent: "flex-start",
- flexDirection: "inherit",
- alignItems: "center",
- "&:hover": {
- color: theme.palette.text.primary,
- },
- "&:focus": {
- color: theme.palette.text.primary,
- },
- },
- active: {
- color: theme.palette.text.primary,
- '& $icon': {
- opacity: 1,
- },
- },
- icon: {
- marginRight: 4,
- marginLeft: 4,
- opacity: 0.7,
- userSelect: "none",
- width: 16
- },
- checkbox: {
- width: 24,
- height: 24
- }
-});
-
export interface DataTableFilterItem {
name: string;
selected: boolean;
}
-
-export interface DataTableFilterProps {
- name: string;
- filters: DataTableFilterItem[];
- onChange?: (filters: DataTableFilterItem[]) => void;
-}
-
-interface DataTableFilterState {
- anchorEl?: HTMLElement;
- filters: DataTableFilterItem[];
- prevFilters: DataTableFilterItem[];
- filtersTree: DataTableFiltersModel;
-}
-
-const filters: DataTableFiltersModel = pipe(
- createTree,
- setNode(initTreeNode({ id: 'Project', value: { name: 'Project' } })),
- setNode(initTreeNode({ id: 'Process', value: { name: 'Process' } })),
- setNode(initTreeNode({ id: 'Data collection', value: { name: 'Data collection' } })),
- setNode(initTreeNode({ id: 'General', parent: 'Data collection', value: { name: 'General' } })),
- setNode(initTreeNode({ id: 'Output', parent: 'Data collection', value: { name: 'Output' } })),
- setNode(initTreeNode({ id: 'Log', parent: 'Data collection', value: { name: 'Log' } })),
- mapTree(node => ({...node, selected: true})),
-)();
-
-export const DataTableFilters = withStyles(styles)(
- class extends React.Component<DataTableFilterProps & WithStyles<CssRules>, DataTableFilterState> {
- state: DataTableFilterState = {
- anchorEl: undefined,
- filters: [],
- prevFilters: [],
- filtersTree: filters,
- };
- icon = React.createRef<HTMLElement>();
-
- render() {
- const { name, classes, children } = this.props;
- const isActive = this.state.filters.some(f => f.selected);
- return <>
- <Tooltip title='Filters'>
- <ButtonBase
- className={classnames([classes.root, { [classes.active]: isActive }])}
- component="span"
- onClick={this.open}
- disableRipple>
- {children}
- <i className={classnames(["fas fa-filter", classes.icon])}
- data-fa-transform="shrink-3"
- ref={this.icon} />
- </ButtonBase>
- </Tooltip>
- <Popover
- anchorEl={this.state.anchorEl}
- open={!!this.state.anchorEl}
- anchorOrigin={DefaultTransformOrigin}
- transformOrigin={DefaultTransformOrigin}
- onClose={this.cancel}>
- <Card>
- <CardContent>
- <Typography variant="caption">
- {name}
- </Typography>
- </CardContent>
- <List dense>
- {this.state.filters.map((filter, index) =>
- <ListItem
- key={index}>
- <Checkbox
- onClick={this.toggleFilter(filter)}
- color="primary"
- checked={filter.selected}
- className={classes.checkbox} />
- <ListItemText>
- {filter.name}
- </ListItemText>
- </ListItem>
- )}
- </List>
- <DataTableFiltersTree
- filters={this.state.filtersTree}
- onChange={filtersTree => this.setState({ filtersTree })} />
- <CardActions>
- <Button
- color="primary"
- variant='contained'
- size="small"
- onClick={this.submit}>
- Ok
- </Button>
- <Button
- color="primary"
- variant="outlined"
- size="small"
- onClick={this.cancel}>
- Cancel
- </Button>
- </CardActions >
- </Card>
- </Popover>
- </>;
- }
-
- static getDerivedStateFromProps(props: DataTableFilterProps, state: DataTableFilterState): DataTableFilterState {
- return props.filters !== state.prevFilters
- ? { ...state, filters: props.filters, prevFilters: props.filters }
- : state;
- }
-
- open = () => {
- this.setState({ anchorEl: this.icon.current || undefined });
- }
-
- submit = () => {
- const { onChange } = this.props;
- if (onChange) {
- onChange(this.state.filters);
- }
- this.setState({ anchorEl: undefined });
- }
-
- cancel = () => {
- this.setState(prev => ({
- ...prev,
- filters: prev.prevFilters,
- anchorEl: undefined
- }));
- }
-
- toggleFilter = (toggledFilter: DataTableFilterItem) => () => {
- this.setState(prev => ({
- ...prev,
- filters: prev.filters.map(filter =>
- filter === toggledFilter
- ? { ...filter, selected: !filter.selected }
- : filter)
- }));
- }
- }
-);
diff --git a/src/components/data-table/data-table.test.tsx b/src/components/data-table/data-table.test.tsx
index d0b83b96..3e4cc212 100644
--- a/src/components/data-table/data-table.test.tsx
+++ b/src/components/data-table/data-table.test.tsx
@@ -8,7 +8,6 @@ import { pipe } from 'lodash/fp';
import { TableHead, TableCell, Typography, TableBody, Button, TableSortLabel } from "@material-ui/core";
import * as Adapter from "enzyme-adapter-react-16";
import { DataTable, DataColumns } from "./data-table";
-import { DataTableFilters } from "~/components/data-table-filters/data-table-filters";
import { SortDirection, createDataColumn } from "./data-column";
import { DataTableFiltersPopover } from '~/components/data-table-filters/data-table-filters-popover';
import { createTree, setNode, initTreeNode } from '~/models/tree';
@@ -162,7 +161,7 @@ describe("<DataTable />", () => {
expect(onSortToggle).toHaveBeenCalledWith(columns[0]);
});
- it("does not display <DataTableFilter /> if there is no filters provided", () => {
+ it("does not display <DataTableFiltersPopover /> if there is no filters provided", () => {
const columns: DataColumns<string> = [{
name: "Column 1",
sortDirection: SortDirection.ASC,
@@ -180,7 +179,7 @@ describe("<DataTable />", () => {
onRowDoubleClick={jest.fn()}
onSortToggle={jest.fn()}
onContextMenu={jest.fn()} />);
- expect(dataTable.find(DataTableFilters)).toHaveLength(0);
+ expect(dataTable.find(DataTableFiltersPopover)).toHaveLength(0);
});
it("passes filter props to <DataTableFiltersPopover />", () => {
@@ -209,24 +208,4 @@ describe("<DataTable />", () => {
dataTable.find(DataTableFiltersPopover).prop("onChange")([]);
expect(onFiltersChange).toHaveBeenCalledWith([], columns[0]);
});
-
- // it("shows default view if there is no items", () => {
- // const columns: DataColumns<string> = [
- // createDataColumn({
- // name: "Column 1",
- // render: () => <span />,
- // selected: true,
- // configurable: true
- // }),
- // ];
- // const dataTable = mount(<DataTable
- // columns={columns}
- // items={[]}
- // onFiltersChange={jest.fn()}
- // onRowClick={jest.fn()}
- // onRowDoubleClick={jest.fn()}
- // onContextMenu={jest.fn()}
- // onSortToggle={jest.fn()} />);
- // expect(dataTable.find(DataTableDefaultView)).toHaveLength(1);
- // });
});
commit f1e3bc95a43facf190d5f4250299fab0a267d10b
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Mar 3 21:42:12 2020 -0300
15951: Hides tooltips on filter buttons after being clicked.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/data-table-filters/data-table-filters-popover.tsx b/src/components/data-table-filters/data-table-filters-popover.tsx
index 30b98d33..456d2375 100644
--- a/src/components/data-table-filters/data-table-filters-popover.tsx
+++ b/src/components/data-table-filters/data-table-filters-popover.tsx
@@ -108,7 +108,7 @@ export const DataTableFiltersPopover = withStyles(styles)(
: f.selected
);
return <>
- <Tooltip title='Filters'>
+ <Tooltip disableFocusListener title='Filters'>
<ButtonBase
className={classnames([classes.root, { [classes.active]: isActive }])}
component="span"
commit b76d55cc985f22cab2f59ec725f8b8a1b88d003e
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Mar 3 21:20:28 2020 -0300
15951: Accepts filter toggle actions when clicking on the entire row.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/data-table-filters/data-table-filters-tree.tsx b/src/components/data-table-filters/data-table-filters-tree.tsx
index be08743e..5f0d5e39 100644
--- a/src/components/data-table-filters/data-table-filters-tree.tsx
+++ b/src/components/data-table-filters/data-table-filters-tree.tsx
@@ -39,9 +39,12 @@ export class DataTableFiltersTree extends React.Component<DataTableFilterProps>
useRadioButtons={this.props.mutuallyExclusive}
disableRipple
onContextMenu={noop}
- toggleItemActive={this.props.mutuallyExclusive ? this.toggleRadioButtonFilter : noop}
+ toggleItemActive={
+ this.props.mutuallyExclusive
+ ? this.toggleRadioButtonFilter
+ : this.toggleFilter
+ }
toggleItemOpen={this.toggleOpen}
- toggleItemSelection={this.toggleFilter}
/>;
}
commit 65f7ca2fd28e49891f942b639be43dc4f594a379
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Mar 3 18:45:05 2020 -0300
15951: Makes 'mutually exclusive' filter dialog auto-submit selection on click.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/data-table-filters/data-table-filters-popover.tsx b/src/components/data-table-filters/data-table-filters-popover.tsx
index 670afa95..30b98d33 100644
--- a/src/components/data-table-filters/data-table-filters-popover.tsx
+++ b/src/components/data-table-filters/data-table-filters-popover.tsx
@@ -139,7 +139,15 @@ export const DataTableFiltersPopover = withStyles(styles)(
mutuallyExclusive={this.props.mutuallyExclusive}
onChange={filters => {
this.setState({ filters });
+ if (this.props.mutuallyExclusive) {
+ const { onChange } = this.props;
+ if (onChange) {
+ onChange(filters);
+ }
+ this.setState({ anchorEl: undefined });
+ }
}} />
+ {this.props.mutuallyExclusive ||
<CardActions>
<Button
color="primary"
@@ -156,6 +164,7 @@ export const DataTableFiltersPopover = withStyles(styles)(
Cancel
</Button>
</CardActions >
+ }
</Card>
</Popover>
</>;
diff --git a/src/components/data-table-filters/data-table-filters-tree.tsx b/src/components/data-table-filters/data-table-filters-tree.tsx
index d964012d..be08743e 100644
--- a/src/components/data-table-filters/data-table-filters-tree.tsx
+++ b/src/components/data-table-filters/data-table-filters-tree.tsx
@@ -37,10 +37,9 @@ export class DataTableFiltersTree extends React.Component<DataTableFilterProps>
render={renderItem}
showSelection
useRadioButtons={this.props.mutuallyExclusive}
- toggleItemRadioButton={this.toggleRadioButtonFilter}
disableRipple
onContextMenu={noop}
- toggleItemActive={noop}
+ toggleItemActive={this.props.mutuallyExclusive ? this.toggleRadioButtonFilter : noop}
toggleItemOpen={this.toggleOpen}
toggleItemSelection={this.toggleFilter}
/>;
@@ -50,7 +49,7 @@ export class DataTableFiltersTree extends React.Component<DataTableFilterProps>
* Handler for when a tree item is toggled via a radio button.
* Ensures mutual exclusivity among filter tree items.
*/
- toggleRadioButtonFilter = (item: TreeItem<DataTableFilterItem>) => {
+ toggleRadioButtonFilter = (_: any, item: TreeItem<DataTableFilterItem>) => {
const { onChange = noop } = this.props;
// If the filter is already selected, do nothing.
diff --git a/src/components/tree/tree.tsx b/src/components/tree/tree.tsx
index 67858e9b..76fbf011 100644
--- a/src/components/tree/tree.tsx
+++ b/src/components/tree/tree.tsx
@@ -98,15 +98,9 @@ export interface TreeProps<T> {
/**
* When set to true use radio buttons instead of checkboxes for item selection.
* This does not guarantee radio group behavior (i.e item mutual exclusivity).
- * Any item selection logic must be done in the toggleItemRadioButton callback prop.
+ * Any item selection logic must be done in the toggleItemActive callback prop.
*/
useRadioButtons?: boolean;
-
- /**
- * Called when selection of an item in the tree is toggled via a radio button.
- * Use this callback prop to implement any selection logic (i.e item mutual exclusivity).
- */
- toggleItemRadioButton?: (item: TreeItem<T>) => void;
}
export const Tree = withStyles(styles)(
@@ -151,8 +145,7 @@ export const Tree = withStyles(styles)(
<Radio
checked={it.selected}
className={classes.checkbox}
- color="primary"
- onChange={this.handleRadioButtonChange(it)} />}
+ color="primary" />}
<div className={renderContainer}>
{render(it, level)}
</div>
@@ -207,16 +200,6 @@ export const Tree = withStyles(styles)(
: undefined;
}
- handleRadioButtonChange = (item: TreeItem<T>) => {
- const { toggleItemRadioButton } = this.props;
- return toggleItemRadioButton
- ? (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => {
- event.stopPropagation();
- toggleItemRadioButton(item);
- }
- : undefined;
- }
-
handleToggleItemOpen = (item: TreeItem<T>) => (event: React.MouseEvent<HTMLElement>) => {
event.stopPropagation();
this.props.toggleItemOpen(event, item);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list