From 916f45fe7fd70adc5e5d4d0d3b9a6d8eee330595 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 31 Mar 2016 17:38:44 +0200 Subject: [PATCH] fix rendering of component's extensions --- .../main/nav/component/component-nav-menu.js | 26 ++++++++++++++----- 1 file 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 ( +
  • + + {translate('sidebar.tools')}  + + +
      + {tools} +
    +
  • + ); }, render() { -- 2.39.5