]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Thu, 26 Oct 2017 14:35:55 +0000 (16:35 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 27 Oct 2017 06:46:10 +0000 (08:46 +0200)
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx
server/sonar-web/src/main/js/apps/system/components/App.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js
server/sonar-web/src/main/js/components/issue/Issue.js
server/sonar-web/src/main/js/helpers/dates.ts

index 732b7ea31709c16d023bbd07633a131d8d1f02db..5b906826ecc7fda2692dff3320fae3ddf0a63ff3 100644 (file)
@@ -44,7 +44,7 @@ export default class ComponentNavBgTaskNotif extends React.PureComponent<Props>
   renderMessage(messageKey: string) {
     const { component } = this.props;
     const canSeeBackgroundTasks =
-      component.configuration != undefined && component.configuration.showBackgroundTasks;
+      component.configuration !== undefined && component.configuration.showBackgroundTasks;
     const bgTaskUrl = getComponentBackgroundTaskUrl(component.key);
 
     if (canSeeBackgroundTasks) {
index c6d333563abc0215d9ac88e9ab83a9967b75ee5c..2211ed17dd570bbdddb0f846895fb8470c8d121a 100644 (file)
@@ -123,7 +123,7 @@ export default class App extends React.PureComponent<Props, State> {
           loading={loading}
           isCluster={isCluster(sysInfoData)}
           logLevel={getSystemLogsLevel(sysInfoData)}
-          showActions={sysInfoData != undefined}
+          showActions={sysInfoData !== undefined}
           onLogLevelChange={this.fetchSysInfo}
         />
         {this.renderSysInfo()}
index 2cfee3e3c05023ec08896f577ff84f3af0b29b1f..3b2b959336675dc2acf8d853ed0a3e8635c1fddc 100644 (file)
@@ -689,8 +689,6 @@ export default class SourceViewerBase extends React.PureComponent {
       'source-duplications-expanded': this.state.displayDuplications
     });
 
-    const displaySources = !notAccessible && !sourceRemoved;
-
     return (
       <div className={className} ref={node => (this.node = node)}>
         <SourceViewerHeader
@@ -703,7 +701,7 @@ export default class SourceViewerBase extends React.PureComponent {
             {translate('code_viewer.no_source_code_displayed_due_to_source_removed')}
           </div>
         )}
-        {displaySources && sources != null && this.renderCode(sources)}
+        {!sourceRemoved && sources != null && this.renderCode(sources)}
       </div>
     );
   }
index 6637f8e87dc6af9a84d3d720a7ba7149b33d27cd..11ff2e01a19c77340b2002ce91eb69f0ab795712 100644 (file)
@@ -111,6 +111,7 @@ export default class Issue extends React.PureComponent {
         this.props.onCheck(this.props.issue.key);
         return false;
       }
+      return undefined;
     });
   }
 
index 3bba40df67eb175896d1cc568544dc04f988c5ab..571e73b20aec87d76e25f59e8b6051147c779149 100644 (file)
@@ -41,7 +41,7 @@ export function parseDate(rawDate: ParsableDate): Date {
 
 export function toShortNotSoISOString(rawDate: ParsableDate): string {
   const date = parseDate(rawDate);
-  return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());
+  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
 }
 
 export function toNotSoISOString(rawDate: ParsableDate): string {