[arvados-workbench2] updated: 2.4.0-70-gf912f003

git repository hosting git at public.arvados.org
Mon May 23 16:01:26 UTC 2022


Summary of changes:
 cypress/integration/side-panel.spec.js             |  1 -
 src/models/collection.ts                           |  1 +
 src/routes/route-change-handlers.ts                |  3 -
 src/store/navigation/navigation-action.ts          |  3 -
 src/store/processes/processes-actions.ts           |  2 +-
 .../resource-type-filters.test.ts                  | 15 ++++
 .../resource-type-filters/resource-type-filters.ts |  7 ++
 .../run-process-panel-actions.test.ts              | 24 +++----
 .../run-process-panel/run-process-panel-actions.ts |  2 +-
 .../side-panel-tree/side-panel-tree-actions.ts     |  2 -
 src/store/workbench/workbench-actions.ts           |  8 +--
 .../side-panel-tree/side-panel-tree.tsx            |  5 +-
 .../{directory-input.tsx => project-input.tsx}     | 80 ++++++++--------------
 .../run-process-panel/run-process-basic-form.tsx   |  8 +++
 .../run-process-panel/run-process-second-step.tsx  | 11 +--
 .../workflow-panel/workflow-description-card.tsx   | 11 ---
 16 files changed, 78 insertions(+), 105 deletions(-)
 copy src/views/run-process-panel/inputs/{directory-input.tsx => project-input.tsx} (59%)

       via  f912f003853b42c745041796220e28536629a548 (commit)
       via  8c5147b7367e994e897357766a85e9b7b8e28f24 (commit)
       via  ae6892150bb19c974d8af4cb323760f52a2ea19e (commit)
       via  d416c9aa7b70da4f8998792a42616b991d882f26 (commit)
       via  0e3d1681d9ed60bae0b91b368efb1325f5aee239 (commit)
       via  015c7956121aceeade3d92243022c51e552d7a32 (commit)
       via  57e121908bd6a8767cb9e29288d71e51bf1c6911 (commit)
      from  3c3d3d40033879249cd8e8f483f30cfa565d31bd (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 f912f003853b42c745041796220e28536629a548
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon May 23 12:01:07 2022 -0400

    19143: Picker opens, needs to be hooked in
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index 6bd2976c..11106e49 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -60,7 +60,7 @@ export const reRunProcess = (processUuid: string, workflowUuid: string) =>
             const stringifiedDefinition = JSON.stringify(process.mounts[MOUNT_PATH_CWL_WORKFLOW].content);
             const newWorkflow = { ...workflow, definition: stringifiedDefinition };
 
-            const basicInitialData: RunProcessBasicFormData = { name: `Copy of: ${process.name}`, description: process.description };
+            const basicInitialData: RunProcessBasicFormData = { name: `Copy of: ${process.name}`, description: process.description, ownerUuid: workflow.ownerUuid };
             dispatch<any>(initialize(RUN_PROCESS_BASIC_FORM, basicInitialData));
 
             const advancedInitialData: RunProcessAdvancedFormData = {
diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx
new file mode 100644
index 00000000..03e02920
--- /dev/null
+++ b/src/views/run-process-panel/inputs/project-input.tsx
@@ -0,0 +1,125 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+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 {
+    GenericCommandInputParameter
+} from 'models/workflow';
+import { GenericInputProps, GenericInput } from './generic-input';
+import { ProjectsTreePicker } from 'views-components/projects-tree-picker/projects-tree-picker';
+import { initProjectsTreePicker } from 'store/tree-picker/tree-picker-actions';
+import { TreeItem } from 'components/tree/tree';
+import { ProjectsTreePickerItem } from 'views-components/projects-tree-picker/generic-projects-tree-picker';
+import { ProjectResource } from 'models/project';
+import { ResourceKind } from 'models/resource';
+
+const WORKFLOW_OWNER_PROJECT = "WORKFLOW_OWNER_PROJECT";
+
+export interface ProjectInputProps {
+    options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
+}
+export const ProjectInput = ({ options }: ProjectInputProps) =>
+    <Field
+        name={WORKFLOW_OWNER_PROJECT}
+        commandInput={{
+            label: "Owner project"
+        }}
+        component={ProjectInputComponent as any}
+        format={format}
+        {...{
+            options
+        }} />;
+
+const format = (value?: ProjectResource) => value ? value.name : '';
+
+interface ProjectInputComponentState {
+    open: boolean;
+    project?: ProjectResource;
+}
+
+const ProjectInputComponent = connect()(
+    class ProjectInputComponent extends React.Component<GenericInputProps & DispatchProp & {
+        options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
+    }, ProjectInputComponentState> {
+        state: ProjectInputComponentState = {
+            open: false,
+        };
+
+        componentDidMount() {
+            this.props.dispatch<any>(
+                initProjectsTreePicker(WORKFLOW_OWNER_PROJECT));
+        }
+
+        render() {
+            return <>
+                {this.renderInput()}
+                {this.renderDialog()}
+            </>;
+        }
+
+        openDialog = () => {
+            this.setState({ open: true });
+        }
+
+        closeDialog = () => {
+            this.setState({ open: false });
+        }
+
+        submit = () => {
+            this.closeDialog();
+            this.props.input.onChange(this.state.project);
+        }
+
+        setProject = (_: {}, { data }: TreeItem<ProjectsTreePickerItem>) => {
+            if ('kind' in data && data.kind === ResourceKind.PROJECT) {
+                this.setState({ project: data });
+            } else {
+                this.setState({ project: undefined });
+            }
+        }
+
+        renderInput() {
+            return <GenericInput
+                component={props =>
+                    <Input
+                        readOnly
+                        fullWidth
+                        value={props.input.value}
+                        error={props.meta.touched && !!props.meta.error}
+                        disabled={props.commandInput.disabled}
+                        onClick={!this.props.commandInput.disabled ? this.openDialog : undefined}
+                        onKeyPress={!this.props.commandInput.disabled ? this.openDialog : undefined} />}
+                {...this.props} />;
+        }
+
+        renderDialog() {
+            return <Dialog
+                open={this.state.open}
+                onClose={this.closeDialog}
+                fullWidth
+                data-cy="choose-a-project-dialog"
+                maxWidth='md'>
+                <DialogTitle>Choose a project</DialogTitle>
+                <DialogContent>
+                    <ProjectsTreePicker
+                        pickerId={WORKFLOW_OWNER_PROJECT}
+                        includeCollections
+                        options={this.props.options}
+                        toggleItemActive={this.setProject} />
+                </DialogContent>
+                <DialogActions>
+                    <Button onClick={this.closeDialog}>Cancel</Button>
+                    <Button
+                        disabled={!this.state.project}
+                        variant='contained'
+                        color='primary'
+                        onClick={this.submit}>Ok</Button>
+                </DialogActions>
+            </Dialog>;
+        }
+
+    });
diff --git a/src/views/run-process-panel/run-process-basic-form.tsx b/src/views/run-process-panel/run-process-basic-form.tsx
index 13d882ba..1417c074 100644
--- a/src/views/run-process-panel/run-process-basic-form.tsx
+++ b/src/views/run-process-panel/run-process-basic-form.tsx
@@ -6,6 +6,7 @@ import React from 'react';
 import { reduxForm, Field } from 'redux-form';
 import { Grid } from '@material-ui/core';
 import { TextField } from 'components/text-field/text-field';
+import { ProjectInput } from 'views/run-process-panel/inputs/project-input';
 import { PROCESS_NAME_VALIDATION } from 'validators/validators';
 
 export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm';
@@ -13,6 +14,7 @@ export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm';
 export interface RunProcessBasicFormData {
     name: string;
     description: string;
+    ownerUuid?: string;
 }
 export const RunProcessBasicForm =
     reduxForm<RunProcessBasicFormData>({
@@ -34,5 +36,11 @@ export const RunProcessBasicForm =
                         component={TextField as any}
                         label="Enter a description for run process" />
                 </Grid>
+                <Grid item xs={12} md={6}>
+                    <Field
+                        name='ownerUuid'
+                        component={ProjectInput as any}
+                        label="Project to run the process in" />
+                </Grid>
             </Grid>
         </form>);
diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index f25a8e64..df1b2811 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -21,10 +21,6 @@ import { WorkflowIcon } from 'components/icon/icon';
 import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
 import { parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
 import { WorkflowDetailsCardDataProps, WorkflowDetailsAttributes } from 'views-components/details-panel/workflow-details';
-import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
-import { DetailsAttribute } from 'components/details-attribute/details-attribute';
-import { ResourceOwnerWithName } from 'views-components/data-explorer/renderers';
-import { formatDate } from "common/formatters";
 
 export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable';
 

commit 8c5147b7367e994e897357766a85e9b7b8e28f24
Merge: 3c3d3d40 ae689215
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon May 23 11:15:44 2022 -0400

    Merge branch '19069-workflow-launching' into 19143-project-list-workflows
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --cc src/store/resource-type-filters/resource-type-filters.ts
index b1c52e4f,0539cefe..64a391ca
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@@ -84,10 -83,9 +85,11 @@@ export const getInitialResourceTypeFilt
          initFilter(ObjectTypeFilter.COLLECTION),
          initFilter(CollectionTypeFilter.GENERAL_COLLECTION, ObjectTypeFilter.COLLECTION),
          initFilter(CollectionTypeFilter.OUTPUT_COLLECTION, ObjectTypeFilter.COLLECTION),
+         initFilter(CollectionTypeFilter.INTERMEDIATE_COLLECTION, ObjectTypeFilter.COLLECTION),
          initFilter(CollectionTypeFilter.LOG_COLLECTION, ObjectTypeFilter.COLLECTION),
      ),
 +    initFilter(ObjectTypeFilter.WORKFLOW)
 +
  );
  
  export const getInitialProcessTypeFilters = pipe(
diff --cc src/views/workflow-panel/workflow-description-card.tsx
index e93caea4,d03f46e4..f25a8e64
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@@ -19,10 -20,10 +19,12 @@@ import 
  import { ArvadosTheme } from 'common/custom-theme';
  import { WorkflowIcon } from 'components/icon/icon';
  import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
 +import { parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
- // import { WorkflowGraph } from "views/workflow-panel/workflow-graph";
- 
 +import { WorkflowDetailsCardDataProps, WorkflowDetailsAttributes } from 'views-components/details-panel/workflow-details';
+ import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
+ import { DetailsAttribute } from 'components/details-attribute/details-attribute';
+ import { ResourceOwnerWithName } from 'views-components/data-explorer/renderers';
+ import { formatDate } from "common/formatters";
  
  export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable';
  

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list