[ARVADOS-WORKBENCH2] updated: 1.1.4-231-g4b4ef8d
Git user
git at public.curoverse.com
Mon Jul 9 07:01:41 EDT 2018
Summary of changes:
src/components/breadcrumbs/breadcrumbs.test.tsx | 6 +++---
src/components/data-explorer/data-explorer.test.tsx | 7 ++-----
src/components/data-explorer/data-explorer.tsx | 3 ---
src/components/data-table/data-table.test.tsx | 16 ++++++++--------
src/views/project-panel/project-panel.tsx | 4 +---
5 files changed, 14 insertions(+), 22 deletions(-)
via 4b4ef8d9e7c3d65e4d65b8aafb68b294c30e2e28 (commit)
from a3f3b01052abf62ac96bb841747a657268498ad0 (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 4b4ef8d9e7c3d65e4d65b8aafb68b294c30e2e28
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Jul 9 13:01:10 2018 +0200
Clean up after adding context menu to data-explorer and breadcrumbs
Feature #13694
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/components/breadcrumbs/breadcrumbs.test.tsx b/src/components/breadcrumbs/breadcrumbs.test.tsx
index b525554..ef3f888 100644
--- a/src/components/breadcrumbs/breadcrumbs.test.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.test.tsx
@@ -24,7 +24,7 @@ describe("<Breadcrumbs />", () => {
const items = [
{ label: 'breadcrumb 1' }
];
- const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} />);
+ const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />);
expect(breadcrumbs.find(Button)).toHaveLength(1);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(0);
});
@@ -34,7 +34,7 @@ describe("<Breadcrumbs />", () => {
{ label: 'breadcrumb 1' },
{ label: 'breadcrumb 2' }
];
- const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} />);
+ const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />);
expect(breadcrumbs.find(Button)).toHaveLength(2);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(1);
});
@@ -44,7 +44,7 @@ describe("<Breadcrumbs />", () => {
{ label: 'breadcrumb 1' },
{ label: 'breadcrumb 2' }
];
- const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} />);
+ const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />);
breadcrumbs.find(Button).at(1).simulate('click');
expect(onClick).toBeCalledWith(items[1]);
});
diff --git a/src/components/data-explorer/data-explorer.test.tsx b/src/components/data-explorer/data-explorer.test.tsx
index 33899c0..97b1bec 100644
--- a/src/components/data-explorer/data-explorer.test.tsx
+++ b/src/components/data-explorer/data-explorer.test.tsx
@@ -22,8 +22,6 @@ describe("<DataExplorer />", () => {
const onContextAction = jest.fn();
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
- contextActions={[]}
- onContextAction={onContextAction}
items={[{ key: "1", name: "item 1" }] as MockItem[]}
columns={[{ name: "Column 1", render: jest.fn(), selected: true }]} />);
expect(dataExplorer.find(ContextMenu).prop("actions")).toEqual([]);
@@ -54,7 +52,6 @@ describe("<DataExplorer />", () => {
{...mockDataExplorerProps()}
columns={columns}
onColumnToggle={onColumnToggle}
- contextActions={[]}
items={[{ key: "1", name: "item 1" }] as MockItem[]} />);
expect(dataExplorer.find(ColumnSelector).prop("columns")).toBe(columns);
dataExplorer.find(ColumnSelector).prop("onColumnToggle")("columns");
@@ -125,7 +122,7 @@ const mockDataExplorerProps = () => ({
onSortToggle: jest.fn(),
onRowClick: jest.fn(),
onColumnToggle: jest.fn(),
- onContextAction: jest.fn(),
onChangePage: jest.fn(),
- onChangeRowsPerPage: jest.fn()
+ onChangeRowsPerPage: jest.fn(),
+ onContextMenu: jest.fn()
});
\ No newline at end of file
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index c8f6fb8..e90b1c2 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -7,7 +7,6 @@ import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, Theme, WithStyles
import MoreVertIcon from "@material-ui/icons/MoreVert";
import ColumnSelector from "../../components/column-selector/column-selector";
import DataTable, { DataColumns, DataItem } from "../../components/data-table/data-table";
-import { mockAnchorFromMouseEvent } from "../../components/popover/helpers";
import { DataColumn } from "../../components/data-table/data-column";
import { DataTableFilterItem } from '../../components/data-table-filters/data-table-filters';
import SearchInput from '../search-input/search-input';
@@ -28,8 +27,6 @@ interface DataExplorerProps<T> {
onFiltersChange: (filters: DataTableFilterItem[], column: DataColumn<T>) => void;
onChangePage: (page: number) => void;
onChangeRowsPerPage: (rowsPerPage: number) => void;
- openContextMenu: (event: React.MouseEvent<HTMLElement>, item: T) => void;
- closeContextMenu: () => void;
}
class DataExplorer<T extends DataItem> extends React.Component<DataExplorerProps<T> & WithStyles<CssRules>> {
diff --git a/src/components/data-table/data-table.test.tsx b/src/components/data-table/data-table.test.tsx
index 6dbccb5..2ee3507 100644
--- a/src/components/data-table/data-table.test.tsx
+++ b/src/components/data-table/data-table.test.tsx
@@ -40,7 +40,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={jest.fn()} />);
expect(dataTable.find(TableHead).find(TableCell)).toHaveLength(2);
});
@@ -58,7 +58,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={jest.fn()} />);
expect(dataTable.find(TableHead).find(TableCell).text()).toBe("Column 1");
});
@@ -77,7 +77,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={jest.fn()} />);
expect(dataTable.find(TableHead).find(TableCell).text()).toBe("Column Header");
});
@@ -96,7 +96,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={jest.fn()} />);
expect(dataTable.find(TableHead).find(TableCell).key()).toBe("column-1-key");
expect(dataTable.find(TableBody).find(TableCell).key()).toBe("column-1-key");
@@ -120,7 +120,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={jest.fn()} />);
expect(dataTable.find(TableBody).find(Typography).text()).toBe("item 1");
expect(dataTable.find(TableBody).find(Button).text()).toBe("item 1");
@@ -139,7 +139,7 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={jest.fn()}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
+ onContextMenu={jest.fn()}
onSortToggle={onSortToggle} />);
expect(dataTable.find(TableSortLabel).prop("active")).toBeTruthy();
dataTable.find(TableSortLabel).at(0).simulate("click");
@@ -160,8 +160,8 @@ describe("<DataTable />", () => {
items={[{ key: "1", name: "item 1" }] as MockItem[]}
onFiltersChange={onFiltersChange}
onRowClick={jest.fn()}
- onRowContextMenu={jest.fn()}
- onSortToggle={jest.fn()} />);
+ onSortToggle={jest.fn()}
+ onContextMenu={jest.fn()} />);
expect(dataTable.find(DataTableFilters).prop("filters")).toBe(columns[0].filters);
dataTable.find(DataTableFilters).prop("onChange")([]);
expect(onFiltersChange).toHaveBeenCalledWith([], columns[0]);
diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx
index 569a565..2cdb671 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -69,9 +69,7 @@ class ProjectPanel extends React.Component<ProjectPanelProps, DataExplorerState<
<DataExplorer
id={PROJECT_PANEL_ID}
onRowClick={this.props.onItemClick}
- onContextMenu={this.props.onContextMenu}
- openContextMenu={this.openContextMenu}
- closeContextMenu={this.closeContextMenu} />;
+ onContextMenu={this.props.onContextMenu} />;
</div>;
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list