From 1d6407bd7c7d0669c99b615c8ecc2be3a10b6ba9 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Tue, 7 Nov 2023 10:44:24 -0500 Subject: [PATCH] 19302: fixed tree indent and back nav icon bug Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- cypress/integration/side-panel.spec.js | 4 ++-- src/components/tree/tree.tsx | 29 ++++++++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js index d7e4c8a8..af2712e2 100644 --- a/cypress/integration/side-panel.spec.js +++ b/cypress/integration/side-panel.spec.js @@ -154,9 +154,9 @@ describe('Side panel tests', function() { 'shared-with-me': '/shared-with-me', 'public-favorites': '/public-favorites', 'my-favorites': '/favorites', - groups: '/groups', + 'groups': '/groups', 'all-processes': '/all_processes', - trash: '/trash', + 'trash': '/trash', 'home-projects': `/projects/${activeUser.user.uuid}`, } diff --git a/src/components/tree/tree.tsx b/src/components/tree/tree.tsx index d275cc0b..11a95402 100644 --- a/src/components/tree/tree.tsx +++ b/src/components/tree/tree.tsx @@ -5,7 +5,7 @@ import React, { useCallback, useState } from 'react'; import { List, ListItem, ListItemIcon, Checkbox, Radio, Collapse } from "@material-ui/core"; import { StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core/styles'; -import { CollectionIcon, DefaultIcon, DirectoryIcon, FileIcon, ProjectIcon, FilterGroupIcon, FreezeIcon } from 'components/icon/icon'; +import { CollectionIcon, DefaultIcon, DirectoryIcon, FileIcon, ProjectIcon, ProcessIcon, FilterGroupIcon, FreezeIcon } from 'components/icon/icon'; import { ReactElement } from "react"; import CircularProgress from '@material-ui/core/CircularProgress'; import classnames from "classnames"; @@ -28,7 +28,8 @@ type CssRules = 'list' | 'checkbox' | 'childItem' | 'childItemIcon' - | 'frozenIcon'; + | 'frozenIcon' + | 'indentSpacer'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ list: { @@ -91,6 +92,9 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ color: theme.palette.grey["600"], marginLeft: '10px', }, + indentSpacer: { + width: '0.25rem' + } }); export enum TreeItemStatus { @@ -184,7 +188,7 @@ const FLAT_TREE_ACTIONS = { toggleActive: 'TOGGLE_ACTIVE', }; -const ItemIcon = React.memo(({ type, kind, active, groupClass, classes }: any) => { +const ItemIcon = React.memo(({ type, kind, headKind, active, groupClass, classes }: any) => { let Icon = ProjectIcon; if (groupClass === GroupClass.FILTER) { @@ -205,10 +209,14 @@ const ItemIcon = React.memo(({ type, kind, active, groupClass, classes }: any) = } if (kind) { + if(kind === ResourceKind.LINK && headKind) kind = headKind; switch (kind) { case ResourceKind.COLLECTION: Icon = CollectionIcon; break; + case ResourceKind.CONTAINER_REQUEST: + Icon = ProcessIcon; + break; default: break; } @@ -247,11 +255,14 @@ const FlatTree = (props: FlatTreeProps) => .map((item: any) =>
- {!isInFavoritesTree(props.it) && - - {props.getProperArrowAnimation(item.status, item.items!)} - - } + {isInFavoritesTree(props.it) ? +
+ : + + + {props.getProperArrowAnimation(item.status, item.items!)} + + } {props.showSelection(item) && !props.useRadioButtons && color="primary" />}
- + {item.data.name} -- 2.30.2