refs #13986 Merge branch 'origin/13986-projects-list-and-default-routing'
authorDaniel Kos <daniel.kos@contractors.roche.com>
Sat, 18 Aug 2018 22:03:23 +0000 (00:03 +0200)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Sat, 18 Aug 2018 22:03:50 +0000 (00:03 +0200)
Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

src/components/data-explorer/data-explorer.tsx
src/components/side-panel/side-panel.tsx
src/store/auth/auth-action.ts
src/store/data-explorer/data-explorer-reducer.test.tsx
src/store/data-explorer/data-explorer-reducer.ts
src/store/navigation/navigation-action.ts
src/store/side-panel/side-panel-action.ts
src/store/side-panel/side-panel-reducer.test.ts
src/store/side-panel/side-panel-reducer.ts
src/views-components/data-explorer/data-explorer.tsx
src/views/workbench/workbench.tsx

index 681caa9478c15d194c0ab1f904a59369b015089a..af14db9c9e08818f3a9dc945718d1296f707d5e8 100644 (file)
@@ -51,6 +51,7 @@ interface DataExplorerDataProps<T> {
 }
 
 interface DataExplorerActionProps<T> {
+    onSetColumns: (columns: DataColumns<T>) => void;
     onSearch: (value: string) => void;
     onRowClick: (item: T) => void;
     onRowDoubleClick: (item: T) => void;
@@ -67,6 +68,11 @@ type DataExplorerProps<T> = DataExplorerDataProps<T> & DataExplorerActionProps<T
 
 export const DataExplorer = withStyles(styles)(
     class DataExplorerGeneric<T> extends React.Component<DataExplorerProps<T>> {
+        componentDidMount() {
+            if (this.props.onSetColumns) {
+                this.props.onSetColumns(this.props.columns);
+            }
+        }
         render() {
             const {
                 columns, onContextMenu, onFiltersChange, onSortToggle, extractKey,
index 206cb6322b84a1d181d451f76d8886328837a969..84e5c5476f5f8266c3464f82c880b9f052a5af42 100644 (file)
@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { ReactElement } from 'react';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { List, ListItem, ListItemIcon, Collapse } from "@material-ui/core";
@@ -11,6 +10,7 @@ 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";
+import { RouteComponentProps, withRouter } from "react-router";
 
 type CssRules = 'active' | 'row' | 'root' | 'list' | 'iconClose' | 'iconOpen' | 'toggableIconContainer' | 'toggableIcon';
 
@@ -54,8 +54,8 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 export interface SidePanelItem {
     id: string;
     name: string;
+    url: string;
     icon: IconType;
-    active?: boolean;
     open?: boolean;
     margin?: boolean;
     openAble?: boolean;
@@ -69,30 +69,34 @@ interface SidePanelDataProps {
     onContextMenu: (event: React.MouseEvent<HTMLElement>, item: SidePanelItem) => void;
 }
 
-type SidePanelProps = SidePanelDataProps & WithStyles<CssRules>;
+type SidePanelProps = RouteComponentProps<{}> & SidePanelDataProps & WithStyles<CssRules>;
 
-export const SidePanel = withStyles(styles)(
+export const SidePanel = withStyles(styles)(withRouter(
     class extends React.Component<SidePanelProps> {
-        render(): ReactElement<any> {
+        render() {
             const { classes, toggleOpen, toggleActive, sidePanelItems, children } = this.props;
             const { root, row, list, toggableIconContainer } = classes;
+
+            const path = this.props.location.pathname.split('/');
+            const activeUrl = path.length > 1 ? "/" + path[1] : "/";
             return (
                 <div className={root}>
                     <List>
-                        {sidePanelItems.map(it => (
-                            <span key={it.name}>
+                        {sidePanelItems.map(it => {
+                            const active = it.url === activeUrl;
+                            return <span key={it.name}>
                                 <ListItem button className={list} onClick={() => toggleActive(it.id)}
                                           onContextMenu={this.handleRowContextMenu(it)}>
                                     <span className={row}>
                                         {it.openAble ? (
                                             <i onClick={() => toggleOpen(it.id)} className={toggableIconContainer}>
                                                 <ListItemIcon
-                                                    className={this.getToggableIconClassNames(it.open, it.active)}>
+                                                    className={this.getToggableIconClassNames(it.open, active)}>
                                                     < SidePanelRightArrowIcon/>
                                                 </ListItemIcon>
                                             </i>
                                         ) : null}
-                                        <ListItemTextIcon icon={it.icon} name={it.name} isActive={it.active}
+                                        <ListItemTextIcon icon={it.icon} name={it.name} isActive={active}
                                                           hasMargin={it.margin}/>
                                     </span>
                                 </ListItem>
@@ -101,8 +105,8 @@ export const SidePanel = withStyles(styles)(
                                         {children}
                                     </Collapse>
                                 ) : null}
-                            </span>
-                        ))}
+                            </span>;
+                        })}
                     </List>
                 </div>
             );
@@ -121,4 +125,4 @@ export const SidePanel = withStyles(styles)(
             (event: React.MouseEvent<HTMLElement>) =>
                 item.openAble ? this.props.onContextMenu(event, item) : null
     }
-);
+));
index 33a5df90450e2cde772c73c8d80c7b06854c4f12..00af5ce5b0bb7614f4fbc97316a61dd712759ba3 100644 (file)
@@ -17,9 +17,9 @@ export const authActions = unionize({
     USER_DETAILS_REQUEST: {},
     USER_DETAILS_SUCCESS: ofType<User>()
 }, {
-        tag: 'type',
-        value: 'payload'
-    });
+    tag: 'type',
+    value: 'payload'
+});
 
 function setAuthorizationHeader(services: ServiceRepository, token: string) {
     services.apiClient.defaults.headers.common = {
index 6b1c90798962032ddc273005b1f1b0c7d41de123..0bc44ba85bf06195bb34ef88500ec807c4b99e54 100644 (file)
@@ -12,9 +12,11 @@ describe('data-explorer-reducer', () => {
     it('should set columns', () => {
         const columns: DataColumns<any> = [{
             name: "Column 1",
+            filters: [],
             render: jest.fn(),
             selected: true,
-            configurable: true
+            configurable: true,
+            sortDirection: SortDirection.NONE
         }];
         const state = dataExplorerReducer(undefined,
             dataExplorerActions.SET_COLUMNS({ id: "Data explorer", columns }));
@@ -24,12 +26,14 @@ describe('data-explorer-reducer', () => {
     it('should toggle sorting', () => {
         const columns: DataColumns<any> = [{
             name: "Column 1",
+            filters: [],
             render: jest.fn(),
             selected: true,
             configurable: true,
             sortDirection: SortDirection.ASC
         }, {
             name: "Column 2",
+            filters: [],
             render: jest.fn(),
             selected: true,
             configurable: true,
@@ -44,9 +48,11 @@ describe('data-explorer-reducer', () => {
     it('should set filters', () => {
         const columns: DataColumns<any> = [{
             name: "Column 1",
+            filters: [],
             render: jest.fn(),
             selected: true,
-            configurable: true
+            configurable: true,
+            sortDirection: SortDirection.NONE
         }];
 
         const filters: DataTableFilterItem[] = [{
index 175cd0b2817fd0ea419f8474f1326bb16bd2dc20..cc800244abc1d0d9c1673bd03743d1eff7024f14 100644 (file)
@@ -67,9 +67,23 @@ export const getDataExplorer = (state: DataExplorerState, id: string) =>
 const update = (state: DataExplorerState, id: string, updateFn: (dataExplorer: DataExplorer) => DataExplorer) =>
     ({ ...state, [id]: updateFn(getDataExplorer(state, id)) });
 
+const canUpdateColumns = (prevColumns: DataColumns<any>, nextColumns: DataColumns<any>) => {
+    if (prevColumns.length !== nextColumns.length) {
+        return true;
+    }
+    for (let i = 0; i < nextColumns.length; i++) {
+        const pc = prevColumns[i];
+        const nc = nextColumns[i];
+        if (pc.key !== nc.key || pc.name !== nc.name) {
+            return true;
+        }
+    }
+    return false;
+};
+
 const setColumns = (columns: DataColumns<any>) =>
     (dataExplorer: DataExplorer) =>
-        ({ ...dataExplorer, columns });
+        ({ ...dataExplorer, columns: canUpdateColumns(dataExplorer.columns, columns) ? columns : dataExplorer.columns });
 
 const mapColumns = (mapFn: (column: DataColumn<any>) => DataColumn<any>) =>
     (dataExplorer: DataExplorer) =>
index 79d24471491fcd5e2ced64a8bdcd8edb6b38bd87..50ec93d25e8091e2186e0eccf7a6f403d0ca90ae 100644 (file)
@@ -3,26 +3,27 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from "redux";
-import { projectActions, getProjectList } from "../project/project-action";
+import { getProjectList, projectActions } from "../project/project-action";
 import { push } from "react-router-redux";
 import { TreeItemStatus } from "~/components/tree/tree";
 import { findTreeItem } from "../project/project-reducer";
 import { RootState } from "../store";
-import { Resource, ResourceKind } from "~/models/resource";
+import { ResourceKind } from "~/models/resource";
 import { projectPanelActions } from "../project-panel/project-panel-action";
 import { getCollectionUrl } from "~/models/collection";
 import { getProjectUrl, ProjectResource } from "~/models/project";
 import { ProjectService } from "~/services/project-service/project-service";
 import { ServiceRepository } from "~/services/services";
 import { sidePanelActions } from "../side-panel/side-panel-action";
-import { SidePanelIdentifiers } from "../side-panel/side-panel-reducer";
+import { SidePanelId } from "../side-panel/side-panel-reducer";
 import { getUuidObjectType, ObjectTypes } from "~/models/object-types";
 
-export const getResourceUrl = <T extends Resource>(resource: T): string => {
-    switch (resource.kind) {
-        case ResourceKind.PROJECT: return getProjectUrl(resource.uuid);
-        case ResourceKind.COLLECTION: return getCollectionUrl(resource.uuid);
-        default: return resource.href;
+export const getResourceUrl = (resourceKind: ResourceKind, resourceUuid: string): string => {
+    switch (resourceKind) {
+        case ResourceKind.PROJECT: return getProjectUrl(resourceUuid);
+        case ResourceKind.COLLECTION: return getCollectionUrl(resourceUuid);
+        default:
+            return '';
     }
 };
 
@@ -38,7 +39,7 @@ export const setProjectItem = (itemId: string, itemMode: ItemMode) =>
         const treeItem = findTreeItem(projects.items, itemId);
 
         if (treeItem) {
-            const resourceUrl = getResourceUrl(treeItem.data);
+            const resourceUrl = getResourceUrl(treeItem.data.kind, treeItem.data.uuid);
 
             if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
                 if (router.location && !router.location.pathname.includes(resourceUrl)) {
@@ -74,8 +75,7 @@ export const restoreBranch = (itemId: string) =>
         const ancestors = await loadProjectAncestors(itemId, services.projectService);
         const uuids = ancestors.map(ancestor => ancestor.uuid);
         await loadBranch(uuids, dispatch);
-        dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelIdentifiers.PROJECTS));
-        dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(SidePanelIdentifiers.PROJECTS));
+        dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
         uuids.forEach(uuid => {
             dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(uuid));
         });
index 0dd6aad19e3ca0ee2e2311cb333a72a83a889176..ecea3535e35040fdbb8095830ea60e21bacff95e 100644 (file)
@@ -3,11 +3,10 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { default as unionize, ofType, UnionOf } from "unionize";
+import { SidePanelId } from "~/store/side-panel/side-panel-reducer";
 
 export const sidePanelActions = unionize({
-    TOGGLE_SIDE_PANEL_ITEM_OPEN: ofType<string>(),
-    TOGGLE_SIDE_PANEL_ITEM_ACTIVE: ofType<string>(),
-    RESET_SIDE_PANEL_ACTIVITY: ofType<{}>(),
+    TOGGLE_SIDE_PANEL_ITEM_OPEN: ofType<SidePanelId>()
 }, {
     tag: 'type',
     value: 'payload'
index 4872a72cf750486565eeaee5f8a36b94f4dc9233..a76e33a49b0508e52e2a8e1cc60cadb2f7d2e97d 100644 (file)
@@ -7,39 +7,14 @@ import { sidePanelActions } from "./side-panel-action";
 import { ProjectsIcon } from "~/components/icon/icon";
 
 describe('side-panel-reducer', () => {
-
-    it('should toggle activity on side-panel', () => {
-        const initialState = [
-            {
-                id: "1",
-                name: "Projects",
-                icon: ProjectsIcon,
-                open: false,
-                active: false,
-            }
-        ];
-        const project = [
-            {
-                id: "1",
-                name: "Projects",
-                icon: ProjectsIcon,
-                open: false,
-                active: true,
-            }
-        ];
-
-        const state = sidePanelReducer(initialState, sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(initialState[0].id));
-        expect(state).toEqual(project);
-    });
-
     it('should open side-panel item', () => {
         const initialState = [
             {
                 id: "1",
                 name: "Projects",
+                url: "/projects",
                 icon: ProjectsIcon,
-                open: false,
-                active: false,
+                open: false
             }
         ];
         const project = [
@@ -48,35 +23,11 @@ describe('side-panel-reducer', () => {
                 name: "Projects",
                 icon: ProjectsIcon,
                 open: true,
-                active: false,
+                url: "/projects"
             }
         ];
 
         const state = sidePanelReducer(initialState, sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(initialState[0].id));
         expect(state).toEqual(project);
     });
-
-    it('should remove activity on side-panel item', () => {
-        const initialState = [
-            {
-                id: "1",
-                name: "Projects",
-                icon: ProjectsIcon,
-                open: false,
-                active: true,
-            }
-        ];
-        const project = [
-            {
-                id: "1",
-                name: "Projects",
-                icon: ProjectsIcon,
-                open: false,
-                active: false,
-            }
-        ];
-
-        const state = sidePanelReducer(initialState, sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(initialState[0].id));
-        expect(state).toEqual(project);
-    });
 });
index 8c73a8f596b6c9a96d0359dd804e7838ce307827..db1cbe5de51a7133b0a26f00a4f427223872e5d9 100644 (file)
@@ -2,7 +2,6 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as _ from "lodash";
 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";
@@ -12,37 +11,20 @@ import { favoritePanelActions } from "../favorite-panel/favorite-panel-action";
 import { projectPanelActions } from "../project-panel/project-panel-action";
 import { projectActions } from "../project/project-action";
 import { getProjectUrl } from "../../models/project";
+import { columns as projectPanelColumns } from "../../views/project-panel/project-panel";
+import { columns as favoritePanelColumns } from "../../views/favorite-panel/favorite-panel";
 
 export type SidePanelState = SidePanelItem[];
 
-export const sidePanelReducer = (state: SidePanelState = sidePanelData, action: SidePanelAction) => {
-    if (state.length === 0) {
-        return sidePanelData;
-    } else {
-        return sidePanelActions.match(action, {
-            TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
-                state.map(it => ({...it, open: itemId === it.id && it.open === false})),
-            TOGGLE_SIDE_PANEL_ITEM_ACTIVE: itemId => {
-                const sidePanel = _.cloneDeep(state);
-                resetSidePanelActivity(sidePanel);
-                sidePanel.forEach(it => {
-                    if (it.id === itemId) {
-                        it.active = true;
-                    }
-                });
-                return sidePanel;
-            },
-            RESET_SIDE_PANEL_ACTIVITY: () => {
-                const sidePanel = _.cloneDeep(state);
-                resetSidePanelActivity(sidePanel);
-                return sidePanel;
-            },
-            default: () => state
-        });
-    }
+export const sidePanelReducer = (state: SidePanelState = sidePanelItems, action: SidePanelAction) => {
+    return sidePanelActions.match(action, {
+        TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
+            state.map(it => ({...it, open: itemId === it.id && it.open === false})),
+        default: () => state
+    });
 };
 
-export enum SidePanelIdentifiers {
+export enum SidePanelId {
     PROJECTS = "Projects",
     SHARED_WITH_ME = "SharedWithMe",
     WORKFLOWS = "Workflows",
@@ -51,61 +33,75 @@ export enum SidePanelIdentifiers {
     TRASH = "Trash"
 }
 
-export const sidePanelData = [
+export const sidePanelItems = [
     {
-        id: SidePanelIdentifiers.PROJECTS,
+        id: SidePanelId.PROJECTS,
         name: "Projects",
+        url: "/projects",
         icon: ProjectsIcon,
         open: false,
         active: false,
         margin: true,
         openAble: true,
         activeAction: (dispatch: Dispatch, uuid: string) => {
-            dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(uuid));
             dispatch(push(getProjectUrl(uuid)));
+            dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(uuid));
+            dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
             dispatch(projectPanelActions.RESET_PAGINATION());
-            dispatch(projectPanelActions.REQUEST_ITEMS()); 
+            dispatch(projectPanelActions.REQUEST_ITEMS());
         }
     },
     {
-        id: SidePanelIdentifiers.SHARED_WITH_ME,
+        id: SidePanelId.SHARED_WITH_ME,
         name: "Shared with me",
+        url: "/shared",
         icon: ShareMeIcon,
         active: false,
+        activeAction: (dispatch: Dispatch) => {
+            dispatch(push("/shared"));
+        }
     },
     {
-        id: SidePanelIdentifiers.WORKFLOWS,
+        id: SidePanelId.WORKFLOWS,
         name: "Workflows",
+        url: "/workflows",
         icon: WorkflowIcon,
         active: false,
+        activeAction: (dispatch: Dispatch) => {
+            dispatch(push("/workflows"));
+        }
     },
     {
-        id: SidePanelIdentifiers.RECENT_OPEN,
+        id: SidePanelId.RECENT_OPEN,
         name: "Recent open",
+        url: "/recent",
         icon: RecentIcon,
         active: false,
+        activeAction: (dispatch: Dispatch) => {
+            dispatch(push("/recent"));
+        }
     },
     {
-        id: SidePanelIdentifiers.FAVORITES,
+        id: SidePanelId.FAVORITES,
         name: "Favorites",
+        url: "/favorites",
         icon: FavoriteIcon,
         active: false,
         activeAction: (dispatch: Dispatch) => {
             dispatch(push("/favorites"));
+            dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
             dispatch(favoritePanelActions.RESET_PAGINATION());
             dispatch(favoritePanelActions.REQUEST_ITEMS());
         }
     },
     {
-        id: SidePanelIdentifiers.TRASH,
+        id: SidePanelId.TRASH,
         name: "Trash",
+        url: "/trash",
         icon: TrashIcon,
         active: false,
+        activeAction: (dispatch: Dispatch) => {
+            dispatch(push("/trash"));
+        }
     }
 ];
-
-function resetSidePanelActivity(sidePanel: SidePanelItem[]) {
-    for (const t of sidePanel) {
-        t.active = false;
-    }
-}
index 68eeb3c144210dbbb247e94f634014d8d3726a98..d548f607f550637cd5a120fc358c620d913bd29b 100644 (file)
@@ -21,48 +21,50 @@ interface Props {
     extractKey?: (item: any) => React.Key;
 }
 
-const mapStateToProps = (state: RootState, { id }: Props) =>
-    getDataExplorer(state.dataExplorer, id);
+const mapStateToProps = (state: RootState, { id, columns }: Props) => {
+    const s = getDataExplorer(state.dataExplorer, id);
+    if (s.columns.length === 0) {
+        s.columns = columns;
+    }
+    return s;
+};
 
 const mapDispatchToProps = () => {
-    let prevColumns: DataColumns<any>;
-    return (dispatch: Dispatch, { id, columns, onRowClick, onRowDoubleClick, onContextMenu }: Props) => {
-        if (columns !== prevColumns) {
-            prevColumns = columns;
+    return (dispatch: Dispatch, { id, columns, onRowClick, onRowDoubleClick, onContextMenu }: Props) => ({
+        onSetColumns: (columns: DataColumns<any>) => {
             dispatch(dataExplorerActions.SET_COLUMNS({ id, columns }));
-        }
-        return {
-            onSearch: (searchValue: string) => {
-                dispatch(dataExplorerActions.SET_SEARCH_VALUE({ id, searchValue }));
-            },
+        },
+
+        onSearch: (searchValue: string) => {
+            dispatch(dataExplorerActions.SET_SEARCH_VALUE({ id, searchValue }));
+        },
 
-            onColumnToggle: (column: DataColumn<any>) => {
-                dispatch(dataExplorerActions.TOGGLE_COLUMN({ id, columnName: column.name }));
-            },
+        onColumnToggle: (column: DataColumn<any>) => {
+            dispatch(dataExplorerActions.TOGGLE_COLUMN({ id, columnName: column.name }));
+        },
 
-            onSortToggle: (column: DataColumn<any>) => {
-                dispatch(dataExplorerActions.TOGGLE_SORT({ id, columnName: column.name }));
-            },
+        onSortToggle: (column: DataColumn<any>) => {
+            dispatch(dataExplorerActions.TOGGLE_SORT({ id, columnName: column.name }));
+        },
 
-            onFiltersChange: (filters: DataTableFilterItem[], column: DataColumn<any>) => {
-                dispatch(dataExplorerActions.SET_FILTERS({ id, columnName: column.name, filters }));
-            },
+        onFiltersChange: (filters: DataTableFilterItem[], column: DataColumn<any>) => {
+            dispatch(dataExplorerActions.SET_FILTERS({ id, columnName: column.name, filters }));
+        },
 
-            onChangePage: (page: number) => {
-                dispatch(dataExplorerActions.SET_PAGE({ id, page }));
-            },
+        onChangePage: (page: number) => {
+            dispatch(dataExplorerActions.SET_PAGE({ id, page }));
+        },
 
-            onChangeRowsPerPage: (rowsPerPage: number) => {
-                dispatch(dataExplorerActions.SET_ROWS_PER_PAGE({ id, rowsPerPage }));
-            },
+        onChangeRowsPerPage: (rowsPerPage: number) => {
+            dispatch(dataExplorerActions.SET_ROWS_PER_PAGE({ id, rowsPerPage }));
+        },
 
-            onRowClick,
+        onRowClick,
 
-            onRowDoubleClick,
+        onRowDoubleClick,
 
-            onContextMenu,
-        };
-    };
+        onContextMenu,
+    });
 };
 
 export const DataExplorer = connect(mapStateToProps, mapDispatchToProps())(DataExplorerComponent);
index 5cf632faf174b655b91b29e456efaceba68d6849..1efac8e8cd5f10fabcb21e956cda847eec7c972f 100644 (file)
@@ -29,7 +29,6 @@ import { CreateProjectDialog } from "~/views-components/create-project-dialog/cr
 
 import { detailsPanelActions, loadDetails } from "~/store/details-panel/details-panel-action";
 import { contextMenuActions } from "~/store/context-menu/context-menu-actions";
-import { SidePanelIdentifiers } from '~/store/side-panel/side-panel-reducer';
 import { ProjectResource } from '~/models/project';
 import { ResourceKind } from '~/models/resource';
 import { ContextMenu, ContextMenuKind } from "~/views-components/context-menu/context-menu";
@@ -222,7 +221,6 @@ export const Workbench = withStyles(styles)(
                                         toggleActive={itemId => {
                                             this.props.dispatch(setProjectItem(itemId, ItemMode.ACTIVE));
                                             this.props.dispatch(loadDetails(itemId, ResourceKind.PROJECT));
-                                            this.props.dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(SidePanelIdentifiers.PROJECTS));
                                         }} />
                                 </SidePanel>
                             </Drawer>}
@@ -330,7 +328,6 @@ export const Workbench = withStyles(styles)(
                         default:
                             this.props.dispatch(loadDetails(item.uuid, ResourceKind.PROJECT));
                             this.props.dispatch(setProjectItem(item.uuid, ItemMode.ACTIVE));
-                            this.props.dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(SidePanelIdentifiers.PROJECTS));
                     }
 
                 }}
@@ -363,7 +360,6 @@ export const Workbench = withStyles(styles)(
             }
 
             toggleSidePanelActive = (itemId: string) => {
-                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);