15012: Adds 'All Processes' item to left panel tree.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 30 Dec 2019 20:22:27 +0000 (17:22 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 21 Jan 2020 16:32:00 +0000 (13:32 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/routes/routes.ts
src/store/navigation/navigation-action.ts
src/store/side-panel-tree/side-panel-tree-actions.ts
src/store/side-panel/side-panel-action.ts
src/views-components/side-panel-tree/side-panel-tree.tsx

index bb518d3fcfe803f109c56ac379646edc7b0f9c14..ced460e77ceeb0689a7467a5f332304097345aa8 100644 (file)
@@ -47,6 +47,7 @@ export const Routes = {
     LINKS: '/links',
     PUBLIC_FAVORITES: '/public-favorites',
     COLLECTIONS_CONTENT_ADDRESS: '/collections/:id',
+    ALL_PROCESSES: '/all_processes',
 };
 
 export const getResourceUrl = (uuid: string) => {
index 5ece1abaa1488cb989a2a9e306624dfa8c693206..fda6ec71183b8f2b8970269b0fa59f88ad96a030 100644 (file)
@@ -14,23 +14,41 @@ import { GROUPS_PANEL_LABEL } from '~/store/breadcrumbs/breadcrumbs-actions';
 export const navigateTo = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState) => {
         const kind = extractUuidKind(uuid);
-        if (kind === ResourceKind.PROJECT || kind === ResourceKind.USER || kind === ResourceKind.COLLECTION || kind === ResourceKind.CONTAINER_REQUEST) {
-            dispatch<any>(pushOrGoto(getNavUrl(uuid, getState().auth)));
-        } else if (kind === ResourceKind.VIRTUAL_MACHINE) {
-            dispatch<any>(navigateToAdminVirtualMachines);
+
+        switch (kind) {
+            case ResourceKind.PROJECT:
+            case ResourceKind.USER:
+            case ResourceKind.COLLECTION:
+            case ResourceKind.CONTAINER_REQUEST:
+                dispatch<any>(pushOrGoto(getNavUrl(uuid, getState().auth)));
+                return;
+            case ResourceKind.VIRTUAL_MACHINE:
+                dispatch<any>(navigateToAdminVirtualMachines);
+                return;
         }
-        if (uuid === SidePanelTreeCategory.FAVORITES) {
-            dispatch<any>(navigateToFavorites);
-        } else if (uuid === SidePanelTreeCategory.PUBLIC_FAVORITES) {
-            dispatch(navigateToPublicFavorites);
-        } else if (uuid === SidePanelTreeCategory.SHARED_WITH_ME) {
-            dispatch(navigateToSharedWithMe);
-        } else if (uuid === SidePanelTreeCategory.WORKFLOWS) {
-            dispatch(navigateToWorkflows);
-        } else if (uuid === SidePanelTreeCategory.TRASH) {
-            dispatch(navigateToTrash);
-        } else if (uuid === GROUPS_PANEL_LABEL) {
-            dispatch(navigateToGroups);
+
+        switch (uuid) {
+            case SidePanelTreeCategory.FAVORITES:
+                dispatch<any>(navigateToFavorites);
+                return;
+            case SidePanelTreeCategory.PUBLIC_FAVORITES:
+                dispatch(navigateToPublicFavorites);
+                return;
+            case SidePanelTreeCategory.SHARED_WITH_ME:
+                dispatch(navigateToSharedWithMe);
+                return;
+            case SidePanelTreeCategory.WORKFLOWS:
+                dispatch(navigateToWorkflows);
+                return;
+            case SidePanelTreeCategory.TRASH:
+                dispatch(navigateToTrash);
+                return;
+            case GROUPS_PANEL_LABEL:
+                dispatch(navigateToGroups);
+                return;
+            case SidePanelTreeCategory.ALL_PROCESSES:
+                dispatch(navigateToAllProcesses);
+                return;
         }
     };
 
@@ -108,3 +126,5 @@ export const navigateToGroupDetails = compose(push, getGroupUrl);
 export const navigateToLinks = push(Routes.LINKS);
 
 export const navigateToCollectionsContentAddress = push(Routes.COLLECTIONS_CONTENT_ADDRESS);
+
+export const navigateToAllProcesses = push(Routes.ALL_PROCESSES);
index 9bdf205353c8a8a3260c9d4c6f7a48c55ffb4d31..1f18b85c521a4d12ceb3a684f66ec98b54fefa9a 100644 (file)
@@ -23,7 +23,8 @@ export enum SidePanelTreeCategory {
     PUBLIC_FAVORITES = 'Public Favorites',
     WORKFLOWS = 'Workflows',
     FAVORITES = 'Favorites',
-    TRASH = 'Trash'
+    TRASH = 'Trash',
+    ALL_PROCESSES = 'All Processes'
 }
 
 export const SIDE_PANEL_TREE = 'sidePanelTree';
@@ -44,6 +45,7 @@ export const getSidePanelTreeBranch = (uuid: string) => (treePicker: TreePicker)
 };
 
 const SIDE_PANEL_CATEGORIES = [
+    SidePanelTreeCategory.ALL_PROCESSES,
     SidePanelTreeCategory.PUBLIC_FAVORITES,
     SidePanelTreeCategory.WORKFLOWS,
     SidePanelTreeCategory.FAVORITES,
index f5ec5efc452b477e311de7b3a9b1fa0a2b13865a..6279aaea307e1e1d2783228672d73a919cb32cfb 100644 (file)
@@ -4,7 +4,7 @@
 
 import { Dispatch } from 'redux';
 import { isSidePanelTreeCategory, SidePanelTreeCategory } from '~/store/side-panel-tree/side-panel-tree-actions';
-import { navigateToFavorites, navigateTo, navigateToTrash, navigateToSharedWithMe, navigateToWorkflows, navigateToPublicFavorites } from '~/store/navigation/navigation-action';
+import { navigateToFavorites, navigateTo, navigateToTrash, navigateToSharedWithMe, navigateToWorkflows, navigateToPublicFavorites, navigateToAllProcesses } from '~/store/navigation/navigation-action';
 import {snackbarActions, SnackbarKind} from '~/store/snackbar/snackbar-actions';
 
 export const navigateFromSidePanel = (id: string) =>
@@ -28,6 +28,8 @@ const getSidePanelTreeCategoryAction = (id: string) => {
             return navigateToSharedWithMe;
         case SidePanelTreeCategory.WORKFLOWS:
             return navigateToWorkflows;
+        case SidePanelTreeCategory.ALL_PROCESSES:
+            return navigateToAllProcesses;
         default:
             return sidePanelTreeCategoryNotAvailable(id);
     }
index 26aee59af4ee792790ca17bb8a79295eb90d7211..d96a3c837cb1db51948448c7205a0810b7d4b379 100644 (file)
@@ -9,7 +9,7 @@ import { TreePicker, TreePickerProps } from "../tree-picker/tree-picker";
 import { TreeItem } from "~/components/tree/tree";
 import { ProjectResource } from "~/models/project";
 import { ListItemTextIcon } from "~/components/list-item-text-icon/list-item-text-icon";
-import { ProjectIcon, FavoriteIcon, ProjectsIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon } from '~/components/icon/icon';
+import { ProcessIcon, ProjectIcon, FavoriteIcon, ProjectsIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon } from '~/components/icon/icon';
 import { WorkflowIcon } from '~/components/icon/icon';
 import { activateSidePanelTreeItem, toggleSidePanelTreeItemCollapse, SIDE_PANEL_TREE, SidePanelTreeCategory } from '~/store/side-panel-tree/side-panel-tree-actions';
 import { openSidePanelContextMenu } from '~/store/context-menu/context-menu-actions';
@@ -75,6 +75,8 @@ const getSidePanelIcon = (category: string) => {
             return WorkflowIcon;
         case SidePanelTreeCategory.PUBLIC_FAVORITES:
             return PublicFavoriteIcon;
+        case SidePanelTreeCategory.ALL_PROCESSES:
+            return ProcessIcon;
         default:
             return ProjectIcon;
     }