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 { Dispatch } from 'redux';
8 export const SLIDE_TIMEOUT = 500;
10 export const detailsPanelActions = unionize({
11 TOGGLE_DETAILS_PANEL: ofType<{}>(),
12 LOAD_DETAILS_PANEL: ofType<string>()
15 export type DetailsPanelAction = UnionOf<typeof detailsPanelActions>;
17 export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAILS_PANEL(uuid);
19 export const toggleDetailsPanel = () => (dispatch: Dispatch) => {
20 // because of material-ui issue resizing details panel breaks tabs.
21 // triggering window resize event fixes that.
23 window.dispatchEvent(new Event('resize'));
25 dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());