[ARVADOS-WORKBENCH2] created: 2.1.0-296-ga6c092fe

Git user git at public.arvados.org
Tue Apr 6 22:28:19 UTC 2021


        at  a6c092fe45fe0ff310800e82e224bc822890491a (commit)


commit a6c092fe45fe0ff310800e82e224bc822890491a
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Apr 6 18:27:56 2021 -0400

    17427: Add some optional parameters to openRunProcess()
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.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 8646164e..d9686feb 100644
--- a/src/store/run-process-panel/run-process-panel-actions.ts
+++ b/src/store/run-process-panel/run-process-panel-actions.ts
@@ -21,7 +21,6 @@ import {
 } from '~/views/run-process-panel/run-process-advanced-form';
 import { dialogActions } from '~/store/dialog/dialog-actions';
 import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
-import { matchProjectRoute } from '~/routes/routes';
 
 export const runProcessPanelActions = unionize({
     SET_PROCESS_PATHNAME: ofType<string>(),
@@ -144,9 +143,8 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
     const inputsForm = getFormValues(RUN_PROCESS_INPUTS_FORM)(state) as WorkflowInputsData;
     const userUuid = getUserUuid(getState());
     if (!userUuid) { return; }
-    const pathname = getState().runProcessPanel.processPathname;
     const { processOwnerUuid, selectedWorkflow } = state.runProcessPanel;
-    const ownerUUid = !matchProjectRoute(pathname) ? userUuid : processOwnerUuid;
+    const ownerUUid = processOwnerUuid ? processOwnerUuid : userUuid;
     if (selectedWorkflow) {
         const advancedForm = getFormValues(RUN_PROCESS_ADVANCED_FORM)(state) as RunProcessAdvancedFormData || getWorkflowRunnerSettings(selectedWorkflow);
         const newProcessData = {
diff --git a/src/store/workflow-panel/workflow-panel-actions.ts b/src/store/workflow-panel/workflow-panel-actions.ts
index 4cfcd8b9..b4825209 100644
--- a/src/store/workflow-panel/workflow-panel-actions.ts
+++ b/src/store/workflow-panel/workflow-panel-actions.ts
@@ -12,6 +12,8 @@ import { navigateToRunProcess } from '~/store/navigation/navigation-action';
 import { goToStep, runProcessPanelActions, loadPresets, getWorkflowRunnerSettings } from '~/store/run-process-panel/run-process-panel-actions';
 import { snackbarActions } from '~/store/snackbar/snackbar-actions';
 import { initialize } from 'redux-form';
+import { RUN_PROCESS_BASIC_FORM } from '~/views/run-process-panel/run-process-basic-form';
+import { RUN_PROCESS_INPUTS_FORM } from '~/views/run-process-panel/run-process-inputs-form';
 import { RUN_PROCESS_ADVANCED_FORM } from '~/views/run-process-panel/run-process-advanced-form';
 
 export const WORKFLOW_PANEL_ID = "workflowPanel";
@@ -33,17 +35,30 @@ export const getUuidPrefix = (state: RootState) => {
     return state.properties.uuidPrefix;
 };
 
-export const openRunProcess = (uuid: string) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+export const openRunProcess = (workflowUuid: string, ownerUuid?: string, name?: string, inputObj?: { [key: string]: any }) =>
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        const response = await services.workflowService.list();
+        dispatch(runProcessPanelActions.SET_WORKFLOWS(response.items));
+
         const workflows = getState().runProcessPanel.searchWorkflows;
-        const workflow = workflows.find(workflow => workflow.uuid === uuid);
+        const workflow = workflows.find(workflow => workflow.uuid === workflowUuid);
         if (workflow) {
             dispatch<any>(navigateToRunProcess);
             dispatch<any>(goToStep(1));
             dispatch(runProcessPanelActions.SET_STEP_CHANGED(true));
             dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
             dispatch<any>(loadPresets(workflow.uuid));
+
             dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, getWorkflowRunnerSettings(workflow)));
+            if (ownerUuid) {
+                dispatch(runProcessPanelActions.SET_PROCESS_OWNER_UUID(ownerUuid));
+            }
+            if (name) {
+                dispatch(initialize(RUN_PROCESS_BASIC_FORM, { name }));
+            }
+            if (inputObj) {
+                dispatch(initialize(RUN_PROCESS_INPUTS_FORM, inputObj));
+            }
         } else {
             dispatch<any>(snackbarActions.OPEN_SNACKBAR({ message: `You can't run this process` }));
         }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list