[ARVADOS-WORKBENCH2] created: 1.3.0-253-gf7196af6

Git user git at public.curoverse.com
Thu Dec 27 06:15:33 EST 2018


        at  f7196af6fd9a9f9b0a6de3e61dd421b734019dd1 (commit)


commit f7196af6fd9a9f9b0a6de3e61dd421b734019dd1
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 11:17:06 2018 +0100

    Disable run process button if advanced form is invalid
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/run-process-panel/run-process-second-step.tsx b/src/views/run-process-panel/run-process-second-step.tsx
index a7e4a87f..8e855ab3 100644
--- a/src/views/run-process-panel/run-process-second-step.tsx
+++ b/src/views/run-process-panel/run-process-second-step.tsx
@@ -11,7 +11,7 @@ import { connect } from 'react-redux';
 import { RootState } from '~/store/store';
 import { isValid } from 'redux-form';
 import { RUN_PROCESS_INPUTS_FORM } from './run-process-inputs-form';
-import { RunProcessAdvancedForm } from './run-process-advanced-form';
+import { RunProcessAdvancedForm, RUN_PROCESS_ADVANCED_FORM } from './run-process-advanced-form';
 import { createSelector, createStructuredSelector } from 'reselect';
 import { WorkflowPresetSelect } from '~/views/run-process-panel/workflow-preset-select';
 import { selectPreset } from '~/store/run-process-panel/run-process-panel-actions';
@@ -43,7 +43,7 @@ const inputsSelector = (state: RootState) =>
     state.runProcessPanel.inputs;
 
 const validSelector = (state: RootState) =>
