]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10197
authorPascal Mugnier <pascal.mugnier@sonarsource.com>
Tue, 31 Jul 2018 09:51:24 +0000 (11:51 +0200)
committerSonarTech <sonartech@sonarsource.com>
Thu, 2 Aug 2018 18:21:32 +0000 (20:21 +0200)
server/sonar-web/src/main/js/helpers/issues.ts

index 3ea7c2386284ab7f1fdaf76cb42e00a94d732fa8..1842d50738a9db6bfdc551274fbc5e7adba92746 100644 (file)
@@ -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;
 }