aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorPascal Mugnier <pascal.mugnier@sonarsource.com>2018-07-31 11:51:24 +0200
committerSonarTech <sonartech@sonarsource.com>2018-08-02 20:21:32 +0200
commit2d10f95a8da89ea498eab5a7fe5a38ed9af23849 (patch)
tree5ab5826e765d9a845b06e70db65ae918b7bcdbd8 /server/sonar-web/src/main
parente702bfa974c045b9a4f5085c06017cd9fcfc3b9a (diff)
downloadsonarqube-2d10f95a8da89ea498eab5a7fe5a38ed9af23849.tar.gz
sonarqube-2d10f95a8da89ea498eab5a7fe5a38ed9af23849.zip
SONAR-10197
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/js/helpers/issues.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/helpers/issues.ts b/server/sonar-web/src/main/js/helpers/issues.ts
index 3ea7c238628..1842d50738a 100644
--- a/server/sonar-web/src/main/js/helpers/issues.ts
+++ b/server/sonar-web/src/main/js/helpers/issues.ts
@@ -98,10 +98,14 @@ function injectCommentsRelational(issue: RawIssue, users?: User[]) {
return { comments };
}
-function prepareClosed(issue: RawIssue) {
+function prepareClosed(
+ issue: RawIssue,
+ secondaryLocations: FlowLocation[],
+ flows: FlowLocation[][]
+) {
return issue.status === 'CLOSED'
- ? { flows: undefined, line: undefined, textRange: undefined }
- : {};
+ ? { flows: [], line: undefined, textRange: undefined, secondaryLocations: [] }
+ : { flows, secondaryLocations };
}
function ensureTextRange(issue: RawIssue): { textRange?: TextRange } {
@@ -167,9 +171,7 @@ export function parseIssueFromResponse(
...injectRelational(issue, rules, 'rule', 'key'),
...injectRelational(issue, users, 'assignee', 'login'),
...injectCommentsRelational(issue, users),
- ...prepareClosed(issue),
- ...ensureTextRange(issue),
- secondaryLocations,
- flows
+ ...prepareClosed(issue, secondaryLocations, flows),
+ ...ensureTextRange(issue)
} as Issue;
}