[ARVADOS-WORKBENCH2] updated: 1.3.0-133-g467d932e

Git user git at public.curoverse.com
Fri Dec 21 05:05:23 EST 2018


Summary of changes:
 src/store/projects/project-create-actions.ts                  | 11 +++++------
 .../project-properties/create-project-properties-list.tsx     |  7 +++----
 2 files changed, 8 insertions(+), 10 deletions(-)

       via  467d932e354ea551cbff134ac50723bd56cea68d (commit)
      from  3408a97206bfac10d8ecc6e30cf0b28d66697b9b (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 467d932e354ea551cbff134ac50723bd56cea68d
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Fri Dec 21 11:05:08 2018 +0100

    change code after CR
    
    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 f4883eb9..613e828d 100644
--- a/src/store/projects/project-create-actions.ts
+++ b/src/store/projects/project-create-actions.ts
@@ -16,11 +16,12 @@ export interface ProjectCreateFormDialogData {
     ownerUuid: string;
     name: string;
     description: string;
-    properties: any;
+    properties: { [key: string]: string };
 }
 
 export const PROJECT_CREATE_FORM_NAME = 'projectCreateFormName';
 export const PROJECT_CREATE_PROPERTIES_FORM_NAME = 'projectCreatePropertiesFormName';
+export const CREATE_FORM_SELECTOR = formValueSelector(PROJECT_CREATE_FORM_NAME);
 
 export const isProjectOrRunProcessRoute = ({ router }: RootState) => {
     const pathname = router.location ? router.location.pathname : '';
@@ -69,16 +70,14 @@ export const createProject = (project: Partial<ProjectResource>) =>
 
 export const addPropertyToCreateProjectForm = (data: ResourcePropertiesFormData) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const selector = formValueSelector(PROJECT_CREATE_FORM_NAME);
-        const properties = selector(getState(), 'properties') || {};
+        const properties = CREATE_FORM_SELECTOR(getState(), 'properties') || {};
         properties[data.key] = data.value;
-        dispatch(change(PROJECT_CREATE_FORM_NAME, 'properties', {...properties } ));
+        dispatch(change(PROJECT_CREATE_FORM_NAME, 'properties', { ...properties } ));
     };
 
 export const removePropertyFromCreateProjectForm = (key: string) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const selector = formValueSelector(PROJECT_CREATE_FORM_NAME);
-        const properties = selector(getState(), 'properties');
+        const properties = CREATE_FORM_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/project-properties/create-project-properties-list.tsx b/src/views-components/project-properties/create-project-properties-list.tsx
index 1e98905c..41003adc 100644
--- a/src/views-components/project-properties/create-project-properties-list.tsx
+++ b/src/views-components/project-properties/create-project-properties-list.tsx
@@ -8,7 +8,7 @@ import { Dispatch } from 'redux';
 import { formValueSelector } from 'redux-form';
 import { withStyles, StyleRulesCallback, WithStyles, Chip } from '@material-ui/core';
 import { RootState } from '~/store/store';
-import { removePropertyFromCreateProjectForm, PROJECT_CREATE_FORM_NAME } from '~/store/projects/project-create-actions';
+import { removePropertyFromCreateProjectForm, CREATE_FORM_SELECTOR } from '~/store/projects/project-create-actions';
 import { ArvadosTheme } from '~/common/custom-theme';
 
 type CssRules = 'tag';
@@ -21,16 +21,15 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 interface CreateProjectPropertiesListDataProps {
-    properties: any;
+    properties: { [key: string]: string };
 }
 
 interface CreateProjectPropertiesListActionProps {
     handleDelete: (key: string) => void;
 }
 
-const selector = formValueSelector(PROJECT_CREATE_FORM_NAME);
 const mapStateToProps = (state: RootState): CreateProjectPropertiesListDataProps => {
-    const properties = selector(state, 'properties');
+    const properties = CREATE_FORM_SELECTOR(state, 'properties');
     return { properties };
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list