From 89e8da171ea22dd75b6ac1e83b1354983ed209e6 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Thu, 26 Oct 2017 16:35:55 +0200 Subject: Fix quality flaws --- .../main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx | 2 +- server/sonar-web/src/main/js/apps/system/components/App.tsx | 2 +- .../sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js | 4 +--- server/sonar-web/src/main/js/components/issue/Issue.js | 1 + server/sonar-web/src/main/js/helpers/dates.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) (limited to 'server/sonar-web/src') diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx index 732b7ea3170..5b906826ecc 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx @@ -44,7 +44,7 @@ export default class ComponentNavBgTaskNotif extends React.PureComponent 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) { diff --git a/server/sonar-web/src/main/js/apps/system/components/App.tsx b/server/sonar-web/src/main/js/apps/system/components/App.tsx index c6d333563ab..2211ed17dd5 100644 --- a/server/sonar-web/src/main/js/apps/system/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/App.tsx @@ -123,7 +123,7 @@ export default class App extends React.PureComponent { loading={loading} isCluster={isCluster(sysInfoData)} logLevel={getSystemLogsLevel(sysInfoData)} - showActions={sysInfoData != undefined} + showActions={sysInfoData !== undefined} onLogLevelChange={this.fetchSysInfo} /> {this.renderSysInfo()} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js index 2cfee3e3c05..3b2b9593366 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js @@ -689,8 +689,6 @@ export default class SourceViewerBase extends React.PureComponent { 'source-duplications-expanded': this.state.displayDuplications }); - const displaySources = !notAccessible && !sourceRemoved; - return (
(this.node = node)}> )} - {displaySources && sources != null && this.renderCode(sources)} + {!sourceRemoved && sources != null && this.renderCode(sources)}
); } diff --git a/server/sonar-web/src/main/js/components/issue/Issue.js b/server/sonar-web/src/main/js/components/issue/Issue.js index 6637f8e87dc..11ff2e01a19 100644 --- a/server/sonar-web/src/main/js/components/issue/Issue.js +++ b/server/sonar-web/src/main/js/components/issue/Issue.js @@ -111,6 +111,7 @@ export default class Issue extends React.PureComponent { this.props.onCheck(this.props.issue.key); return false; } + return undefined; }); } diff --git a/server/sonar-web/src/main/js/helpers/dates.ts b/server/sonar-web/src/main/js/helpers/dates.ts index 3bba40df67e..571e73b20ae 100644 --- a/server/sonar-web/src/main/js/helpers/dates.ts +++ b/server/sonar-web/src/main/js/helpers/dates.ts @@ -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 { -- cgit v1.2.3