aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-07-19 16:56:38 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-07-21 16:14:07 +0200
commitdccf95202c171899a045fd414f256e7ca22dadc2 (patch)
tree227b88cd5532313dd9bc21b4b99de71909b58f65 /server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
parent04d40d224374526638084d837c6c30819463b511 (diff)
downloadsonarqube-dccf95202c171899a045fd414f256e7ca22dadc2.tar.gz
sonarqube-dccf95202c171899a045fd414f256e7ca22dadc2.zip
SONAR-9583 Use fixed width layout for navigation
Diffstat (limited to 'server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js')
-rw-r--r--server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js143
1 files changed, 73 insertions, 70 deletions
diff --git a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
index 370b2bc4dfb..e872e6e2ac1 100644
--- a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
+++ b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
@@ -20,8 +20,11 @@
// @flow
import React from 'react';
import { Link } from 'react-router';
+import classNames from 'classnames';
import { translate } from '../../../helpers/l10n';
-import OrganizationIcon from '../../../components/ui/OrganizationIcon';
+import ContextNavBar from '../../../components/nav/ContextNavBar';
+import NavBarTabs from '../../../components/nav/NavBarTabs';
+import OrganizationIcon from '../../../components/icons-components/OrganizationIcon';
import type { Organization } from '../../../store/organizations/duck';
const ADMIN_PATHS = [
@@ -43,8 +46,11 @@ export default class OrganizationNavigation extends React.PureComponent {
const { organization } = this.props;
return (
- <li className={adminActive ? 'active' : ''}>
- <a className="dropdown-toggle navbar-admin-link" data-toggle="dropdown" href="#">
+ <li className="dropdown">
+ <a
+ className={classNames('dropdown-toggle', 'is-admin', { active: adminActive })}
+ data-toggle="dropdown"
+ href="#">
{translate('layout.settings')}&nbsp;<i className="icon-dropdown" />
</a>
<ul className="dropdown-menu">
@@ -145,75 +151,72 @@ export default class OrganizationNavigation extends React.PureComponent {
const moreActive = !adminActive && location.pathname.includes('/extension/');
return (
- <nav className="navbar navbar-context page-container" id="context-navigation">
- <div className="navbar-context-inner">
- <div className="container">
- <h2 className="navbar-context-title">
- <span className="navbar-context-title-qualifier little-spacer-right">
- <OrganizationIcon />
- </span>
- <Link to={`/organizations/${organization.key}`} className="link-base-color">
- <strong>
- {organization.name}
- </strong>
- </Link>
- </h2>
-
- {organization.description != null &&
- <div className="navbar-context-description">
- <p className="text-limited text-top" title={organization.description}>
- {organization.description}
- </p>
- </div>}
-
- <div className="navbar-context-meta">
- {!!organization.avatar &&
- <img src={organization.avatar} height={30} alt={organization.name} />}
- {organization.url != null &&
- <div>
- <p className="text-limited text-top">
- <a
- className="link-underline"
- href={organization.url}
- title={organization.url}
- rel="nofollow">
- {organization.url}
- </a>
- </p>
- </div>}
- </div>
+ <ContextNavBar id="context-navigation" height={65}>
+ <div className="navbar-context-header">
+ <h1 className="display-inline-block">
+ <OrganizationIcon className="little-spacer-right" />
+ <Link
+ to={`/organizations/${organization.key}`}
+ className="link-base-color link-no-underline">
+ <strong>
+ {organization.name}
+ </strong>
+ </Link>
+ </h1>
+ {organization.description != null &&
+ <div className="navbar-context-description">
+ <p className="text-limited text-top" title={organization.description}>
+ {organization.description}
+ </p>
+ </div>}
+ </div>
- <ul className="nav navbar-nav nav-tabs">
- <li>
- <Link
- to={`/organizations/${organization.key}/projects`}
- className={isHomeActive ? 'active' : ''}>
- {translate('projects.page')}
- </Link>
- </li>
- <li>
- <Link to={`/organizations/${organization.key}/members`} activeClassName="active">
- {translate('organization.members.page')}
- </Link>
- </li>
- <li>
- <Link
- to={`/organizations/${organization.key}/quality_profiles`}
- activeClassName="active">
- {translate('quality_profiles.page')}
- </Link>
- </li>
- <li>
- <Link to={`/organizations/${organization.key}/rules`} activeClassName="active">
- {translate('coding_rules.page')}
- </Link>
- </li>
- {this.renderExtensions(moreActive)}
- {organization.canAdmin && this.renderAdministration(adminActive)}
- </ul>
- </div>
+ <div className="navbar-context-meta">
+ {!!organization.avatar &&
+ <img src={organization.avatar} height={30} alt={organization.name} />}
+ {organization.url != null &&
+ <div>
+ <p className="text-limited text-top">
+ <a
+ className="link-underline"
+ href={organization.url}
+ title={organization.url}
+ rel="nofollow">
+ {organization.url}
+ </a>
+ </p>
+ </div>}
</div>
- </nav>
+
+ <NavBarTabs>
+ <li>
+ <Link
+ to={`/organizations/${organization.key}/projects`}
+ className={isHomeActive ? 'active' : ''}>
+ {translate('projects.page')}
+ </Link>
+ </li>
+ <li>
+ <Link to={`/organizations/${organization.key}/members`} activeClassName="active">
+ {translate('organization.members.page')}
+ </Link>
+ </li>
+ <li>
+ <Link
+ to={`/organizations/${organization.key}/quality_profiles`}
+ activeClassName="active">
+ {translate('quality_profiles.page')}
+ </Link>
+ </li>
+ <li>
+ <Link to={`/organizations/${organization.key}/rules`} activeClassName="active">
+ {translate('coding_rules.page')}
+ </Link>
+ </li>
+ {this.renderExtensions(moreActive)}
+ {organization.canAdmin && this.renderAdministration(adminActive)}
+ </NavBarTabs>
+ </ContextNavBar>
);
}
}