]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7149 do not display measures when searching
authorStas Vilchik <vilchiks@gmail.com>
Thu, 7 Jan 2016 11:13:42 +0000 (12:13 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 7 Jan 2016 13:15:57 +0000 (14:15 +0100)
server/sonar-web/src/main/js/apps/code/components/Components.js
server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.js [new file with mode: 0644]

index e86d1bf4b8b78313d022e2f62ca4a74982c76f7b..4752e06b7496974ec834e6000aad0e3801da0c72 100644 (file)
@@ -21,22 +21,13 @@ import React from 'react';
 
 import Component from './Component';
 import ComponentsEmpty from './ComponentsEmpty';
+import ComponentsHeader from './ComponentsHeader';
 import { translate } from '../../../helpers/l10n';
 
 
 const Components = ({ baseComponent, components, coverageMetric, onBrowse }) => (
     <table className="data zebra">
-      <thead>
-        <tr>
-          <th className="thin nowrap">&nbsp;</th>
-          <th>&nbsp;</th>
-          <th className="thin nowrap text-right">{translate('metric.ncloc.name')}</th>
-          <th className="thin nowrap text-right">{translate('metric.sqale_index.short_name')}</th>
-          <th className="thin nowrap text-right">{translate('metric.violations.name')}</th>
-          <th className="thin nowrap text-right">{translate('metric.coverage.name')}</th>
-          <th className="thin nowrap text-right">{translate('metric.duplicated_lines_density.short_name')}</th>
-        </tr>
-      </thead>
+      <ComponentsHeader baseComponent={baseComponent}/>
       {baseComponent && (
           <tbody>
             <Component
diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.js b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.js
new file mode 100644 (file)
index 0000000..0ccf05e
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * SonarQube :: Web
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+import React from 'react';
+
+import { translate } from '../../../helpers/l10n';
+
+
+const ComponentsHeader = ({ baseComponent }) => (
+    <thead>
+      <tr>
+        <th className="thin nowrap">&nbsp;</th>
+        <th>&nbsp;</th>
+        <th className="thin nowrap text-right">
+          {baseComponent && translate('metric.ncloc.name')}
+        </th>
+        <th className="thin nowrap text-right">
+          {baseComponent && translate('metric.sqale_index.short_name')}
+        </th>
+        <th className="thin nowrap text-right">
+          {baseComponent && translate('metric.violations.name')
+          }</th>
+        <th className="thin nowrap text-right">
+          {baseComponent && translate('metric.coverage.name')}
+        </th>
+        <th className="thin nowrap text-right">
+          {baseComponent && translate('metric.duplicated_lines_density.short_name')}
+        </th>
+      </tr>
+    </thead>
+);
+
+
+export default ComponentsHeader;