From: Lucas Di Pentima Date: Mon, 30 Dec 2019 20:22:27 +0000 (-0300) Subject: 15012: Adds 'All Processes' item to left panel tree. X-Git-Tag: 2.0.0~9^2~13 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/9cdcf53b97efc80d6c7de7e0d4da7edf91f15c31 15012: Adds 'All Processes' item to left panel tree. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/routes/routes.ts b/src/routes/routes.ts index bb518d3f..ced460e7 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -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) => { diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts index 5ece1aba..fda6ec71 100644 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@ -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(pushOrGoto(getNavUrl(uuid, getState().auth))); - } else if (kind === ResourceKind.VIRTUAL_MACHINE) { - dispatch(navigateToAdminVirtualMachines); + + switch (kind) { + case ResourceKind.PROJECT: + case ResourceKind.USER: + case ResourceKind.COLLECTION: + case ResourceKind.CONTAINER_REQUEST: + dispatch(pushOrGoto(getNavUrl(uuid, getState().auth))); + return; + case ResourceKind.VIRTUAL_MACHINE: + dispatch(navigateToAdminVirtualMachines); + return; } - if (uuid === SidePanelTreeCategory.FAVORITES) { - dispatch(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(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); diff --git a/src/store/side-panel-tree/side-panel-tree-actions.ts b/src/store/side-panel-tree/side-panel-tree-actions.ts index 9bdf2053..1f18b85c 100644 --- a/src/store/side-panel-tree/side-panel-tree-actions.ts +++ b/src/store/side-panel-tree/side-panel-tree-actions.ts @@ -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, diff --git a/src/store/side-panel/side-panel-action.ts b/src/store/side-panel/side-panel-action.ts index f5ec5efc..6279aaea 100644 --- a/src/store/side-panel/side-panel-action.ts +++ b/src/store/side-panel/side-panel-action.ts @@ -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); } diff --git a/src/views-components/side-panel-tree/side-panel-tree.tsx b/src/views-components/side-panel-tree/side-panel-tree.tsx index 26aee59a..d96a3c83 100644 --- a/src/views-components/side-panel-tree/side-panel-tree.tsx +++ b/src/views-components/side-panel-tree/side-panel-tree.tsx @@ -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; }