From 2d10f95a8da89ea498eab5a7fe5a38ed9af23849 Mon Sep 17 00:00:00 2001 From: Pascal Mugnier Date: Tue, 31 Jul 2018 11:51:24 +0200 Subject: [PATCH] SONAR-10197 --- server/sonar-web/src/main/js/helpers/issues.ts | 16 +++++++++------- 1 file 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; } -- 2.39.5