From 45c6d03fa137758ca7b0663f6c6cd92dd733b67a Mon Sep 17 00:00:00 2001 From: Revanshu Paliwal Date: Tue, 13 Jun 2023 14:12:15 +0200 Subject: [PATCH] [NO JIRA] Fixing bugs and code smells --- server/sonar-web/src/main/js/apps/code/utils.ts | 4 ++-- .../src/main/js/components/issue/popups/CommentTile.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/code/utils.ts b/server/sonar-web/src/main/js/apps/code/utils.ts index c1363ecf84e..73a5f70b74e 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.ts +++ b/server/sonar-web/src/main/js/apps/code/utils.ts @@ -27,9 +27,9 @@ import { addComponent, addComponentBreadcrumbs, addComponentChildren, - getComponent as getComponentFromBucket, getComponentBreadcrumbs, getComponentChildren, + getComponent as getComponentFromBucket, } from './bucket'; const METRICS = [ @@ -287,7 +287,7 @@ export function loadMoreChildren( } export function mostCommonPrefix(strings: string[]) { - const sortedStrings = strings.slice(0).sort(); + const sortedStrings = strings.slice(0).sort((a, b) => a.localeCompare(b)); const firstString = sortedStrings[0]; const firstStringLength = firstString.length; const lastString = sortedStrings[sortedStrings.length - 1]; diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx b/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx index c280798cf42..e6823b0f6a4 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx @@ -59,7 +59,7 @@ export default class CommentTile extends React.PureComponent