]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Fixing bugs and code smells
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Tue, 13 Jun 2023 12:12:15 +0000 (14:12 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 13 Jun 2023 20:03:37 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/code/utils.ts
server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx

index c1363ecf84ea5bf0317ecc72aebbf8a26d48118a..73a5f70b74e7646c4a8244a4465d71934d27a642 100644 (file)
@@ -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];
index c280798cf429a3a4b329a7d4db4edac82ade75f9..e6823b0f6a4bf35a75c36a71e9433748b1b3d993 100644 (file)
@@ -59,7 +59,7 @@ export default class CommentTile extends React.PureComponent<CommentTileProps, C
   render() {
     const { comment } = this.props;
     const { showEditArea } = this.state;
-    const author = comment.authorName || comment.author;
+    const author = comment.authorName ?? comment.author;
     const displayName =
       comment.authorActive === false && author
         ? translateWithParameters('user.x_deleted', author)