[ARVADOS-WORKBENCH2] updated: 1.3.0-267-gc3644a28

Git user git at public.curoverse.com
Thu Dec 27 10:03:46 EST 2018


Summary of changes:
 src/components/form-field/form-field.tsx           | 41 ++++++++++++++++++++++
 src/components/switch-field/switch-field.tsx       | 14 ++++++++
 .../run-process-panel/run-process-panel-actions.ts |  4 ++-
 .../run-process-advanced-form.tsx                  | 13 +++++++
 4 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 src/components/form-field/form-field.tsx
 create mode 100644 src/components/switch-field/switch-field.tsx

       via  c3644a28ef0a80c193361f56627bbe9e556aacaa (commit)
       via  72c28d113866720f8abfc7295ae6b28d53bc870a (commit)
       via  b496a5389daf0b9d1b304337514c9a2a7e38ff98 (commit)
       via  5e7459e2089b92e25611d1835bf3a620ba655c60 (commit)
       via  b02573dbdd8dae7c2f9bdafa2f6ac847168b024a (commit)
       via  0132e5e4bc0a319295289913ce28e7d93c651d29 (commit)
      from  b104bb15d23084f00745384b90845ad459181188 (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 c3644a28ef0a80c193361f56627bbe9e556aacaa
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 16:03:27 2018 +0100

    Set default api field value
    
    Feature #13708
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/store/run-process-panel/run-process-panel-actions.ts b/src/store/run-process-panel/run-process-panel-actions.ts
index 57a5712f..f7649860 100644
--- a/src/store/run-process-panel/run-process-panel-actions.ts
+++ b/src/store/run-process-panel/run-process-panel-actions.ts
@@ -158,6 +158,7 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
 export const DEFAULT_ADVANCED_FORM_VALUES: Partial<RunProcessAdvancedFormData> = {
     [VCPUS_FIELD]: 1,
     [RAM_FIELD]: 1073741824,
+    [API_FIELD]: true,
 };
 
 const normalizeInputKeys = (inputs: WorkflowInputsData): WorkflowInputsData =>

commit 72c28d113866720f8abfc7295ae6b28d53bc870a
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 16:03:09 2018 +0100

    Add api field value to runtime constraints
    
    Feature #13708
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/store/run-process-panel/run-process-panel-actions.ts b/src/store/run-process-panel/run-process-panel-actions.ts
index 12d1eeb1..57a5712f 100644
--- a/src/store/run-process-panel/run-process-panel-actions.ts
+++ b/src/store/run-process-panel/run-process-panel-actions.ts
@@ -14,7 +14,7 @@ import { WorkflowInputsData } from '~/models/workflow';
 import { createWorkflowMounts } from '~/models/process';
 import { ContainerRequestState } from '~/models/container-request';
 import { navigateToProcess } from '../navigation/navigation-action';
-import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM, VCPUS_FIELD, RAM_FIELD, RUNTIME_FIELD, OUTPUT_FIELD } from '~/views/run-process-panel/run-process-advanced-form';
+import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM, VCPUS_FIELD, RAM_FIELD, RUNTIME_FIELD, OUTPUT_FIELD, API_FIELD } from '~/views/run-process-panel/run-process-advanced-form';
 import { isItemNotInProject, isProjectOrRunProcessRoute } from '~/store/projects/project-create-actions';
 import { dialogActions } from '~/store/dialog/dialog-actions';
 import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
@@ -133,6 +133,7 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
                 API: true,
                 vcpus: advancedForm[VCPUS_FIELD],
                 ram: advancedForm[RAM_FIELD],
