summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-02-26 10:22:04 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-26 16:27:29 +0100
commit23827bba027ce552866c8df33bd7ae6603499fbe (patch)
tree38b4eba7f9c593540e9dafc0099b86a73e1a3ed3 /server/sonar-web/src
parent8941ce881187e55a1efe90cc5c497be95d110501 (diff)
downloadsonarqube-23827bba027ce552866c8df33bd7ae6603499fbe.tar.gz
sonarqube-23827bba027ce552866c8df33bd7ae6603499fbe.zip
SONAR-7333 display issue type in the issue box
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs6
-rw-r--r--server/sonar-web/src/main/js/components/issue/templates/issue.hbs7
-rw-r--r--server/sonar-web/src/main/js/helpers/handlebars/issueType.js31
3 files changed, 43 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs
index 746186eaf06..1f37beb04ed 100644
--- a/server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs
+++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs
@@ -4,6 +4,12 @@
<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}}
</a>
diff --git a/server/sonar-web/src/main/js/components/issue/templates/issue.hbs b/server/sonar-web/src/main/js/components/issue/templates/issue.hbs
index 33ca4c1f18e..e24a7960d3b 100644
--- a/server/sonar-web/src/main/js/components/issue/templates/issue.hbs
+++ b/server/sonar-web/src/main/js/components/issue/templates/issue.hbs
@@ -44,6 +44,10 @@
<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">
<span class="issue-meta-label">{{severityHelper severity}}</span>&nbsp;<i class="icon-dropdown"></i>
@@ -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
index 00000000000..9dfe9e4abcf
--- /dev/null
+++ b/server/sonar-web/src/main/js/helpers/handlebars/issueType.js
@@ -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>`
+ );
+};