From: Pawel Kowalczyk Date: Thu, 6 Sep 2018 06:36:25 +0000 (+0200) Subject: merge master + cr change X-Git-Tag: 1.3.0~113^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/b4a21064a6e4756b22c34f2e78bac99244fddff0 merge master + cr change Feature #14123 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- b4a21064a6e4756b22c34f2e78bac99244fddff0 diff --cc src/store/navigation/navigation-action.ts index 33181b37,ddb9d29f..0e87769e --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@@ -21,7 -20,7 +21,7 @@@ export const navigateTo = (uuid: string dispatch(navigateToCollection(uuid)); } else if (kind === ResourceKind.CONTAINER_REQUEST) { dispatch(navigateToProcess(uuid)); -- } ++ } if (uuid === SidePanelTreeCategory.FAVORITES) { dispatch(navigateToFavorites); } @@@ -37,11 -36,4 +37,11 @@@ export const navigateToCollection = com export const navigateToProcess = compose(push, getProcessUrl); -export const navigateToProcessLogs = compose(push, getProcessLogUrl); +export const navigateToProcessLogs = compose(push, getProcessLogUrl); + +export const navigateToRootProject = (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + const rootProjectUuid = services.authService.getUuid(); - if(rootProjectUuid){ ++ if (rootProjectUuid) { + dispatch(navigateToProject(rootProjectUuid)); + } +}; diff --cc src/views-components/main-app-bar/main-app-bar.tsx index 44be9f7a,ee47a010..04e0fb80 --- a/src/views-components/main-app-bar/main-app-bar.tsx +++ b/src/views-components/main-app-bar/main-app-bar.tsx @@@ -3,10 -3,7 +3,10 @@@ // SPDX-License-Identifier: AGPL-3.0 import * as React from "react"; - import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, Button, MenuItem } from "@material-ui/core"; + import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, Button, MenuItem, Tooltip } from "@material-ui/core"; +import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; +import { ArvadosTheme } from '~/common/custom-theme'; +import { Link } from "react-router-dom"; import { User, getUserFullname } from "~/models/user"; import { SearchBar } from "~/components/search-bar/search-bar"; import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu"; @@@ -47,49 -34,47 +47,50 @@@ export interface MainAppBarActionProps onDetailsPanelToggle: () => void; } -export type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps; +export type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles; -export const MainAppBar: React.SFC = (props) => { - return - - - - - Arvados 2 - - - {props.buildInfo} - - - - { - props.user && - } +export const MainAppBar = withStyles(styles)( + (props: MainAppBarProps) => { + return + + + + + + Arvados 2 + + + + {props.buildInfo} + + + + { + props.user && + } + + + { + props.user ? renderMenuForUser(props) : renderMenuForAnonymous(props) + } + - - { - props.user ? renderMenuForUser(props) : renderMenuForAnonymous(props) - } - - - - - {props.user && } - {props.user && - - - - - } - - ; -}; + + + {props.user && } + {props.user && - - - } ++ ++ ++ ++ } + + ; + } +); const renderMenuForUser = ({ user, menuItems, onMenuItemClick }: MainAppBarProps) => { return (