-    isValid(RUN_PROCESS_BASIC_FORM)(state) && isValid(RUN_PROCESS_INPUTS_FORM)(state);
+    isValid(RUN_PROCESS_BASIC_FORM)(state) && isValid(RUN_PROCESS_INPUTS_FORM)(state) && isValid(RUN_PROCESS_ADVANCED_FORM)(state);
 
 const mapStateToProps = createStructuredSelector({
     inputs: inputsSelector,

commit c47ae7ee3d75544d534b020e7e1c8c45e30f584e
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 11:15:17 2018 +0100

    Extend RunProcessAdvancedForm with numeric fields with runtime constraints values
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/run-process-panel/run-process-advanced-form.tsx b/src/views/run-process-panel/run-process-advanced-form.tsx
index 19beab6b..5bec245a 100644
--- a/src/views/run-process-panel/run-process-advanced-form.tsx
+++ b/src/views/run-process-panel/run-process-advanced-form.tsx
@@ -8,17 +8,34 @@ import { reduxForm, Field } from 'redux-form';
 import { Grid } from '@material-ui/core';
 import { TextField } from '~/components/text-field/text-field';
 import { ExpandIcon } from '~/components/icon/icon';
+import * as IntInput from './inputs/int-input';
+import { require } from '~/validators/require';
+import { min } from '~/validators/min';
+import { optional } from '~/validators/optional';
 
 export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm';
 
+const OUTPUT_FIELD = 'output';
+const RUNTIME_FIELD = 'runtime';
+const RAM_FIELD = 'ram';
+const VCPUS_FIELD = 'vcpus';
+const KEEP_CACHE_RAM_FIELD = 'keepCacheRam';
+
 export interface RunProcessAdvancedFormData {
-    output: string;
-    runtime: string;
+    [OUTPUT_FIELD]?: string;
+    [RUNTIME_FIELD]?: string;
+    [RAM_FIELD]: number;
+    [VCPUS_FIELD]: number;
+    [KEEP_CACHE_RAM_FIELD]?: number;
 }
 
 export const RunProcessAdvancedForm =
     reduxForm<RunProcessAdvancedFormData>({
-        form: RUN_PROCESS_ADVANCED_FORM
+        form: RUN_PROCESS_ADVANCED_FORM,
+        initialValues: {
+            [RAM_FIELD]: 1073741824,
+            [VCPUS_FIELD]: 1,
+        },
     })(() =>
         <form>
             <ExpansionPanel elevation={0}>
@@ -29,17 +46,56 @@ export const RunProcessAdvancedForm =
                     <Grid container spacing={32}>
                         <Grid item xs={12} md={6}>
                             <Field
-                                name='output'
+                                name={OUTPUT_FIELD}
                                 component={TextField}
                                 label="Output name" />
                         </Grid>
                         <Grid item xs={12} md={6}>
                             <Field
-                                name='runtime'
+                                name={RUNTIME_FIELD}
                                 component={TextField}
                                 label="Runtime limit (hh)" />
                         </Grid>
+                        <Grid item xs={12} md={6}>
+                            <Field
+                                name={RAM_FIELD}
+                                component={TextField}
+                                label="RAM"
+                                helperText="Number of ram bytes to be used to run this process."
+                                parse={IntInput.parse}
+                                format={IntInput.format}
+                                type='number'
+                                required
+                                validate={ramValidation} />
+                        </Grid>
+                        <Grid item xs={12} md={6}>
+                            <Field
+                                name={VCPUS_FIELD}
+                                component={TextField}
+                                label="VCPUs"
+                                helperText="Number of cores to be used to run this process."
+                                parse={IntInput.parse}
+                                format={IntInput.format}
+                                type='number'
+                                required
+                                validate={vcpusValidation} />
+                        </Grid>
+                        <Grid item xs={12} md={6}>
+                            <Field
+                                name={KEEP_CACHE_RAM_FIELD}
+                                component={TextField}
+                                label="Keep cache RAM"
+                                helperText="Number of keep cache bytes to be used to run this process."
+                                parse={IntInput.parse}
+                                format={IntInput.format}
+                                type='number'
+                                validate={keepCacheRamValdation} />
+                        </Grid>
                     </Grid>
                 </ExpansionPanelDetails>
             </ExpansionPanel>
         </form >);
+
+const ramValidation = [min(0)];
+const vcpusValidation = [min(1)];
+const keepCacheRamValdation = [optional(min(0))];

commit da43ffb940d4d2eee9bacbce35f76c021e232fdd
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 11:13:25 2018 +0100

    Create optional validator
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/validators/optional.tsx b/src/validators/optional.tsx
new file mode 100644
index 00000000..da3a8252
--- /dev/null
+++ b/src/validators/optional.tsx
@@ -0,0 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export const optional = (validator: (value: any) => string | undefined) =>
+    (value: any) =>
+        value === undefined || value === null || value === ''  ? undefined : validator(value);
\ No newline at end of file

commit 9e6253c3521b67d74acc7a715c4a7fdd8e8a700a
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 11:13:13 2018 +0100

    Create min validator
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/validators/min.tsx b/src/validators/min.tsx
new file mode 100644
index 00000000..e326a708
--- /dev/null
+++ b/src/validators/min.tsx
@@ -0,0 +1,12 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { isNumber } from 'lodash';
+
+export const ERROR_MESSAGE = (minValue: number) => `Minimum value is ${minValue}`;
+
+export const min =
+    (minValue: number, errorMessage = ERROR_MESSAGE) =>
+        (value: any) =>
+            isNumber(value) && value >= minValue ? undefined : errorMessage(minValue);

commit a971f4746874e85731cf4b27d850e7a16cd1bdb7
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 10:42:48 2018 +0100

    Delete console log from WorkflowDetailsCard
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index 936c3485..2294ab5e 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -72,9 +72,6 @@ export const WorkflowDetailsCard = withStyles(styles)(
 
         render() {
             const { classes, workflow } = this.props;
-            if (workflow) {
-                console.log(workflow.definition);
-            }
             const { value } = this.state;
             return <div className={classes.root}>
                 <Tabs value={value} onChange={this.handleChange} centered={true}>

commit 4db2f095ecbf66553a4c29ad44f5cdd18da33cfd
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 10:42:07 2018 +0100

    Export IntInput's parse and format functions
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/run-process-panel/inputs/int-input.tsx b/src/views/run-process-panel/inputs/int-input.tsx
index 78f0d736..3273f354 100644
--- a/src/views/run-process-panel/inputs/int-input.tsx
+++ b/src/views/run-process-panel/inputs/int-input.tsx
@@ -22,9 +22,9 @@ export const IntInput = ({ input }: IntInputProps) =>
         format={format}
         validate={getValidation(input)} />;
 
-const parse = (value: any) => value === '' ? '' : parseInt(value, 10);
+export const parse = (value: any) => value === '' ? '' : parseInt(value, 10);
 
-const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
+export const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
 
 const getValidation = memoize(
     (input: IntCommandInputParameter) => ([

commit 2c2a877d45ed33ba2c529c6996ccd79b0447a554
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 10:41:42 2018 +0100

    Fix IntInput zero or empty string parsing
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/run-process-panel/inputs/int-input.tsx b/src/views/run-process-panel/inputs/int-input.tsx
index 32ebeb75..78f0d736 100644
--- a/src/views/run-process-panel/inputs/int-input.tsx
+++ b/src/views/run-process-panel/inputs/int-input.tsx
@@ -22,7 +22,7 @@ export const IntInput = ({ input }: IntInputProps) =>
         format={format}
         validate={getValidation(input)} />;
 
-const parse = (value: any) => parseInt(value, 10);
+const parse = (value: any) => value === '' ? '' : parseInt(value, 10);
 
 const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
 

commit 4e7bf262d117ff4103b0a733c79b2dce7b2a4151
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 10:40:38 2018 +0100

    Add type prop to TextField
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx
index 0ba9e359..4788e18c 100644
--- a/src/components/text-field/text-field.tsx
+++ b/src/components/text-field/text-field.tsx
@@ -27,7 +27,7 @@ type TextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
 
 export const TextField = withStyles(styles)((props: TextFieldProps & {
     label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string,
-    helperText?: string,
+    helperText?: string, type?: string,
 }) =>
     <MaterialTextField
         helperText={(props.meta.touched && props.meta.error) || props.helperText}
@@ -43,6 +43,7 @@ export const TextField = withStyles(styles)((props: TextFieldProps & {
         children={props.children}
         margin={props.margin}
         placeholder={props.placeholder}
+        type={props.type}
         {...props.input}
     />);
 

commit 649e7547de25a0500478c01f1609d9638a8803b0
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 09:34:46 2018 +0100

    Add helpetText props to TextField
    
    Feature #master
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx
index 93c4080f..0ba9e359 100644
--- a/src/components/text-field/text-field.tsx
+++ b/src/components/text-field/text-field.tsx
@@ -26,10 +26,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 type TextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
 
 export const TextField = withStyles(styles)((props: TextFieldProps & {
-    label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string
+    label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string,
+    helperText?: string,
 }) =>
     <MaterialTextField
-        helperText={props.meta.touched && props.meta.error}
+        helperText={(props.meta.touched && props.meta.error) || props.helperText}
         className={props.classes.textField}
         label={props.label}
         disabled={props.disabled || props.meta.submitting}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list