projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix context menu closeanimation
[arvados-workbench2.git]
/
src
/
store
/
navigation
/
navigation-action.ts
diff --git
a/src/store/navigation/navigation-action.ts
b/src/store/navigation/navigation-action.ts
index a4b9a8f6ede99f23d6ef58ae35710a04ac08912e..3920b5a27c69bf17cfbeca27a7c0bda562662f47 100644
(file)
--- a/
src/store/navigation/navigation-action.ts
+++ b/
src/store/navigation/navigation-action.ts
@@
-3,23
+3,20
@@
// SPDX-License-Identifier: AGPL-3.0
import { Dispatch } from "redux";
// SPDX-License-Identifier: AGPL-3.0
import { Dispatch } from "redux";
-import
projectActions, {
getProjectList } from "../project/project-action";
+import
{ projectActions,
getProjectList } from "../project/project-action";
import { push } from "react-router-redux";
import { TreeItemStatus } from "../../components/tree/tree";
import { push } from "react-router-redux";
import { TreeItemStatus } from "../../components/tree/tree";
-import { getCollectionList } from "../collection/collection-action";
import { findTreeItem } from "../project/project-reducer";
import { findTreeItem } from "../project/project-reducer";
-import { Resource, ResourceKind } from "../../models/resource";
-import sidePanelActions from "../side-panel/side-panel-action";
-import dataExplorerActions from "../data-explorer/data-explorer-action";
+import { dataExplorerActions } from "../data-explorer/data-explorer-action";
import { PROJECT_PANEL_ID } from "../../views/project-panel/project-panel";
import { PROJECT_PANEL_ID } from "../../views/project-panel/project-panel";
-import { projectPanelItems } from "../../views/project-panel/project-panel-selectors";
import { RootState } from "../store";
import { RootState } from "../store";
+import { Resource, ResourceKind } from "../../models/resource";
-export const getResourceUrl =
(resource: Resource
): string => {
+export const getResourceUrl =
<T extends Resource>(resource: T
): string => {
switch (resource.kind) {
switch (resource.kind) {
- case ResourceKind.P
ROJECT
: return `/projects/${resource.uuid}`;
- case ResourceKind.C
OLLECTION
: return `/collections/${resource.uuid}`;
- default: return
""
;
+ case ResourceKind.P
roject
: return `/projects/${resource.uuid}`;
+ case ResourceKind.C
ollection
: return `/collections/${resource.uuid}`;
+ default: return
resource.href
;
}
};
}
};
@@
-36,13
+33,11
@@
export const setProjectItem = (itemId: string, itemMode: ItemMode) =>
if (treeItem) {
if (treeItem) {
- dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY());
-
if (itemMode === ItemMode.OPEN || itemMode === ItemMode.BOTH) {
dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(treeItem.data.uuid));
}
if (itemMode === ItemMode.OPEN || itemMode === ItemMode.BOTH) {
dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(treeItem.data.uuid));
}
- const resourceUrl = getResourceUrl(
{ ...treeItem.data }
);
+ const resourceUrl = getResourceUrl(
treeItem.data
);
if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
if (router.location && !router.location.pathname.includes(resourceUrl)) {
if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
if (router.location && !router.location.pathname.includes(resourceUrl)) {
@@
-56,17
+51,9
@@
export const setProjectItem = (itemId: string, itemMode: ItemMode) =>
: dispatch<any>(getProjectList(itemId));
promise
: dispatch<any>(getProjectList(itemId));
promise
- .then(() => dispatch<any>(getCollectionList(itemId)))
.then(() => dispatch<any>(() => {
.then(() => dispatch<any>(() => {
- const { projects, collections } = getState();
- dispatch(dataExplorerActions.SET_ITEMS({
- id: PROJECT_PANEL_ID,
- items: projectPanelItems(
- projects.items,
- treeItem.data.uuid,
- collections
- )
- }));
+ dispatch(dataExplorerActions.RESET_PAGINATION({id: PROJECT_PANEL_ID}));
+ dispatch(dataExplorerActions.REQUEST_ITEMS({id: PROJECT_PANEL_ID}));
}));
}
}));
}