1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { unionize, ofType, UnionOf } from "~/common/unionize";
6 import { loadProcess } from '~/store/processes/processes-actions';
7 import { Dispatch } from 'redux';
8 import { ProcessStatus } from '~/store/processes/process';
10 export const procesPanelActions = unionize({
11 SET_PROCESS_PANEL_FILTERS: ofType<string[]>(),
12 TOGGLE_PROCESS_PANEL_FILTER: ofType<string>(),
15 export type ProcessPanelAction = UnionOf<typeof procesPanelActions>;
17 export const toggleProcessPanelFilter = procesPanelActions.TOGGLE_PROCESS_PANEL_FILTER;
19 export const loadProcessPanel = (uuid: string) =>
20 (dispatch: Dispatch) => {
21 dispatch<any>(loadProcess(uuid));
22 dispatch(initProcessPanelFilters);
25 export const initProcessPanelFilters = procesPanelActions.SET_PROCESS_PANEL_FILTERS([
27 ProcessStatus.COMPLETED,
29 ProcessStatus.RUNNING,
31 ProcessStatus.CANCELLED