[arvados-workbench2] updated: 2.4.0-369-gb321c4ab

git repository hosting git at public.arvados.org
Wed Dec 14 20:22:22 UTC 2022


Summary of changes:
 .../run-process-panel/inputs/directory-input.tsx   | 28 ++++++++++++++-----
 src/views/run-process-panel/inputs/file-input.tsx  | 31 +++++++++++++++++-----
 .../run-process-panel/inputs/project-input.tsx     | 26 ++++++++++++++----
 3 files changed, 67 insertions(+), 18 deletions(-)

       via  b321c4ab41ef13dfb43c7e64aee395c4db161872 (commit)
      from  3b6cfdaf240a9a542cd5845524702aaf25a98e2c (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 b321c4ab41ef13dfb43c7e64aee395c4db161872
Author: Stephen Smith <stephen at curii.com>
Date:   Wed Dec 14 15:21:37 2022 -0500

    19783: Add dialog height to picker dialogs that previously depended on picker height being static
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views/run-process-panel/inputs/directory-input.tsx b/src/views/run-process-panel/inputs/directory-input.tsx
index 2120de99..1faf7381 100644
--- a/src/views/run-process-panel/inputs/directory-input.tsx
+++ b/src/views/run-process-panel/inputs/directory-input.tsx
@@ -6,7 +6,7 @@ import React from 'react';
 import { connect, DispatchProp } from 'react-redux';
 import { memoize } from 'lodash/fp';
 import { Field } from 'redux-form';
-import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core';
+import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button, StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core';
 import {
     isRequiredInput,
     DirectoryCommandInputParameter,
@@ -26,6 +26,9 @@ export interface DirectoryInputProps {
     input: DirectoryCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
+
+type DialogContentCssRules = 'root';
+
 export const DirectoryInput = ({ input, options }: DirectoryInputProps) =>
     <Field
         name={input.id}
@@ -114,6 +117,12 @@ const DirectoryInputComponent = connect()(
                 {...this.props} />;
         }
 
+        dialogContentStyles: StyleRulesCallback<DialogContentCssRules> = ({ spacing }) => ({
+            root: {
+                height: `${spacing.unit * 8}vh`,
+            },
+        });
+
         renderDialog() {
             return <Dialog
                 open={this.state.open}
@@ -123,11 +132,7 @@ const DirectoryInputComponent = connect()(
                 maxWidth='md'>
                 <DialogTitle>Choose a directory</DialogTitle>
                 <DialogContent>
-                    <ProjectsTreePicker
-                        pickerId={this.props.commandInput.id}
-                        includeCollections
-                        options={this.props.options}
-                        toggleItemActive={this.setDirectory} />
+                    <this.dialogContent />
                 </DialogContent>
                 <DialogActions>
                     <Button onClick={this.closeDialog}>Cancel</Button>
@@ -140,4 +145,15 @@ const DirectoryInputComponent = connect()(
             </Dialog>;
         }
 
+        dialogContent = withStyles(this.dialogContentStyles)(
+            ({ classes }: WithStyles<DialogContentCssRules>) =>
+                <div className={classes.root}>
+                    <ProjectsTreePicker
+                        pickerId={this.props.commandInput.id}
+                        includeCollections
+                        options={this.props.options}
+                        toggleItemActive={this.setDirectory} />
+                </div>
+        );
+
     });
diff --git a/src/views/run-process-panel/inputs/file-input.tsx b/src/views/run-process-panel/inputs/file-input.tsx
index 24ea0b79..fd1440c3 100644
--- a/src/views/run-process-panel/inputs/file-input.tsx
+++ b/src/views/run-process-panel/inputs/file-input.tsx
@@ -12,7 +12,7 @@ import {
 } from 'models/workflow';
 import { Field } from 'redux-form';
 import { ERROR_MESSAGE } from 'validators/require';
-import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core';
+import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button, StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core';
 import { GenericInputProps, GenericInput } from './generic-input';
 import { ProjectsTreePicker } from 'views-components/projects-tree-picker/projects-tree-picker';
 import { connect, DispatchProp } from 'react-redux';
@@ -25,6 +25,9 @@ export interface FileInputProps {
     input: FileCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
+
+type DialogContentCssRules = 'root';
+
 export const FileInput = ({ input, options }: FileInputProps) =>
     <Field
         name={input.id}
@@ -113,6 +116,12 @@ const FileInputComponent = connect()(
                 {...this.props} />;
         }
 
+        dialogContentStyles: StyleRulesCallback<DialogContentCssRules> = ({ spacing }) => ({
+            root: {
+                height: `${spacing.unit * 8}vh`,
+            },
+        });
+
         renderDialog() {
             return <Dialog
                 open={this.state.open}
@@ -122,12 +131,7 @@ const FileInputComponent = connect()(
                 maxWidth='md'>
                 <DialogTitle>Choose a file</DialogTitle>
                 <DialogContent>
-                    <ProjectsTreePicker
-                        pickerId={this.props.commandInput.id}
-                        includeCollections
-                        includeFiles
-                        options={this.props.options}
-                        toggleItemActive={this.setFile} />
+                    <this.dialogContent />
                 </DialogContent>
                 <DialogActions>
                     <Button onClick={this.closeDialog}>Cancel</Button>
@@ -140,4 +144,17 @@ const FileInputComponent = connect()(
             </Dialog >;
         }
 
+        dialogContent = withStyles(this.dialogContentStyles)(
+            ({ classes }: WithStyles<DialogContentCssRules>) =>
+                <div className={classes.root}>
+                    <ProjectsTreePicker
+                        pickerId={this.props.commandInput.id}
+                        includeCollections
+                        includeFiles
+                        options={this.props.options}
+                        toggleItemActive={this.setFile} />
+                </div>
+        );
+
+
     });
diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx
index 9cf16c31..761cd1ed 100644
--- a/src/views/run-process-panel/inputs/project-input.tsx
+++ b/src/views/run-process-panel/inputs/project-input.tsx
@@ -5,7 +5,7 @@
 import React from 'react';
 import { connect, DispatchProp } from 'react-redux';
 import { Field } from 'redux-form';
-import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core';
+import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button, withStyles, WithStyles, StyleRulesCallback } from '@material-ui/core';
 import {
     GenericCommandInputParameter
 } from 'models/workflow';
@@ -27,6 +27,9 @@ export interface ProjectInputProps {
     input: ProjectCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
+
+type DialogContentCssRules = 'root';
+
 export const ProjectInput = ({ input, options }: ProjectInputProps) =>
     <Field
         name={input.id}
@@ -109,6 +112,12 @@ export const ProjectInputComponent = connect(mapStateToProps)(
                 {...this.props} />;
         }
 
+        dialogContentStyles: StyleRulesCallback<DialogContentCssRules> = ({ spacing }) => ({
+            root: {
+                height: `${spacing.unit * 8}vh`,
+            },
+        });
+
         renderDialog() {
             return this.state.open ? <Dialog
                 open={this.state.open}
@@ -118,10 +127,7 @@ export const ProjectInputComponent = connect(mapStateToProps)(
                 maxWidth='md'>
                 <DialogTitle>Choose a project</DialogTitle>
                 <DialogContent>
-                    <ProjectsTreePicker
-                        pickerId={this.props.commandInput.id}
-                        options={this.props.options}
-                        toggleItemActive={this.setProject} />
+                    <this.dialogContent />
                 </DialogContent>
                 <DialogActions>
                     <Button onClick={this.closeDialog}>Cancel</Button>
@@ -134,4 +140,14 @@ export const ProjectInputComponent = connect(mapStateToProps)(
             </Dialog> : null;
         }
 
+        dialogContent = withStyles(this.dialogContentStyles)(
+            ({ classes }: WithStyles<DialogContentCssRules>) =>
+                <div className={classes.root}>
+                    <ProjectsTreePicker
+                        pickerId={this.props.commandInput.id}
+                        options={this.props.options}
+                        toggleItemActive={this.setProject} />
+                </div>
+        );
+
     });

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list