summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-31 17:38:44 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-04-01 17:53:08 +0200
commit916f45fe7fd70adc5e5d4d0d3b9a6d8eee330595 (patch)
treec3b173c345d60cb8ce246454e87765deb498f06f /server/sonar-web/src/main/js
parentefa02ff805c451c42821ce885469230d68fbe1e7 (diff)
downloadsonarqube-916f45fe7fd70adc5e5d4d0d3b9a6d8eee330595.tar.gz
sonarqube-916f45fe7fd70adc5e5d4d0d3b9a6d8eee330595.zip
fix rendering of component's extensions
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
index cdbb58d0a0b..fe7f6d4a53d 100644
--- a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
+++ b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
@@ -304,15 +304,27 @@ export default React.createClass({
},
renderTools() {
- const component = this.props.component;
- if (!component.isComparable && !_.size(component.extensions)) {
+ const extensions = this.props.component.extensions || [];
+ const withoutGovernance = extensions.filter(ext => ext.name !== 'Governance');
+ const tools = withoutGovernance.map(extension => {
+ return this.renderLink(extension.url, extension.name);
+ });
+
+ if (!tools.length) {
return null;
}
- const tools = [];
- (component.extensions || []).forEach(e => {
- tools.push(this.renderLink(e.url, e.name));
- });
- return tools;
+
+ return (
+ <li className="dropdown">
+ <a className="dropdown-toggle" data-toggle="dropdown" href="#">
+ {translate('sidebar.tools')}&nbsp;
+ <i className="icon-dropdown"/>
+ </a>
+ <ul className="dropdown-menu">
+ {tools}
+ </ul>
+ </li>
+ );
},
render() {