+                api: advancedForm[API_FIELD],
             },
             schedulingParameters: {
                 maxRunTime: advancedForm[RUNTIME_FIELD]

commit b496a5389daf0b9d1b304337514c9a2a7e38ff98
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 16:01:51 2018 +0100

    Use value instead of checked in SwitchField
    
    Feature #13708
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/switch-field/switch-field.tsx b/src/components/switch-field/switch-field.tsx
index 4541e371..ac7b140e 100644
--- a/src/components/switch-field/switch-field.tsx
+++ b/src/components/switch-field/switch-field.tsx
@@ -9,6 +9,6 @@ import { SwitchProps } from '@material-ui/core/Switch';
 
 export const SwitchField = ({ switchProps, ...props }: FormFieldProps & { switchProps: SwitchProps }) =>
     <FormField {...props}>
-        {input => <Switch {...switchProps} checked={input.checked} onChange={input.onChange} />}
+        {input => <Switch {...switchProps} checked={input.value} onChange={input.onChange} />}
     </FormField>;
 

commit 5e7459e2089b92e25611d1835bf3a620ba655c60
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 15:56:46 2018 +0100

    Add API field to process advanced form
    
    Feature #13708
    
    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 37e15469..30ff494c 100644
--- a/src/views/run-process-panel/run-process-advanced-form.tsx
+++ b/src/views/run-process-panel/run-process-advanced-form.tsx
@@ -12,6 +12,7 @@ import * as IntInput from './inputs/int-input';
 import { require } from '~/validators/require';
 import { min } from '~/validators/min';
 import { optional } from '~/validators/optional';
+import { SwitchField } from '~/components/switch-field/switch-field';
 
 export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm';
 
@@ -20,6 +21,7 @@ export const RUNTIME_FIELD = 'runtime';
 export const RAM_FIELD = 'ram';
 export const VCPUS_FIELD = 'vcpus';
 export const KEEP_CACHE_RAM_FIELD = 'keepCacheRam';
+export const API_FIELD = 'api';
 
 export interface RunProcessAdvancedFormData {
     [OUTPUT_FIELD]?: string;
@@ -27,6 +29,7 @@ export interface RunProcessAdvancedFormData {
     [RAM_FIELD]: number;
     [VCPUS_FIELD]: number;
     [KEEP_CACHE_RAM_FIELD]?: number;
+    [API_FIELD]?: boolean;
 }
 
 export const RunProcessAdvancedForm =
@@ -92,6 +95,16 @@ export const RunProcessAdvancedForm =
                                 type='number'
                                 validate={keepCacheRamValdation} />
                         </Grid>
+                        <Grid item xs={12} md={6}>
+                            <Field
+                                name={API_FIELD}
+                                component={SwitchField}
+                                switchProps={{
+                                    color: 'primary'
+                                }}
+                                label='API'
+                                helperText='When set, ARVADOS_API_HOST and ARVADOS_API_TOKEN will be set, and process will have networking enabled to access the Arvados API server.' />
+                        </Grid>
                     </Grid>
                 </ExpansionPanelDetails>
             </ExpansionPanel>

commit b02573dbdd8dae7c2f9bdafa2f6ac847168b024a
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 15:56:06 2018 +0100

    Create SwitchField component
    
    Feature #13708
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/switch-field/switch-field.tsx b/src/components/switch-field/switch-field.tsx
new file mode 100644
index 00000000..4541e371
--- /dev/null
+++ b/src/components/switch-field/switch-field.tsx
@@ -0,0 +1,14 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { FormFieldProps, FormField } from '~/components/form-field/form-field';
+import { Switch } from '@material-ui/core';
+import { SwitchProps } from '@material-ui/core/Switch';
+
+export const SwitchField = ({ switchProps, ...props }: FormFieldProps & { switchProps: SwitchProps }) =>
+    <FormField {...props}>
+        {input => <Switch {...switchProps} checked={input.checked} onChange={input.onChange} />}
+    </FormField>;
+

commit 0132e5e4bc0a319295289913ce28e7d93c651d29
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Dec 27 15:55:51 2018 +0100

    Create FormField component
    
    Feature #13708
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/form-field/form-field.tsx b/src/components/form-field/form-field.tsx
new file mode 100644
index 00000000..32362ac4
--- /dev/null
+++ b/src/components/form-field/form-field.tsx
@@ -0,0 +1,41 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { WrappedFieldProps, WrappedFieldInputProps } from 'redux-form';
+import { FormGroup, FormLabel, FormHelperText } from '@material-ui/core';
+
+interface FormFieldCustomProps {
+    children: <P>(props: WrappedFieldInputProps) => React.ReactElement<P>;
+    label?: string;
+    helperText?: string;
+    required?: boolean;
+}
+
+export type FormFieldProps = FormFieldCustomProps & WrappedFieldProps;
+
+export const FormField = ({ children, ...props }: FormFieldProps & WrappedFieldProps) => {
+    return (
+        <FormGroup>
+
+            <FormLabel
+                focused={props.meta.active}
+                required={props.required}
+                error={props.meta.touched && !!props.meta.error}>
+                {props.label}
+            </FormLabel>
+
+            { children(props.input) }
+
+            <FormHelperText error={props.meta.touched && !!props.meta.error}>
+                {
+                    props.meta.touched && props.meta.error
+                        ? props.meta.error
+                        : props.helperText
+                }
+            </FormHelperText>
+
+        </FormGroup>
+    );
+};

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list