return (
<div className="global-container">
<div className="page-wrapper" id="container">
- <NavBar className="navbar-global" height={rawSizes.globalNavHeightRaw} />
+ <NavBar className="global-navbar" height={rawSizes.globalNavHeightRaw} />
{children !== undefined ? children : <Outlet />}
</div>
<GlobalFooter />
import classNames from 'classnames';
import * as React from 'react';
import ContextNavBar from '../../../../components/ui/ContextNavBar';
+import { translate } from '../../../../helpers/l10n';
import {
ProjectAlmBindingConfigurationErrors,
ProjectAlmBindingResponse,
<ContextNavBar
height={contextNavHeight}
id="context-navigation"
+ label={translate('qualifier', component.qualifier)}
notif={
<>
{bgTaskNotifComponent}
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-.navbar-global,
-.navbar-global .navbar-inner {
+.global-navbar,
+.global-navbar .global-navbar-inner {
background-color: var(--globalNavBarBg);
z-index: 421;
}
-.navbar-global .navbar-limited {
+.global-navbar .navbar-limited {
display: flex;
}
+.global-navbar {
+ position: fixed;
+ width: 100%;
+}
+
+.global-navbar .global-navbar-inner {
+ position: static;
+ display: flex;
+ max-width: var(--maxPageWidth);
+ min-width: var(--minPageWidth);
+ padding-left: var(--pagePadding);
+ padding-right: var(--pagePadding);
+ margin-left: auto;
+ margin-right: auto;
+}
+
.navbar-brand {
display: flex;
justify-content: center;
.global-navbar-menu {
display: flex;
align-items: center;
+ margin-left: auto;
height: var(--globalNavHeight);
}
margin-left: calc(5 * var(--gridSize));
}
-.global-navbar-menu-right .navbar-search {
- flex: 0 1 240px; /* Workaround for SONAR-10971 */
- min-width: 0;
-}
-
-.global-navbar-menu-right .navbar-search .search-box,
-.global-navbar-menu-right .navbar-search .search-box-input {
- min-width: 0;
- width: 100%;
-}
-
@media print {
- .navbar-global {
+ .global-navbar {
display: none !important;
}
}
*/
import * as React from 'react';
import EmbedDocsPopupHelper from '../../../../components/embed-docs-modal/EmbedDocsPopupHelper';
-import NavBar from '../../../../components/ui/NavBar';
import { CurrentUser } from '../../../../types/users';
-import { rawSizes } from '../../../theme';
+import { sizes } from '../../../theme';
import withCurrentUserContext from '../../current-user/withCurrentUserContext';
import Search from '../../search/Search';
import './GlobalNav.css';
export function GlobalNav(props: GlobalNavProps) {
const { currentUser, location } = props;
return (
- <NavBar className="navbar-global" height={rawSizes.globalNavHeightRaw} id="global-navigation">
- <GlobalNavBranding />
+ <div style={{ height: sizes.globalNavHeight }}>
+ <div className="navbar global-navbar" id="global-navigation">
+ <div className="global-navbar-inner">
+ <GlobalNavBranding />
- <GlobalNavMenu currentUser={currentUser} location={location} />
+ <GlobalNavMenu currentUser={currentUser} location={location} />
- <div className="global-navbar-menu global-navbar-menu-right">
- <EmbedDocsPopupHelper />
- <Search />
- <GlobalNavUser currentUser={currentUser} />
+ <div className="global-navbar-menu global-navbar-menu-right">
+ <EmbedDocsPopupHelper />
+ <Search />
+ <GlobalNavUser currentUser={currentUser} />
+ </div>
+ </div>
</div>
- </NavBar>
+ </div>
);
}
);
return (
- <ul className="global-navbar-menu">
- {this.renderProjects()}
- {governanceInstalled && this.renderPortfolios()}
- {this.renderIssuesLink()}
- {this.renderRulesLink()}
- {this.renderProfilesLink()}
- {this.renderQualityGatesLink()}
- {this.renderAdministrationLink()}
- {this.renderMore()}
- </ul>
+ <nav aria-label={translate('global')}>
+ <ul className="global-navbar-menu">
+ {this.renderProjects()}
+ {governanceInstalled && this.renderPortfolios()}
+ {this.renderIssuesLink()}
+ {this.renderRulesLink()}
+ {this.renderProfilesLink()}
+ {this.renderQualityGatesLink()}
+ {this.renderAdministrationLink()}
+ {this.renderMore()}
+ </ul>
+ </nav>
);
}
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: anonymous users 1`] = `
-<NavBar
- className="navbar-global"
- height={48}
- id="global-navigation"
->
- <withAppStateContext(GlobalNavBranding) />
- <withAppStateContext(GlobalNavMenu)
- currentUser={
- {
- "dismissedNotices": {},
- "isLoggedIn": false,
- }
- }
- location={
- {
- "pathname": "",
- }
+<div
+ style={
+ {
+ "height": "48px",
}
- />
+ }
+>
<div
- className="global-navbar-menu global-navbar-menu-right"
+ className="navbar global-navbar"
+ id="global-navigation"
>
- <EmbedDocsPopupHelper />
- <withRouter(Search) />
- <withRouter(GlobalNavUser)
- currentUser={
- {
- "dismissedNotices": {},
- "isLoggedIn": false,
+ <div
+ className="global-navbar-inner"
+ >
+ <withAppStateContext(GlobalNavBranding) />
+ <withAppStateContext(GlobalNavMenu)
+ currentUser={
+ {
+ "dismissedNotices": {},
+ "isLoggedIn": false,
+ }
+ }
+ location={
+ {
+ "pathname": "",
+ }
}
- }
- />
+ />
+ <div
+ className="global-navbar-menu global-navbar-menu-right"
+ >
+ <EmbedDocsPopupHelper />
+ <withRouter(Search) />
+ <withRouter(GlobalNavUser)
+ currentUser={
+ {
+ "dismissedNotices": {},
+ "isLoggedIn": false,
+ }
+ }
+ />
+ </div>
+ </div>
</div>
-</NavBar>
+</div>
`;
exports[`should render correctly: logged in users 1`] = `
-<NavBar
- className="navbar-global"
- height={48}
- id="global-navigation"
->
- <withAppStateContext(GlobalNavBranding) />
- <withAppStateContext(GlobalNavMenu)
- currentUser={
- {
- "isLoggedIn": true,
- }
- }
- location={
- {
- "pathname": "",
- }
+<div
+ style={
+ {
+ "height": "48px",
}
- />
+ }
+>
<div
- className="global-navbar-menu global-navbar-menu-right"
+ className="navbar global-navbar"
+ id="global-navigation"
>
- <EmbedDocsPopupHelper />
- <withRouter(Search) />
- <withRouter(GlobalNavUser)
- currentUser={
- {
- "isLoggedIn": true,
+ <div
+ className="global-navbar-inner"
+ >
+ <withAppStateContext(GlobalNavBranding) />
+ <withAppStateContext(GlobalNavMenu)
+ currentUser={
+ {
+ "isLoggedIn": true,
+ }
+ }
+ location={
+ {
+ "pathname": "",
+ }
}
- }
- />
+ />
+ <div
+ className="global-navbar-menu global-navbar-menu-right"
+ >
+ <EmbedDocsPopupHelper />
+ <withRouter(Search) />
+ <withRouter(GlobalNavUser)
+ currentUser={
+ {
+ "isLoggedIn": true,
+ }
+ }
+ />
+ </div>
+ </div>
</div>
-</NavBar>
+</div>
`;
<ContextNavBar
height={notifComponent ? contextNavHeight + ALERT_HEIGHT : contextNavHeight}
id="context-navigation"
+ label={translate('settings')}
notif={notifComponent}
>
<div className="navbar-context-header">
<ContextNavBar
height={72}
id="context-navigation"
+ label="settings"
>
<div
className="navbar-context-header"
<ContextNavBar
height={72}
id="context-navigation"
+ label="settings"
>
<div
className="navbar-context-header"
render() {
const search = (
- <div className="navbar-search dropdown">
+ <div role="search" className="navbar-search dropdown">
<DeferredSpinner className="navbar-search-icon" loading={this.state.loading} />
<SearchBox
<div className="layout-page" id="coding-rules-page">
<ScreenPositionHelper className="layout-page-side-outer">
{({ top }) => (
- <section
- aria-label={translate('filters')}
- className="layout-page-side"
- style={{ top }}
- >
+ <nav aria-label={translate('filters')} className="layout-page-side" style={{ top }}>
<div className="layout-page-side-inner">
<div className="layout-page-filters">
<A11ySkipTarget
/>
</div>
</div>
- </section>
+ </nav>
)}
</ScreenPositionHelper>
`;
exports[`should render correctly: loaded (ScreenPositionHelper) 1`] = `
-<section
+<nav
aria-label="filters"
className="layout-page-side"
style={
/>
</div>
</div>
-</section>
+</nav>
`;
exports[`should render correctly: loaded 1`] = `
return (
<ScreenPositionHelper className="layout-page-side-outer">
{({ top }) => (
- <section
+ <nav
aria-label={openIssue ? translate('list_of_issues') : translate('filters')}
className="layout-page-side"
style={{ top }}
{openIssue ? this.renderConciseIssuesList() : this.renderFacets()}
</div>
- </section>
+ </nav>
)}
</ScreenPositionHelper>
);
className?: string;
id?: string;
height: number;
+ label: string;
}
-export default function ContextNavBar({ className, ...other }: Props) {
- return <NavBar className={classNames('navbar-context', className)} {...other} />;
+export default function ContextNavBar({ className, label, ...other }: Props) {
+ return (
+ <NavBar aria-label={label} className={classNames('navbar-context', className)} {...other} />
+ );
}
select_tags=Add or remove tags
set=Set
set_up=Set Up
+settings=Settings
severity=Severity
shared=Shared
start_date=Start Date