import { SidePanelRightArrowIcon, IconType } from '../icon/icon';
import * as classnames from "classnames";
import { ListItemTextIcon } from '../list-item-text-icon/list-item-text-icon';
+import { Dispatch } from "redux";
type CssRules = 'active' | 'row' | 'root' | 'list' | 'iconClose' | 'iconOpen' | 'toggableIconContainer' | 'toggableIcon';
open?: boolean;
margin?: boolean;
openAble?: boolean;
- path?: string;
+ activeAction?: (dispatch: Dispatch) => void;
}
interface SidePanelDataProps {
import { sidePanelActions, SidePanelAction } from './side-panel-action';
import { SidePanelItem } from '../../components/side-panel/side-panel';
import { ProjectsIcon, ShareMeIcon, WorkflowIcon, RecentIcon, FavoriteIcon, TrashIcon } from "../../components/icon/icon";
+import { dataExplorerActions } from "../data-explorer/data-explorer-action";
+import { Dispatch } from "react-redux";
+import { FAVORITE_PANEL_ID } from "../../views/favorite-panel/favorite-panel";
+import { push } from "react-router-redux";
export type SidePanelState = SidePanelItem[];
name: "Favorites",
icon: FavoriteIcon,
active: false,
- path: '/favorites'
+ activeAction: (dispatch: Dispatch) => {
+ dispatch(push("/favorites"));
+ dispatch(dataExplorerActions.RESET_PAGINATION({id: FAVORITE_PANEL_ID}));
+ dispatch(dataExplorerActions.REQUEST_ITEMS({id: FAVORITE_PANEL_ID}));
+ }
},
{
id: SidePanelIdentifiers.Trash,
this.props.dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(itemId));
this.props.dispatch(projectActions.RESET_PROJECT_TREE_ACTIVITY(itemId));
const panelItem = this.props.sidePanelItems.find(it => it.id === itemId);
- this.props.dispatch(push(panelItem && panelItem.path ? panelItem.path : "/"));
+ if (panelItem && panelItem.activeAction) {
+ panelItem.activeAction(this.props.dispatch);
+ }
}
handleCreationDialogOpen = (itemUuid: string) => {