[ARVADOS-WORKBENCH2] updated: 1.1.4-365-gc6be788

Git user git at public.curoverse.com
Tue Jul 24 05:22:43 EDT 2018


Summary of changes:
 package.json                                                 | 6 +++---
 src/validators/create-project/create-project-validator.tsx   | 8 ++++----
 src/validators/max-length.tsx                                | 6 ++----
 src/validators/require.tsx                                   | 8 +++-----
 src/views-components/dialog-create/dialog-project-create.tsx | 6 +++---
 5 files changed, 15 insertions(+), 19 deletions(-)

       via  c6be788f754adcfd8f6cc2c218540c8712c06153 (commit)
      from  f9d5788cb7e3ccf888b5ad7859c0077708c499ad (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 c6be788f754adcfd8f6cc2c218540c8712c06153
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Tue Jul 24 11:22:32 2018 +0200

    CR changes
    
    Feature #13781
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/package.json b/package.json
index 06fa893..fa4bd30 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
     "@material-ui/core": "1.4.0",
     "@material-ui/icons": "1.1.0",
     "@types/lodash": "4.14.112",
-    "@types/redux-form": "^7.4.1",
+    "@types/redux-form": "7.4.1",
     "axios": "0.18.0",
     "classnames": "2.2.6",
     "lodash": "4.17.10",
@@ -41,13 +41,13 @@
     "@types/react-router-dom": "4.2.7",
     "@types/react-router-redux": "5.0.15",
     "@types/redux-devtools": "3.0.44",
-    "@types/redux-form": "^7.4.1",
+    "@types/redux-form": "7.4.1",
     "axios-mock-adapter": "1.15.0",
     "enzyme": "3.3.0",
     "enzyme-adapter-react-16": "1.1.1",
     "jest-localstorage-mock": "2.2.0",
     "redux-devtools": "3.4.1",
-    "redux-form": "^7.4.2",
+    "redux-form": "7.4.2",
     "typescript": "2.9.2"
   },
   "moduleNameMapper": {
diff --git a/src/validators/create-project/create-project-validator.tsx b/src/validators/create-project/create-project-validator.tsx
index 5765f72..928efdd 100644
--- a/src/validators/create-project/create-project-validator.tsx
+++ b/src/validators/create-project/create-project-validator.tsx
@@ -2,8 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import require from '../require';
-import maxLength from '../max-length';
+import { require } from '../require';
+import { maxLength } from '../max-length';
 
-export const NAME = [require, maxLength(255)];
-export const DESCRIPTION = [maxLength(255)];
+export const PROJECT_NAME_VALIDATION = [require, maxLength(255)];
+export const PROJECT_DESCRIPTION_VALIDATION = [maxLength(255)];
diff --git a/src/validators/max-length.tsx b/src/validators/max-length.tsx
index 9b6d248..922e3e5 100644
--- a/src/validators/max-length.tsx
+++ b/src/validators/max-length.tsx
@@ -11,14 +11,12 @@ interface MaxLengthProps {
 }
 
 // TODO types for maxLength
-const maxLength: any = (maxLengthValue = DEFAULT_MAX_VALUE, errorMessage = ERROR_MESSAGE) => {
+export const maxLength: any = (maxLengthValue = DEFAULT_MAX_VALUE, errorMessage = ERROR_MESSAGE) => {
     return (value: string) => {
         if (value) {
-            return  value && value && value.length <= maxLengthValue ? undefined : `${errorMessage || ERROR_MESSAGE} ${maxLengthValue}`;
+            return  value && value.length <= maxLengthValue ? undefined : `${errorMessage || ERROR_MESSAGE} ${maxLengthValue}`;
         }
 
         return undefined;
     };
 };
-
-export default maxLength;
diff --git a/src/validators/require.tsx b/src/validators/require.tsx
index 8ac3401..f636850 100644
--- a/src/validators/require.tsx
+++ b/src/validators/require.tsx
@@ -4,13 +4,11 @@
 
 export const ERROR_MESSAGE = 'This field is required.';
 
-interface RequireProps {
+interface RequiredProps {
     value: string;
 }
 
 // TODO types for require
-const require: any = (value: string, errorMessage = ERROR_MESSAGE) => {
-    return value && value.toString().length > 0 ? undefined : ERROR_MESSAGE;
+export const require: any = (value: string) => {
+    return value && value.length > 0 ? undefined : ERROR_MESSAGE;
 };
-
-export default require;
diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx
index e11c67a..592efc1 100644
--- a/src/views-components/dialog-create/dialog-project-create.tsx
+++ b/src/views-components/dialog-create/dialog-project-create.tsx
@@ -12,7 +12,7 @@ import DialogContent from '@material-ui/core/DialogContent';
 import DialogTitle from '@material-ui/core/DialogTitle';
 import { Button, StyleRulesCallback, WithStyles, withStyles, CircularProgress } from '@material-ui/core';
 
-import { NAME, DESCRIPTION } from '../../validators/create-project/create-project-validator';
+import { PROJECT_NAME_VALIDATION, PROJECT_DESCRIPTION_VALIDATION } from '../../validators/create-project/create-project-validator';
 
 type CssRules = "button" | "lastButton" | "formContainer" | "textField" | "dialog" | "dialogTitle" | "createProgress" | "dialogActions";
 
@@ -85,13 +85,13 @@ export const DialogProjectCreate = compose(
                                 <Field name="name"
                                        component={this.renderTextField}
                                        floatinglabeltext="Project Name"
-                                       validate={NAME}
+                                       validate={PROJECT_NAME_VALIDATION}
                                        className={classes.textField}
                                        label="Project Name"/>
                                 <Field name="description"
                                        component={this.renderTextField}
                                        floatinglabeltext="Description - optional"
-                                       validate={DESCRIPTION}
+                                       validate={PROJECT_DESCRIPTION_VALIDATION}
                                        className={classes.textField}
                                        label="Description - optional"/>
                             </DialogContent>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list