[ARVADOS-WORKBENCH2] created: 2.2.1-83-g441fa734

Git user git at public.arvados.org
Tue Sep 21 20:32:09 UTC 2021


        at  441fa734bfe5d3158f19d3172aac9dc09e03b800 (commit)


commit 441fa734bfe5d3158f19d3172aac9dc09e03b800
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Sep 21 16:31:44 2021 -0400

    18116: Chips guard against undefined value
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/components/chips/chips.tsx b/src/components/chips/chips.tsx
index eb68ed7a..c4724d1b 100644
--- a/src/components/chips/chips.tsx
+++ b/src/components/chips/chips.tsx
@@ -38,7 +38,7 @@ export const Chips = withStyles(styles)(
         render() {
             const { values, filler } = this.props;
             return <Grid container spacing={8} className={this.props.classes.root}>
-                {values.map(this.renderChip)}
+                {values && values.map(this.renderChip)}
                 {filler && <Grid item xs>{filler}</Grid>}
             </Grid>;
         }
diff --git a/src/views/run-process-panel/inputs/float-array-input.tsx b/src/views/run-process-panel/inputs/float-array-input.tsx
index 780cbc90..3f0a5334 100644
--- a/src/views/run-process-panel/inputs/float-array-input.tsx
+++ b/src/views/run-process-panel/inputs/float-array-input.tsx
@@ -30,7 +30,7 @@ const validationSelector = createSelector(
 );
 
 const required = (value: string[]) =>
-    value.length > 0
+    value && value.length > 0
         ? undefined
         : ERROR_MESSAGE;
 
diff --git a/src/views/run-process-panel/inputs/int-array-input.tsx b/src/views/run-process-panel/inputs/int-array-input.tsx
index 03cb07ea..8077f28a 100644
--- a/src/views/run-process-panel/inputs/int-array-input.tsx
+++ b/src/views/run-process-panel/inputs/int-array-input.tsx
@@ -30,7 +30,7 @@ const validationSelector = createSelector(
 );
 
 const required = (value: string[]) =>
-    value.length > 0
+    value && value.length > 0
         ? undefined
         : ERROR_MESSAGE;
 
diff --git a/src/views/run-process-panel/inputs/string-array-input.tsx b/src/views/run-process-panel/inputs/string-array-input.tsx
index cabbf749..8955009a 100644
--- a/src/views/run-process-panel/inputs/string-array-input.tsx
+++ b/src/views/run-process-panel/inputs/string-array-input.tsx
@@ -31,7 +31,7 @@ const validationSelector = createSelector(
 );
 
 const required = (value: string[] = []) =>
-    value.length > 0
+    value && value.length > 0
         ? undefined
         : ERROR_MESSAGE;
 

commit 4eff29a4826257cf015bd1cac7c1497b6d5b804c
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Sep 21 16:29:24 2021 -0400

    18116: Chips guard against invariant bug
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/components/chips/chips.tsx b/src/components/chips/chips.tsx
index 2a6fafc3..eb68ed7a 100644
--- a/src/components/chips/chips.tsx
+++ b/src/components/chips/chips.tsx
@@ -43,10 +43,13 @@ export const Chips = withStyles(styles)(
             </Grid>;
         }
 
-        renderChip = (value: Value, index: number) =>
-            <Grid item key={index}>
-                <this.chip {...{ value }} />
+        renderChip = (value: Value, index: number) => {
+            const { deletable, getLabel } = this.props;
+            return <Grid item key={index}>
+                <Chip onDelete={deletable ? this.deleteValue(value) : undefined}
+                    label={getLabel !== undefined ? getLabel(value) : value} />
             </Grid>
+        }
 
         type = 'chip';
 
@@ -132,4 +135,4 @@ interface CollectedProps {
 
 interface DraggableChipProps<Value> {
     value: Value;
-}
\ No newline at end of file
+}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list