[ARVADOS-WORKBENCH2] updated: 1.2.0-875-ga2783c4
Git user
git at public.curoverse.com
Wed Nov 14 09:57:24 EST 2018
Summary of changes:
src/store/projects/project-move-actions.ts | 2 ++
...{move-project-dialog.ts => move-project-dialog.tsx} | 8 ++++++--
src/views-components/dialog-move/dialog-move-to.tsx | 17 ++++++++++-------
.../project-tree-picker/project-tree-picker.tsx | 18 +++++++++++-------
4 files changed, 29 insertions(+), 16 deletions(-)
rename src/views-components/dialog-forms/{move-project-dialog.ts => move-project-dialog.tsx} (82%)
via a2783c48c8210410de72bd17a32ab72d0f364cde (commit)
via 90f56604ead086b6acc582bcb745a75e8bde5267 (commit)
via 59ddd20573eab6116c590c2a692c0131fa2f3f4f (commit)
from 02e77918141f173e5a61b17623c8cad0e8a1bae3 (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 a2783c48c8210410de72bd17a32ab72d0f364cde
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Wed Nov 14 15:57:10 2018 +0100
Update move-project-dialog to work with new projects-tree-picker
Feature #14470
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/projects/project-move-actions.ts b/src/store/projects/project-move-actions.ts
index c251bdf..9405597 100644
--- a/src/store/projects/project-move-actions.ts
+++ b/src/store/projects/project-move-actions.ts
@@ -10,12 +10,14 @@ import { RootState } from '~/store/store';
import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service";
import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
+import { initProjectsTreePicker } from '../tree-picker/tree-picker-actions';
export const PROJECT_MOVE_FORM_NAME = 'projectMoveFormName';
export const openMoveProjectDialog = (resource: { name: string, uuid: string }) =>
(dispatch: Dispatch) => {
dispatch<any>(resetPickerProjectTree());
+ dispatch<any>(initProjectsTreePicker(PROJECT_MOVE_FORM_NAME));
dispatch(initialize(PROJECT_MOVE_FORM_NAME, resource));
dispatch(dialogActions.OPEN_DIALOG({ id: PROJECT_MOVE_FORM_NAME, data: {} }));
};
diff --git a/src/views-components/dialog-forms/move-project-dialog.ts b/src/views-components/dialog-forms/move-project-dialog.tsx
similarity index 82%
rename from src/views-components/dialog-forms/move-project-dialog.ts
rename to src/views-components/dialog-forms/move-project-dialog.tsx
index c1fbb76..4132ffa 100644
--- a/src/views-components/dialog-forms/move-project-dialog.ts
+++ b/src/views-components/dialog-forms/move-project-dialog.tsx
@@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
+import * as React from 'react';
import { compose } from "redux";
import { withDialog } from "~/store/dialog/with-dialog";
import { reduxForm } from 'redux-form';
@@ -17,6 +18,9 @@ export const MoveProjectDialog = compose(
onSubmit: (data, dispatch) => {
dispatch(moveProject(data));
}
- })
-)(DialogMoveTo);
+ }),
+)(
+ (...params: Parameters<typeof DialogMoveTo>) =>
+ <DialogMoveTo {...params[0]} pickerId={PROJECT_MOVE_FORM_NAME} />
+);
commit 90f56604ead086b6acc582bcb745a75e8bde5267
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Wed Nov 14 15:56:29 2018 +0100
Pass pickerId through DialogMoveTo props
Feature #14470
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/dialog-move/dialog-move-to.tsx b/src/views-components/dialog-move/dialog-move-to.tsx
index 425b9e4..129c59f 100644
--- a/src/views-components/dialog-move/dialog-move-to.tsx
+++ b/src/views-components/dialog-move/dialog-move-to.tsx
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
+import { memoize } from 'lodash/fp';
import { InjectedFormProps, Field } from 'redux-form';
import { WithDialogProps } from '~/store/dialog/with-dialog';
import { FormDialog } from '~/components/form-dialog/form-dialog';
@@ -10,17 +11,19 @@ import { ProjectTreePickerField } from '~/views-components/project-tree-picker/p
import { MOVE_TO_VALIDATION } from '~/validators/validators';
import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
-export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData>) =>
+export const DialogMoveTo = (props: WithDialogProps<string> & InjectedFormProps<MoveToFormDialogData> & { pickerId: string }) =>
<FormDialog
dialogTitle='Move to'
- formFields={MoveToDialogFields}
+ formFields={MoveToDialogFields(props.pickerId)}
submitLabel='Move'
{...props}
/>;
-const MoveToDialogFields = () =>
- <Field
- name="ownerUuid"
- component={ProjectTreePickerField}
- validate={MOVE_TO_VALIDATION} />;
+const MoveToDialogFields = memoize(
+ (pickerId: string) => () =>
+ <Field
+ name="ownerUuid"
+ pickerId={pickerId}
+ component={ProjectTreePickerField}
+ validate={MOVE_TO_VALIDATION} />);
commit 59ddd20573eab6116c590c2a692c0131fa2f3f4f
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Wed Nov 14 15:55:40 2018 +0100
Use new projects-tree-picker in ProjectTreePickerField
Feature #14470
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/project-tree-picker/project-tree-picker.tsx b/src/views-components/project-tree-picker/project-tree-picker.tsx
index a4e4c40..101fca0 100644
--- a/src/views-components/project-tree-picker/project-tree-picker.tsx
+++ b/src/views-components/project-tree-picker/project-tree-picker.tsx
@@ -16,6 +16,8 @@ import { RootState } from "~/store/store";
import { ServiceRepository } from "~/services/services";
import { WrappedFieldProps } from 'redux-form';
import { TreePickerId } from '~/models/tree';
+import { ProjectsTreePicker } from '~/views-components/projects-tree-picker/projects-tree-picker';
+import { ProjectsTreePickerItem } from '~/views-components/projects-tree-picker/generic-projects-tree-picker';
type ProjectTreePickerProps = Pick<TreePickerProps<ProjectResource>, 'onContextMenu' | 'toggleItemActive' | 'toggleItemOpen' | 'toggleItemSelection'>;
@@ -87,17 +89,19 @@ const renderTreeItem = (item: TreeItem<ProjectResource>) =>
isActive={item.active}
hasMargin={true} />;
-export const ProjectTreePickerField = (props: WrappedFieldProps) =>
+export const ProjectTreePickerField = (props: WrappedFieldProps & { pickerId: string }) =>
<div style={{ height: '200px', display: 'flex', flexDirection: 'column' }}>
- <ProjectTreePicker onChange={handleChange(props)} />
+ <ProjectsTreePicker
+ pickerId={props.pickerId}
+ toggleItemActive={handleChange(props)} />
{props.meta.dirty && props.meta.error &&
<Typography variant='caption' color='error'>
{props.meta.error}
</Typography>}
</div>;
-const handleChange = (props: WrappedFieldProps) => (value: string) =>
- props.input.value === value
- ? props.input.onChange('')
- : props.input.onChange(value);
-
+const handleChange = (props: WrappedFieldProps) =>
+ (_: any, { id }: TreeItem<ProjectsTreePickerItem>) =>
+ props.input.value === id
+ ? props.input.onChange('')
+ : props.input.onChange(id);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list