[ARVADOS-WORKBENCH2] updated: 1.3.0-131-gbcd42fb4

Git user git at public.curoverse.com
Thu Dec 20 05:39:17 EST 2018


Summary of changes:
 src/store/projects/project-create-actions.ts       | 13 ++++++++----
 .../dialog-create/dialog-project-create.tsx        |  2 +-
 .../create-project-properties-list.tsx             | 23 +++++++++++-----------
 3 files changed, 22 insertions(+), 16 deletions(-)

       via  bcd42fb41e7fabd3bc0b432e039eade4d05f4f76 (commit)
      from  c4106363643160b30bb924b72f5b6ad95e4ba2ae (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 bcd42fb41e7fabd3bc0b432e039eade4d05f4f76
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Thu Dec 20 11:39:02 2018 +0100

    fill actions for add and remove property from new project form
    
    Feature #14248_assigning_properties_to_projects_during_create
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/store/projects/project-create-actions.ts b/src/store/projects/project-create-actions.ts
index d87046e2..625bd29e 100644
--- a/src/store/projects/project-create-actions.ts
+++ b/src/store/projects/project-create-actions.ts
@@ -11,6 +11,7 @@ import { ProjectResource } from '~/models/project';
 import { ServiceRepository } from '~/services/services';
 import { matchProjectRoute, matchRunProcessRoute } from '~/routes/routes';
 import { ResourcePropertiesFormData } from '~/views-components/resource-properties-form/resource-properties-form';
+import { GraphChange } from '../../lib/cwl-svg/plugins/plugin';
 
 export interface ProjectCreateFormDialogData {
     ownerUuid: string;
@@ -69,12 +70,16 @@ export const createProject = (project: Partial<ProjectResource>) =>
 
 export const addPropertyToCreateProjectForm = (data: ResourcePropertiesFormData) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        console.log('addPropertyToCreateProjectForm: ', data);
-        dispatch(change(PROJECT_CREATE_FORM_NAME, 'properties',  data));
-        // dispatch(arrayPush(PROJECT_CREATE_FORM_NAME, 'properties', data));
+        const selector = formValueSelector(PROJECT_CREATE_FORM_NAME);
+        const properties = selector(getState(), 'properties') || {};
+        properties[data.key] = data.value;
+        dispatch(change(PROJECT_CREATE_FORM_NAME, 'properties', {...properties } ));
     };
 
 export const removePropertyFromCreateProjectForm = (key: string) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        console.log('removePropertyFromCreateProjectForm: ', key);
+        const selector = formValueSelector(PROJECT_CREATE_FORM_NAME);
+        const properties = selector(getState(), 'properties');
+        delete properties[key];
+        dispatch(change(PROJECT_CREATE_FORM_NAME, 'properties', { ...properties } ));
     };
\ No newline at end of file
diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx
index 481957d1..02fb67e5 100644
--- a/src/views-components/dialog-create/dialog-project-create.tsx
+++ b/src/views-components/dialog-create/dialog-project-create.tsx
@@ -21,7 +21,7 @@ export const DialogProjectCreate = (props: DialogProjectProps) =>
         {...props}
     />;
 
-const ProjectAddFields = (props: any) => <span>
+const ProjectAddFields = () => <span>
     <ProjectNameField />
     <ProjectDescriptionField />
     <CreateProjectPropertiesForm />
diff --git a/src/views-components/project-properties/create-project-properties-list.tsx b/src/views-components/project-properties/create-project-properties-list.tsx
index 942de8a8..1e98905c 100644
--- a/src/views-components/project-properties/create-project-properties-list.tsx
+++ b/src/views-components/project-properties/create-project-properties-list.tsx
@@ -41,15 +41,16 @@ const mapDispatchToProps = (dispatch: Dispatch): CreateProjectPropertiesListActi
 type CreateProjectPropertiesListProps = CreateProjectPropertiesListDataProps & 
     CreateProjectPropertiesListActionProps & WithStyles<CssRules>;
 
-export const CreateProjectPropertiesList = connect(mapStateToProps, mapDispatchToProps)(
-    withStyles(styles)(
-        ({ classes, handleDelete, properties }: CreateProjectPropertiesListProps) =>
-            <div>
-                { properties &&
-                    Object.keys(properties).map(k => {
-                        return <Chip key={k} className={classes.tag}
-                            onDelete={() => handleDelete(k)}
-                            label={`${k}: ${properties[k]}`} />;
+const List = withStyles(styles)(
+    ({ classes, handleDelete, properties }: CreateProjectPropertiesListProps) =>
+        <div>
+            {properties &&
+                Object.keys(properties).map(k => {
+                    return <Chip key={k} className={classes.tag}
+                        onDelete={() => handleDelete(k)}
+                        label={`${k}: ${properties[k]}`} />;
                 })}
-            </div>
-        ));
\ No newline at end of file
+        </div>
+);
+
+export const CreateProjectPropertiesList = connect(mapStateToProps, mapDispatchToProps)(List);
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list