From c5471380870c76f5d714325c29cd0964a2fb324f Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 24 Apr 2017 10:36:38 +0200 Subject: SONAR-9067 Display multiple flows in the issues list (#1969) --- server/sonar-web/src/main/js/helpers/issues.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/sonar-web/src/main/js/helpers') diff --git a/server/sonar-web/src/main/js/helpers/issues.js b/server/sonar-web/src/main/js/helpers/issues.js index 804b410abf0..92603e52e17 100644 --- a/server/sonar-web/src/main/js/helpers/issues.js +++ b/server/sonar-web/src/main/js/helpers/issues.js @@ -108,6 +108,12 @@ const ensureTextRange = (issue: RawIssue) => { : {}; }; +const reverseLocations = (locations: Array<*>) => { + const x = [...locations]; + x.reverse(); + return x; +}; + const splitFlows = ( issue: RawIssue // $FlowFixMe textRange is not null @@ -121,7 +127,7 @@ const splitFlows = ( return onlySecondaryLocations ? { secondaryLocations: flatten(parsedFlows), flows: [] } - : { secondaryLocations: [], flows: parsedFlows }; + : { secondaryLocations: [], flows: parsedFlows.map(reverseLocations) }; }; export const parseIssueFromResponse = ( -- cgit v1.2.3