created-admin-menu-and-extracted-virtual-machines-to-separated-components
[arvados.git] / src / views-components / main-content-bar / main-content-bar.tsx
index 2039f6b8568680579b9ac352277fa022d2819bf2..944f135ab7c083e03efac83ef5d532738c8efeb3 100644 (file)
@@ -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, matchRepositoriesRoute } from '~/routes/routes';
+import * as Routes from '~/routes/routes';
 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 interface MainContentBarProps {
@@ -16,20 +16,17 @@ 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 isRepositoriesPath = ({ router }: RootState) => {
-    const pathname = router.location ? router.location.pathname : '';
-    const match = matchRepositoriesRoute(pathname);
-    return !!match;
+    return !Routes.matchWorkflowRoute(pathname) && !Routes.matchUserVirtualMachineRoute(pathname) &&
+        !Routes.matchAdminVirtualMachineRoute(pathname) && !Routes.matchRepositoriesRoute(pathname) && 
+        !Routes.matchSshKeysRoute(pathname) && !Routes.matchKeepServicesRoute(pathname) && 
+        !Routes.matchComputeNodesRoute(pathname) && !Routes.matchApiClientAuthorizationsRoute(pathname) && 
+        !Routes.matchUsersRoute(pathname) && !Routes.matchMyAccountRoute(pathname);
 };
 
 export const MainContentBar = connect((state: RootState) => ({
-    buttonVisible: !isWorkflowPath(state) && !isRepositoriesPath(state)
+    buttonVisible: isButtonVisible(state)
 }), {
         onDetailsPanelToggle: toggleDetailsPanel
     })((props: MainContentBarProps) =>