]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7333 display issue type in the issue box 794/head
authorStas Vilchik <vilchiks@gmail.com>
Fri, 26 Feb 2016 09:22:04 +0000 (10:22 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 26 Feb 2016 15:27:29 +0000 (16:27 +0100)
server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs
server/sonar-web/src/main/js/components/issue/templates/issue.hbs
server/sonar-web/src/main/js/helpers/handlebars/issueType.js [new file with mode: 0644]

index 746186eaf0657ee830671e4cf569114df5182a41..1f37beb04ed065f5e6bbedc06f969b163f72ad34 100644 (file)
@@ -3,6 +3,12 @@
 </header>
 
 <ul class="menu">
+  <li>
+    <a href="#" data-property="types" data-value="{{this.type}}">
+      {{issueType this.type}}
+    </a>
+  </li>
+
   <li>
     <a href="#" data-property="severities" data-value="{{s}}">
       {{severityIcon severity}}&nbsp;{{t "severity" severity}}
index 33ca4c1f18e854e5f3c0989ed12d1986572b0c45..e24a7960d3b589c98d2c8776787ff70cb4366806 100644 (file)
     <tr>
       <td>
         <ul class="list-inline issue-meta-list">
+          <li class="issue-meta">
+            {{issueType this.type}}
+          </li>
+
           <li class="issue-meta">
             {{#inArray actions "set_severity"}}
               <button class="button-link issue-action issue-action-with-options js-issue-set-severity">
@@ -72,7 +76,8 @@
                     <span class="text-top">{{avatarHelper assigneeEmail 16}}</span>
                   {{/ifShowAvatars}}
                 {{/if}}
-                <span class="issue-meta-label">{{#if assignee}}{{assigneeName}}{{else}}{{t 'unassigned'}}{{/if}}</span>&nbsp;<i class="icon-dropdown"></i>
+                <span class="issue-meta-label">{{#if assignee}}{{assigneeName}}{{else}}{{t 'unassigned'}}{{/if}}</span>&nbsp;<i
+                  class="icon-dropdown"></i>
               </button>
             {{else}}
               {{#if assignee}}
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueType.js b/server/sonar-web/src/main/js/helpers/handlebars/issueType.js
new file mode 100644 (file)
index 0000000..9dfe9e4
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * SonarQube
+ * 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 Handlebars from 'handlebars/runtime';
+
+import { translate } from '../../helpers/l10n';
+
+module.exports = function (issueType) {
+  const isCodeSmell = issueType === 'CODE_SMELL';
+  const className = 'badge ' + (isCodeSmell ? 'badge-warning' : 'badge-danger');
+
+  return new Handlebars.default.SafeString(
+      `<span class="${className}">${translate('issue.type', issueType)}</span>`
+  );
+};