1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { RunProcessPanelAction, runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions';
6 import { WorkflowResource } from '~/models/workflow';
8 interface RunProcessPanel {
10 workflows: WorkflowResource[];
11 selectedWorkflow: WorkflowResource | undefined;
14 const initialState: RunProcessPanel = {
17 selectedWorkflow: undefined
20 export const runProcessPanelReducer = (state = initialState, action: RunProcessPanelAction): RunProcessPanel =>
21 runProcessPanelActions.match(action, {
22 SET_CURRENT_STEP: currentStep => ({ ...state, currentStep }),
23 SET_WORKFLOWS: workflows => ({ ...state, workflows }),
24 SET_SELECTED_WORKFLOW: selectedWorkflow => ({ ...state, selectedWorkflow }),