Merge branch 'master' into 14466-handling-an-error-which-occurs-when-trying-to-upload...
[arvados-workbench2.git] / src / store / process-logs-panel / process-logs-panel.ts
1 import { RootState } from '../store';
2 import { matchProcessLogRoute } from '~/routes/routes';
3 // Copyright (C) The Arvados Authors. All rights reserved.
4 //
5 // SPDX-License-Identifier: AGPL-3.0
6
7 export interface ProcessLogsPanel {
8     filters: string[];
9     selectedFilter: string;
10     logs: ProcessLogs;
11 }
12
13 export interface ProcessLogs {
14     [logType: string]: string[];
15 }
16
17 export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel) => {
18     return logs[selectedFilter];
19 };
20
21 export const getProcessLogsPanelCurrentUuid = ({ router }: RootState) => {
22     const pathname = router.location ? router.location.pathname : '';
23     const match = matchProcessLogRoute(pathname);
24     return match ? match.params.id : undefined;
25 };