From 2eaa007730cb441ed08c466be42b3a493014e925 Mon Sep 17 00:00:00 2001 From: Ambroise C Date: Mon, 24 Jul 2023 16:46:59 +0200 Subject: [PATCH] SONAR-19985 Reorder CrossComponentSourceViewer snippets in reading order --- .../main/js/apps/issues/crossComponentSourceViewer/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) { -- 2.39.5