// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import { unionize, ofType, UnionOf } from "~/common/unionize"; import { loadProcess } from '~/store/processes/processes-actions'; import { Dispatch } from 'redux'; export const procesPanelActions = unionize({ INIT_PROCESS_PANEL_FILTERS: ofType(), TOGGLE_PROCESS_PANEL_FILTER: ofType(), }); export type ProcessPanelAction = UnionOf; export const toggleProcessPanelFilter = procesPanelActions.TOGGLE_PROCESS_PANEL_FILTER; export const loadProcessPanel = (uuid: string) => (dispatch: Dispatch) => { dispatch(loadProcess(uuid)); dispatch(initProcessPanelFilters); }; export const initProcessPanelFilters = procesPanelActions.INIT_PROCESS_PANEL_FILTERS([ 'Queued', 'Complete', 'Active', 'Failed' ]);