X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b7de31f185fccd2f9b276c1e89754d288e7facfe..cda10815df30e3bceec728535f426754ef8ff2e8:/src/views-components/main-content-bar/main-content-bar.tsx?ds=sidebyside 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 6b84bde2..8c2e4ced 100644 --- a/src/views-components/main-content-bar/main-content-bar.tsx +++ b/src/views-components/main-content-bar/main-content-bar.tsx @@ -8,7 +8,7 @@ import { DetailsIcon } from "~/components/icon/icon"; import { Breadcrumbs } from "~/views-components/breadcrumbs/breadcrumbs"; import { connect } from 'react-redux'; import { RootState } from '~/store/store'; -import { matchWorkflowRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute } from '~/routes/routes'; +import * as Routes from '~/routes/routes'; import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action'; interface MainContentBarProps { @@ -16,32 +16,16 @@ interface MainContentBarProps { buttonVisible: boolean; } -const isWorkflowPath = ({ router }: RootState) => { +const isButtonVisible = ({ router }: RootState) => { const pathname = router.location ? router.location.pathname : ''; - const match = matchWorkflowRoute(pathname); - return !!match; -}; - -const isVirtualMachinePath = ({ router }: RootState) => { - const pathname = router.location ? router.location.pathname : ''; - const match = matchVirtualMachineRoute(pathname); - return !!match; -}; - -const isRepositoriesPath = ({ router }: RootState) => { - const pathname = router.location ? router.location.pathname : ''; - const match = matchRepositoriesRoute(pathname); - return !!match; -}; - -const isSshKeysPath = ({ router }: RootState) => { - const pathname = router.location ? router.location.pathname : ''; - const match = matchSshKeysRoute(pathname); - return !!match; + return !Routes.matchWorkflowRoute(pathname) && !Routes.matchVirtualMachineRoute(pathname) && + !Routes.matchRepositoriesRoute(pathname) && !Routes.matchSshKeysRoute(pathname) && + !Routes.matchKeepServicesRoute(pathname) && !Routes.matchComputeNodesRoute(pathname) && + !Routes.matchApiClientAuthorizationsRoute(pathname) && !Routes.matchUsersRoute(pathname); }; export const MainContentBar = connect((state: RootState) => ({ - buttonVisible: !isWorkflowPath(state) && !isSshKeysPath(state) && !isRepositoriesPath(state) && !isVirtualMachinePath(state) + buttonVisible: isButtonVisible(state) }), { onDetailsPanelToggle: toggleDetailsPanel })((props: MainContentBarProps) =>