[ARVADOS-WORKBENCH2] updated: 1.2.0-131-gcad9f25
Git user
git at public.curoverse.com
Thu Aug 23 09:01:34 EDT 2018
Summary of changes:
.../data-explorer/data-explorer.test.tsx | 23 +++++++++++++++-------
.../collection-copy-dialog.ts | 6 +++---
.../copy-dialog/copy-collection-dialog.tsx | 4 ++--
src/views-components/copy-dialog/copy-dialog.tsx | 4 ++--
4 files changed, 23 insertions(+), 14 deletions(-)
via cad9f25fc5e75f6e4f09fe90abd42d0cd10eb492 (commit)
from f8a43920a3a9808e4aad77a73c5966b800e34882 (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 cad9f25fc5e75f6e4f09fe90abd42d0cd10eb492
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Thu Aug 23 15:01:18 2018 +0200
cr changes + tests fix
Feature #13897
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/components/data-explorer/data-explorer.test.tsx b/src/components/data-explorer/data-explorer.test.tsx
index a34ab1c..3e447b4 100644
--- a/src/components/data-explorer/data-explorer.test.tsx
+++ b/src/components/data-explorer/data-explorer.test.tsx
@@ -13,6 +13,7 @@ import { SearchInput } from "../search-input/search-input";
import { TablePagination } from "@material-ui/core";
import { ProjectIcon } from '../icon/icon';
import { DefaultView } from '../default-view/default-view';
+import { SortDirection } from '../data-table/data-column';
configure({ adapter: new Adapter() });
@@ -20,11 +21,13 @@ describe("<DataExplorer />", () => {
it("communicates with <SearchInput/>", () => {
const onSearch = jest.fn();
+ const onSetColumns = jest.fn();
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
items={[{ name: "item 1" }]}
searchValue="search value"
- onSearch={onSearch} />);
+ onSearch={onSearch}
+ onSetColumns={onSetColumns} />);
expect(dataExplorer.find(SearchInput).prop("value")).toEqual("search value");
dataExplorer.find(SearchInput).prop("onSearch")("new value");
expect(onSearch).toHaveBeenCalledWith("new value");
@@ -32,12 +35,14 @@ describe("<DataExplorer />", () => {
it("communicates with <ColumnSelector/>", () => {
const onColumnToggle = jest.fn();
- const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true }];
+ const onSetColumns = jest.fn();
+ const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: [] }];
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
columns={columns}
onColumnToggle={onColumnToggle}
- items={[{ name: "item 1" }]} />);
+ items={[{ name: "item 1" }]}
+ onSetColumns={onSetColumns} />);
expect(dataExplorer.find(ColumnSelector).prop("columns")).toBe(columns);
dataExplorer.find(ColumnSelector).prop("onColumnToggle")("columns");
expect(onColumnToggle).toHaveBeenCalledWith("columns");
@@ -47,7 +52,8 @@ describe("<DataExplorer />", () => {
const onFiltersChange = jest.fn();
const onSortToggle = jest.fn();
const onRowClick = jest.fn();
- const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true }];
+ const onSetColumns = jest.fn();
+ const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: [] }];
const items = [{ name: "item 1" }];
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
@@ -55,7 +61,8 @@ describe("<DataExplorer />", () => {
items={items}
onFiltersChange={onFiltersChange}
onSortToggle={onSortToggle}
- onRowClick={onRowClick} />);
+ onRowClick={onRowClick}
+ onSetColumns={onSetColumns} />);
expect(dataExplorer.find(DataTable).prop("columns").slice(0, -1)).toEqual(columns);
expect(dataExplorer.find(DataTable).prop("items")).toBe(items);
dataExplorer.find(DataTable).prop("onRowClick")("event", "rowClick");
@@ -70,7 +77,7 @@ describe("<DataExplorer />", () => {
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
items={[]}
- />);
+ onSetColumns={jest.fn()} />);
expect(dataExplorer.find(DataTable)).toHaveLength(0);
expect(dataExplorer.find(DefaultView)).toHaveLength(1);
});
@@ -78,6 +85,7 @@ describe("<DataExplorer />", () => {
it("communicates with <TablePagination/>", () => {
const onChangePage = jest.fn();
const onChangeRowsPerPage = jest.fn();
+ const onSetColumns = jest.fn();
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
items={[{ name: "item 1" }]}
@@ -85,7 +93,7 @@ describe("<DataExplorer />", () => {
rowsPerPage={50}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangeRowsPerPage}
- />);
+ onSetColumns={onSetColumns} />);
expect(dataExplorer.find(TablePagination).prop("page")).toEqual(10);
expect(dataExplorer.find(TablePagination).prop("rowsPerPage")).toEqual(50);
dataExplorer.find(TablePagination).prop("onChangePage")(undefined, 6);
@@ -114,5 +122,6 @@ const mockDataExplorerProps = () => ({
onChangeRowsPerPage: jest.fn(),
onContextMenu: jest.fn(),
defaultIcon: ProjectIcon,
+ onSetColumns: jest.fn(),
defaultMessages: ['testing'],
});
diff --git a/src/store/collection-copy-dialog/collection-copy-dialog.ts b/src/store/collection-copy-dialog/collection-copy-dialog.ts
index d264063..458ae5e 100644
--- a/src/store/collection-copy-dialog/collection-copy-dialog.ts
+++ b/src/store/collection-copy-dialog/collection-copy-dialog.ts
@@ -14,7 +14,7 @@ import { projectPanelActions } from '~/store/project-panel/project-panel-action'
export const COLLECTION_COPY_DIALOG = 'projectCopy';
-export interface CopyFormDialogData {
+export interface CollectionCopyFormDialogData {
name: string;
ownerUuid: string;
uuid: string;
@@ -23,12 +23,12 @@ export interface CopyFormDialogData {
export const openCollectionCopyDialog = (resource: { name: string, uuid: string }) =>
(dispatch: Dispatch) => {
dispatch<any>(resetPickerProjectTree());
- const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, ownerUuid: '', uuid: resource.uuid };
+ const initialData: CollectionCopyFormDialogData = { name: `Copy of: ${resource.name}`, ownerUuid: '', uuid: resource.uuid };
dispatch<any>(initialize(COLLECTION_COPY_DIALOG, initialData));
dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_COPY_DIALOG, data: {} }));
};
-export const copyCollection = (resource: CopyFormDialogData) =>
+export const copyCollection = (resource: CollectionCopyFormDialogData) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
dispatch(startSubmit(COLLECTION_COPY_DIALOG));
try {
diff --git a/src/views-components/copy-dialog/copy-collection-dialog.tsx b/src/views-components/copy-dialog/copy-collection-dialog.tsx
index db721e0..d988622 100644
--- a/src/views-components/copy-dialog/copy-collection-dialog.tsx
+++ b/src/views-components/copy-dialog/copy-collection-dialog.tsx
@@ -5,13 +5,13 @@
import { compose } from "redux";
import { withDialog } from "~/store/dialog/with-dialog";
import { reduxForm } from 'redux-form';
-import { COLLECTION_COPY_DIALOG, CopyFormDialogData } from '~/store/collection-copy-dialog/collection-copy-dialog';
+import { COLLECTION_COPY_DIALOG, CollectionCopyFormDialogData } from '~/store/collection-copy-dialog/collection-copy-dialog';
import { CopyFormDialog } from "~/views-components/copy-dialog/copy-dialog";
import { copyCollection } from '~/store/collection-copy-dialog/collection-copy-dialog';
export const CollectionCopyDialog = compose(
withDialog(COLLECTION_COPY_DIALOG),
- reduxForm<CopyFormDialogData>({
+ reduxForm<CollectionCopyFormDialogData>({
form: COLLECTION_COPY_DIALOG,
onSubmit: (data, dispatch) => {
dispatch(copyCollection(data));
diff --git a/src/views-components/copy-dialog/copy-dialog.tsx b/src/views-components/copy-dialog/copy-dialog.tsx
index c9b6486..3b1b4cf 100644
--- a/src/views-components/copy-dialog/copy-dialog.tsx
+++ b/src/views-components/copy-dialog/copy-dialog.tsx
@@ -9,9 +9,9 @@ import { FormDialog } from '~/components/form-dialog/form-dialog';
import { ProjectTreePickerField } from '~/views-components/project-tree-picker/project-tree-picker';
import { COPY_NAME_VALIDATION, COPY_PROJECT_VALIDATION } from '~/validators/validators';
import { TextField } from "~/components/text-field/text-field";
-import { CopyFormDialogData } from "~/store/collection-copy-dialog/collection-copy-dialog";
+import { CollectionCopyFormDialogData } from "~/store/collection-copy-dialog/collection-copy-dialog";
-type CopyFormDialogProps = WithDialogProps<string> & InjectedFormProps<CopyFormDialogData>;
+type CopyFormDialogProps = WithDialogProps<string> & InjectedFormProps<CollectionCopyFormDialogData>;
export const CopyFormDialog = (props: CopyFormDialogProps) =>
<FormDialog
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list