// Add handlers for navigation actions
locationChangeHandlers: LocationChangeMatcher[];
+
+ appBarLeft?: React.ReactElement;
+
+ appBarMiddle?: React.ReactElement;
+
+ appBarRight?: React.ReactElement;
}
sidePanelCategories: [],
dialogs: [],
navigateToHandlers: [],
- locationChangeHandlers: []
+ locationChangeHandlers: [],
+ appBarLeft: undefined,
+ appBarMiddle: undefined,
+ appBarRight: undefined,
};
// Starting here, import and register your Workbench 2 plugins. //
-// import { register as blankUIPluginRegister } from '~/plugins/blank/index';
+import { register as blankUIPluginRegister } from '~/plugins/blank/index';
import { register as examplePluginRegister, routePath as exampleRoutePath } from '~/plugins/example/index';
import { register as rootRedirectRegister } from '~/plugins/root-redirect/index';
// Example plugin.
import { PluginConfig } from '~/common/plugintypes';
+import * as React from 'react';
export const register = (pluginConfig: PluginConfig) => {
pluginConfig.centerPanelList.push((elms) => []);
pluginConfig.sidePanelCategories.push((cats: string[]): string[] => []);
+
+ pluginConfig.appBarLeft = <span />;
+ pluginConfig.appBarMiddle = <span />;
+ pluginConfig.appBarRight = <span />;
};
import { HelpMenu } from '~/views-components/main-app-bar/help-menu';
import { ReactNode } from "react";
import { AdminMenu } from "~/views-components/main-app-bar/admin-menu";
+import { pluginConfig } from '~/plugins';
type CssRules = 'toolbar' | 'link';
return <AppBar position="absolute">
<Toolbar className={props.classes.toolbar}>
<Grid container justify="space-between">
- <Grid container item xs={3} direction="column" justify="center">
+ {pluginConfig.appBarLeft || <Grid container item xs={3} direction="column" justify="center">
<Typography variant='h6' color="inherit" noWrap>
<Link to={Routes.ROOT} className={props.classes.link}>
<span dangerouslySetInnerHTML={{ __html: props.siteBanner }} /> ({props.uuidPrefix})
</Link>
</Typography>
<Typography variant="caption" color="inherit">{props.buildInfo}</Typography>
- </Grid>
+ </Grid>}
<Grid
item
xs={6}
container
alignItems="center">
- {props.user && props.user.isActive && <SearchBar />}
+ {pluginConfig.appBarMiddle || (props.user && props.user.isActive && <SearchBar />)}
</Grid>
<Grid
item
alignItems="center"
justify="flex-end"
wrap="nowrap">
- {props.user
- ? <>
+ {pluginConfig.appBarRight ||
+ (props.user ? <>
<NotificationsMenu />
<AccountMenu />
{props.user.isAdmin && <AdminMenu />}
<HelpMenu />
- </>
- : <HelpMenu />}
+ </> :
+ <HelpMenu />)}
</Grid>
</Grid>
</Toolbar>
const isButtonVisible = ({ router }: RootState) => {
const pathname = router.location ? router.location.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);
+ return Routes.matchCollectionsContentAddressRoute(pathname) ||
+ Routes.matchPublicFavoritesRoute(pathname) ||
+ Routes.matchGroupDetailsRoute(pathname) ||
+ Routes.matchGroupsRoute(pathname) ||
+ Routes.matchUsersRoute(pathname) ||
+ Routes.matchSearchResultsRoute(pathname) ||
+ Routes.matchSharedWithMeRoute(pathname) ||
+ Routes.matchProcessRoute(pathname) ||
+ Routes.matchCollectionRoute(pathname) ||
+ Routes.matchProjectRoute(pathname) ||
+ 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 =