X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/bdb36daa28e58f24975c58b54eaecaa593c8ad95..578c6026645cda9432f3386f29521075b8526609:/src/views-components/main-content-bar/main-content-bar.tsx diff --git a/src/views-components/main-content-bar/main-content-bar.tsx b/src/views-components/main-content-bar/main-content-bar.tsx index fe1034f6..3f4de301 100644 --- a/src/views-components/main-content-bar/main-content-bar.tsx +++ b/src/views-components/main-content-bar/main-content-bar.tsx @@ -12,12 +12,18 @@ import { RootState } from 'store/store'; import * as Routes from 'routes/routes'; import { toggleDetailsPanel } from 'store/details-panel/details-panel-action'; import RefreshButton from "components/refresh-button/refresh-button"; -import { reloadProjectMatchingUuid } from "store/workbench/workbench-actions"; import { loadSidePanelTreeProjects } from "store/side-panel-tree/side-panel-tree-actions"; +import { Dispatch } from "redux"; -type CssRules = "infoTooltip"; +type CssRules = 'mainBar' | 'breadcrumbContainer' | 'infoTooltip'; const styles: StyleRulesCallback = theme => ({ + mainBar: { + flexWrap: 'nowrap', + }, + breadcrumbContainer: { + overflow: 'hidden', + }, infoTooltip: { marginTop: '-10px', marginLeft: '10px', @@ -45,46 +51,40 @@ const isButtonVisible = ({ router }: RootState) => { Routes.matchAllProcessesRoute(pathname) || Routes.matchTrashRoute(pathname) || Routes.matchFavoritesRoute(pathname); - - /* return !Routes.matchWorkflowRoute(pathname) && !Routes.matchUserVirtualMachineRoute(pathname) && - * !Routes.matchAdminVirtualMachineRoute(pathname) && !Routes.matchRepositoriesRoute(pathname) && - * !Routes.matchSshKeysAdminRoute(pathname) && !Routes.matchSshKeysUserRoute(pathname) && - * !Routes.matchSiteManagerRoute(pathname) && - * !Routes.matchKeepServicesRoute(pathname) && !Routes.matchComputeNodesRoute(pathname) && - * !Routes.matchApiClientAuthorizationsRoute(pathname) && !Routes.matchUsersRoute(pathname) && - * !Routes.matchMyAccountRoute(pathname) && !Routes.matchLinksRoute(pathname); */ }; -export const MainContentBar = - connect((state: RootState) => ({ - buttonVisible: isButtonVisible(state), - projectUuid: state.detailsPanel.resourceUuid, - }), (dispatch) => ({ - onDetailsPanelToggle: () => dispatch(toggleDetailsPanel()), - onRefreshButtonClick: (id) => { - dispatch(loadSidePanelTreeProjects(id)); - } - }))( - withStyles(styles)( - (props: MainContentBarProps & WithStyles & any) => - - - - - - - { - props.onRefreshButtonClick(props.projectUuid); - }} /> - - - {props.buttonVisible && - - - - } - - - - ) - ); +const mapStateToProps = (state: RootState) => ({ + buttonVisible: isButtonVisible(state), + projectUuid: state.detailsPanel.resourceUuid, +}); + +const mapDispatchToProps = () => (dispatch: Dispatch) => ({ + onDetailsPanelToggle: () => dispatch(toggleDetailsPanel()), + onRefreshButtonClick: (id) => { + dispatch(loadSidePanelTreeProjects(id)); + } +}); + +export const MainContentBar = connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)( + (props: MainContentBarProps & WithStyles & any) => + + + + + + { + props.onRefreshButtonClick(props.projectUuid); + }} /> + + + {props.buttonVisible && + + + + } + + +));