16073: Refactor process io loading into actions and reducers to eliminate infinite...
[arvados-workbench2.git] / src / store / process-panel / process-panel.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { CommandInputParameter } from 'models/workflow';
6 import { RouterState } from "react-router-redux";
7 import { matchProcessRoute } from "routes/routes";
8 import { ProcessIOParameter } from "views/process-panel/process-io-card";
9 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
10
11 export type OutputDetails = {
12     rawOutputs?: any;
13     pdh?: string;
14 }
15
16 export interface ProcessPanel {
17     containerRequestUuid: string;
18     filters: { [status: string]: boolean };
19     inputRaw: CommandInputParameter[] | null;
20     inputParams: ProcessIOParameter[] | null;
21     outputRaw: OutputDetails | null;
22     outputDefinitions: CommandOutputParameter[];
23     outputParams: ProcessIOParameter[] | null;
24 }
25
26 export const getProcessPanelCurrentUuid = (router: RouterState) => {
27     const pathname = router.location ? router.location.pathname : '';
28     const match = matchProcessRoute(pathname);
29     return match ? match.params.id : undefined;
30 };