]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15177 Fix no code info when showing source viewer
authorMathieu Suen <mathieu.suen@sonarsource.com>
Wed, 15 Sep 2021 08:30:18 +0000 (10:30 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 16 Sep 2021 20:03:30 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx

index fef599b7fee9c16d91ca15586762e1fe23534670..9c8518ea8c4dc5d1b33735496231b605dec2a5ce 100644 (file)
@@ -255,7 +255,7 @@ export class CodeApp extends React.PureComponent<Props, State> {
 
     const showSearch = searchResults !== undefined;
 
-    const hasNoFile = components.length === 0 && searchResults === undefined;
+    const hasComponents = components.length === 0 && searchResults === undefined;
 
     const shouldShowBreadcrumbs = breadcrumbs.length > 1 && !showSearch;
     const shouldShowComponentList =
@@ -280,7 +280,7 @@ export class CodeApp extends React.PureComponent<Props, State> {
         />
         <A11ySkipTarget anchor="code_main" />
 
-        {!hasNoFile && (
+        {!hasComponents && (
           <Search
             branchLike={branchLike}
             component={component}
@@ -290,7 +290,7 @@ export class CodeApp extends React.PureComponent<Props, State> {
         )}
 
         <div className="code-components">
-          {hasNoFile && (
+          {hasComponents && sourceViewer === undefined && (
             <div className="display-flex-center display-flex-column no-file">
               <span className="h1 text-muted">
                 {translate(