]> source.dussan.org Git - sonarqube.git/commitdiff
LICENSE-75 display support page in administration
authorStas Vilchik <stas.vilchik@sonarsource.com>
Thu, 19 Oct 2017 09:34:05 +0000 (11:34 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 20 Oct 2017 12:23:26 +0000 (14:23 +0200)
server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 6f2c84d6e6e1a81694837b68054b38cd220f1bc3..69cbec3e6ddcec1bfcb990820d0c2bce1bf6d19a 100644 (file)
@@ -70,14 +70,21 @@ class SettingsNav extends React.PureComponent {
     const isSecurity = this.isSecurityActive();
     const isProjects = this.isProjectsActive();
     const isSystem = this.isSystemActive();
+    const isSupport = this.isSomethingActive(['/admin/extension/license/support']);
 
     const securityClassName = classNames('dropdown-toggle', { active: isSecurity });
     const projectsClassName = classNames('dropdown-toggle', { active: isProjects });
     const systemClassName = classNames('dropdown-toggle', { active: isSystem });
     const configurationClassNames = classNames('dropdown-toggle', {
-      active: !isSecurity && !isProjects && !isSystem
+      active: !isSecurity && !isProjects && !isSystem && !isSupport
     });
 
+    const extensionsWithoutSupport = this.props.extensions.filter(
+      extension => extension.key !== 'license/support'
+    );
+
+    const hasSupportExtension = extensionsWithoutSupport.length < this.props.extensions.length;
+
     return (
       <ContextNavBar id="context-navigation" height={65}>
         <h1 className="navbar-context-header">
@@ -109,7 +116,7 @@ class SettingsNav extends React.PureComponent {
                   {translate('custom_metrics.page')}
                 </IndexLink>
               </li>
-              {this.props.extensions.map(this.renderExtension)}
+              {extensionsWithoutSupport.map(this.renderExtension)}
             </ul>
           </li>
 
@@ -184,6 +191,14 @@ class SettingsNav extends React.PureComponent {
               </li>
             </ul>
           </li>
+
+          {hasSupportExtension && (
+            <li>
+              <IndexLink to="/admin/extension/license/support" activeClassName="active">
+                {translate('support')}
+              </IndexLink>
+            </li>
+          )}
         </NavBarTabs>
       </ContextNavBar>
     );
index 06b017e85f6da7c61606eb0b6ebb8be9a038fa00..6d02a1caaf8ec3e3b42fa32281c4da0682888f22 100644 (file)
@@ -147,6 +147,7 @@ x_selected={0} selected
 x_of_y_shown={0} of {1} shown
 size=Size
 status=Status
+support=Support
 table=Table
 tags=Tags
 technical_debt=Technical Debt