From: Ambroise C Date: Mon, 24 Jul 2023 14:46:59 +0000 (+0200) Subject: SONAR-19985 Reorder CrossComponentSourceViewer snippets in reading order X-Git-Tag: 10.2.0.77647~301 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2eaa007730cb441ed08c466be42b3a493014e925;p=sonarqube.git SONAR-19985 Reorder CrossComponentSourceViewer snippets in reading order --- diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts index 4b2eda9d13d..fe8b66271fb 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts @@ -135,9 +135,8 @@ export function createSnippets(params: { [] ); - // Sort snippets by line number in the case of secondary locations - // Preserve location order for flows! - return hasSecondaryLocations ? ranges.sort((a, b) => a.start - b.start) : ranges; + // Sort snippets by line number + return ranges.sort((a, b) => a.start - b.start); } export function linesForSnippets(snippets: Snippet[], componentLines: LineMap) {