// SPDX-License-Identifier: AGPL-3.0
import { unionize, ofType, UnionOf } from '~/common/unionize';
+import { Dispatch } from 'redux';
export const detailsPanelActions = unionize({
TOGGLE_DETAILS_PANEL: ofType<{}>(),
export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAILS_PANEL(uuid);
-
-
-
+export const toggleDetailsPanel = () => (dispatch: Dispatch) => {
+ // because of material-ui issue resizing details panel breaks tabs.
+ // triggering window resize event fixes that.
+ const detailsPanelAnimationDuration = 500;
+ setTimeout(() => {
+ window.dispatchEvent(new Event('resize'));
+ }, detailsPanelAnimationDuration);
+ dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+};
import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
import { openSharingDialog } from '~/store/sharing-dialog/sharing-dialog-actions';
import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const collectionActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
},
// {
import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const collectionResourceActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
},
{
import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
import { openProcessInputDialog } from "~/store/processes/process-input-actions";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const processActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
},
// {
import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const processResourceActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
}
// {
import { ShareIcon } from '~/components/icon/icon';
import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const projectActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
},
{
import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
export const trashedCollectionActionSet: ContextMenuActionSet = [[
{
icon: DetailsIcon,
name: "View details",
execute: dispatch => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
},
{
import { getResource } from '~/store/resources/resources';
import { ResourceData } from "~/store/resources-data/resources-data-reducer";
import { getResourceData } from "~/store/resources-data/resources-data";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
type CssRules = 'root' | 'container' | 'opened' | 'headerContainer' | 'headerIcon' | 'tabContainer';
const mapDispatchToProps = (dispatch: Dispatch) => ({
onCloseDrawer: () => {
- dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+ dispatch<any>(toggleDetailsPanel());
}
});
import { connect } from 'react-redux';
import { RootState } from '~/store/store';
import { matchWorkflowRoute } from '~/routes/routes';
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
interface MainContentBarProps {
onDetailsPanelToggle: () => void;
export const MainContentBar = connect((state: RootState) => ({
buttonVisible: !isWorkflowPath(state)
}), {
- onDetailsPanelToggle: detailsPanelActions.TOGGLE_DETAILS_PANEL
+ onDetailsPanelToggle: toggleDetailsPanel
})((props: MainContentBarProps) =>
<Toolbar>
<Grid container>