aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueJsonWriter.java13
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json1
-rw-r--r--server/sonar-web/src/main/js/apps/issues/controller.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/models/issues.js1
-rw-r--r--server/sonar-web/src/main/js/components/issue/collections/issues.js1
-rw-r--r--server/sonar-web/src/main/js/components/issue/models/issue.js4
7 files changed, 8 insertions, 16 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueJsonWriter.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueJsonWriter.java
index 35399d67e0c..826c36abcc8 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueJsonWriter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueJsonWriter.java
@@ -47,11 +47,10 @@ public class IssueJsonWriter {
public static final String ACTIONS_EXTRA_FIELD = "actions";
public static final String TRANSITIONS_EXTRA_FIELD = "transitions";
- public static final String REPORTER_NAME_EXTRA_FIELD = "reporterName";
public static final String ACTION_PLAN_NAME_EXTRA_FIELD = "actionPlanName";
public static final Set<String> EXTRA_FIELDS = ImmutableSet.of(
- ACTIONS_EXTRA_FIELD, TRANSITIONS_EXTRA_FIELD, REPORTER_NAME_EXTRA_FIELD, ACTION_PLAN_NAME_EXTRA_FIELD);
+ ACTIONS_EXTRA_FIELD, TRANSITIONS_EXTRA_FIELD, ACTION_PLAN_NAME_EXTRA_FIELD);
private final I18n i18n;
private final Durations durations;
@@ -173,20 +172,10 @@ public class IssueJsonWriter {
actionsWriter.writeTransitions(issue, json);
}
- writeReporterIfNeeded(issue, usersByLogin, extraFields, json);
-
writeActionPlanIfNeeded(issue, actionPlanByKeys, extraFields, json);
}
}
- private void writeReporterIfNeeded(Issue issue, Map<String, User> usersByLogin, List<String> extraFields, JsonWriter json) {
- String reporter = issue.reporter();
- if (extraFields.contains(REPORTER_NAME_EXTRA_FIELD) && reporter != null) {
- User user = usersByLogin.get(reporter);
- json.prop(REPORTER_NAME_EXTRA_FIELD, user != null ? user.name() : null);
- }
- }
-
private void writeActionPlanIfNeeded(Issue issue, Map<String, ActionPlan> actionPlanByKeys, List<String> extraFields, JsonWriter json) {
String actionPlanKey = issue.actionPlanKey();
if (extraFields.contains(ACTION_PLAN_NAME_EXTRA_FIELD) && actionPlanKey != null) {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
index 6cbf0c9d633..bd6763106e2 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
@@ -273,7 +273,7 @@ public class SearchActionMediumTest {
userSessionRule.login("john");
WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam("extra_fields", "actions,transitions,reporterName,actionPlanName").execute();
+ .setParam("extra_fields", "actions,transitions,actionPlanName").execute();
result.assertJson(this.getClass(), "issue_with_extra_fields.json");
}
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json
index d63b6faa3bc..ecd938c0876 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json
+++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json
@@ -4,7 +4,6 @@
"key": "82fd47d4-b650-4037-80bc-7b112bd4eac2",
"assignee": "simon",
"reporter": "fabrice",
- "reporterName": "Fabrice",
"actionPlan": "AP-ABCD",
"actionPlanName": "1.0",
"actions": [
diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js
index 41fcd6433be..1ddcdb180bf 100644
--- a/server/sonar-web/src/main/js/apps/issues/controller.js
+++ b/server/sonar-web/src/main/js/apps/issues/controller.js
@@ -5,7 +5,7 @@ define([
], function (Controller, ComponentViewer, HomeView) {
var $ = jQuery,
- EXTRA_FIELDS = 'actions,transitions,reporterName,actionPlanName',
+ EXTRA_FIELDS = 'actions,transitions,actionPlanName',
FACET_DATA_FIELDS = ['components', 'projects', 'users', 'rules', 'actionPlans', 'languages'];
return Controller.extend({
diff --git a/server/sonar-web/src/main/js/apps/issues/models/issues.js b/server/sonar-web/src/main/js/apps/issues/models/issues.js
index 66be85a7464..06abb122653 100644
--- a/server/sonar-web/src/main/js/apps/issues/models/issues.js
+++ b/server/sonar-web/src/main/js/apps/issues/models/issues.js
@@ -63,6 +63,7 @@ define([
});
}
issue = that._injectRelational(issue, r.users, 'assignee', 'login');
+ issue = that._injectRelational(issue, r.users, 'reporter', 'login');
return issue;
});
},
diff --git a/server/sonar-web/src/main/js/components/issue/collections/issues.js b/server/sonar-web/src/main/js/components/issue/collections/issues.js
index f749dc448a7..13c8a616dd1 100644
--- a/server/sonar-web/src/main/js/components/issue/collections/issues.js
+++ b/server/sonar-web/src/main/js/components/issue/collections/issues.js
@@ -60,6 +60,7 @@ define([
_.extend(issue, { ruleName: rule.name });
}
issue = that._injectRelational(issue, r.users, 'assignee', 'login');
+ issue = that._injectRelational(issue, r.users, 'reporter', 'login');
return issue;
});
}
diff --git a/server/sonar-web/src/main/js/components/issue/models/issue.js b/server/sonar-web/src/main/js/components/issue/models/issue.js
index cdc821785c8..79ad16f7fde 100644
--- a/server/sonar-web/src/main/js/components/issue/models/issue.js
+++ b/server/sonar-web/src/main/js/components/issue/models/issue.js
@@ -13,7 +13,9 @@ define(function () {
parse: function (r) {
if (r.issue) {
- return this._injectRelational(r.issue, r.users, 'assignee', 'login');
+ var issue = this._injectRelational(r.issue, r.users, 'assignee', 'login');
+ issue = this._injectRelational(issue, r.users, 'reporter', 'login');
+ return issue;
} else {
return r;
}