aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-22 17:11:21 +0100
committerGitHub <noreply@github.com>2016-12-22 17:11:21 +0100
commitbc07b29494abd5dff7875175df91df38d0b908ac (patch)
tree05f82f8ca3787011e2a0810e7d85c9d81e4b222f /server/sonar-web/src/main/js/app
parente52ca10a4a1b07d05c894e0d8564ffa1b5af3e47 (diff)
downloadsonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.tar.gz
sonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.zip
upgrade eslint and its plugins, tune rules (#1481)
Diffstat (limited to 'server/sonar-web/src/main/js/app')
-rw-r--r--server/sonar-web/src/main/js/app/components/App.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/LocalizationContainer.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/MarkdownHelp.js4
-rw-r--r--server/sonar-web/src/main/js/app/components/SimpleContainer.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js8
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBreadcrumbs-test.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/SearchView.js14
-rw-r--r--server/sonar-web/src/main/js/app/utils/startAjaxMonitoring.js6
10 files changed, 22 insertions, 22 deletions
diff --git a/server/sonar-web/src/main/js/app/components/App.js b/server/sonar-web/src/main/js/app/components/App.js
index 6ddad08119e..359d26a0acf 100644
--- a/server/sonar-web/src/main/js/app/components/App.js
+++ b/server/sonar-web/src/main/js/app/components/App.js
@@ -25,7 +25,7 @@ import { fetchCurrentUser } from '../../store/users/actions';
import { fetchLanguages, fetchAppState } from '../../store/rootActions';
class App extends React.Component {
- mounted: bool;
+ mounted: boolean;
static propTypes = {
fetchAppState: React.PropTypes.func.isRequired,
diff --git a/server/sonar-web/src/main/js/app/components/LocalizationContainer.js b/server/sonar-web/src/main/js/app/components/LocalizationContainer.js
index 1241ac8f20c..1a542bb88ad 100644
--- a/server/sonar-web/src/main/js/app/components/LocalizationContainer.js
+++ b/server/sonar-web/src/main/js/app/components/LocalizationContainer.js
@@ -22,7 +22,7 @@ import React from 'react';
import { requestMessages } from '../../helpers/l10n';
export default class LocalizationContainer extends React.Component {
- mounted: bool;
+ mounted: boolean;
state = {
loading: true
diff --git a/server/sonar-web/src/main/js/app/components/MarkdownHelp.js b/server/sonar-web/src/main/js/app/components/MarkdownHelp.js
index 835b8e0cd72..92c6b3a0894 100644
--- a/server/sonar-web/src/main/js/app/components/MarkdownHelp.js
+++ b/server/sonar-web/src/main/js/app/components/MarkdownHelp.js
@@ -114,8 +114,8 @@ export default class MarkdownHelp extends React.Component {
<tr>
<td className="text-top">
Standard text<br/>
- > Blockquoted text<br/>
- > that spans multiple lines<br/>
+ &gt; Blockquoted text<br/>
+ &gt; that spans multiple lines<br/>
</td>
<td className="markdown text-top">
<p>Standard text</p>
diff --git a/server/sonar-web/src/main/js/app/components/SimpleContainer.js b/server/sonar-web/src/main/js/app/components/SimpleContainer.js
index 342bffa2bc3..31ad5252ae4 100644
--- a/server/sonar-web/src/main/js/app/components/SimpleContainer.js
+++ b/server/sonar-web/src/main/js/app/components/SimpleContainer.js
@@ -42,7 +42,7 @@ export default class SimpleContainer extends React.Component {
<div className="global-container">
<div className="page-wrapper page-wrapper-global" id="container">
<nav className="navbar navbar-global page-container" id="global-navigation">
- <div className="navbar-header"></div>
+ <div className="navbar-header"/>
</nav>
<div id="bd" className="page-wrapper-simple">
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js
index c56eaa49078..c2dfa20660c 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js
@@ -29,12 +29,12 @@ import { STATUSES } from '../../../../apps/background-tasks/constants';
import './ComponentNav.css';
export default React.createClass({
- componentDidMount() {
+ componentDidMount () {
this.loadStatus();
this.populateRecentHistory();
},
- loadStatus() {
+ loadStatus () {
getTasksForComponent(this.props.component.id).then(r => {
this.setState({
isPending: r.queue.some(task => task.status === STATUSES.PENDING),
@@ -44,7 +44,7 @@ export default React.createClass({
});
},
- populateRecentHistory() {
+ populateRecentHistory () {
const { breadcrumbs } = this.props.component;
const { qualifier } = breadcrumbs[breadcrumbs.length - 1];
if (['TRK', 'VW', 'DEV'].indexOf(qualifier) !== -1) {
@@ -52,7 +52,7 @@ export default React.createClass({
}
},
- render() {
+ render () {
return (
<nav className="navbar navbar-context page-container" id="context-navigation">
<div className="navbar-context-inner">
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.js
index 393564cd8a3..feddf98a6d7 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.js
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.js
@@ -23,7 +23,7 @@ import PendingIcon from '../../../../components/shared/pending-icon';
import { translate, translateWithParameters } from '../../../../helpers/l10n';
export default React.createClass({
- render() {
+ render () {
const metaList = [];
const canSeeBackgroundTasks = this.props.conf.showBackgroundTasks;
const backgroundTasksUrl =
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBreadcrumbs-test.js b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBreadcrumbs-test.js
index 4790e90ca41..00683ab73e0 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBreadcrumbs-test.js
+++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBreadcrumbs-test.js
@@ -21,7 +21,7 @@ import React from 'react';
import { shallow } from 'enzyme';
import ComponentNavBreadcrumbs from '../ComponentNavBreadcrumbs';
-it('should not render breadcrumbs with one element', function () {
+it('should not render breadcrumbs with one element', () => {
const breadcrumbs = [{ key: 'my-project', name: 'My Project', qualifier: 'TRK' }];
const result = shallow(<ComponentNavBreadcrumbs breadcrumbs={breadcrumbs}/>);
expect(result.find('li').length).toBe(1);
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
index a0af8c4acd3..df674130000 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
@@ -99,7 +99,7 @@ class GlobalNavSearch extends React.Component {
<a className="navbar-search-dropdown" href="#" onClick={this.onClick}>
<i className="icon-search navbar-icon"/>&nbsp;<i className="icon-dropdown"/>
</a>
- <div ref="container" className="dropdown-menu dropdown-menu-right global-navbar-search-dropdown"></div>
+ <div ref="container" className="dropdown-menu dropdown-menu-right global-navbar-search-dropdown"/>
</li>
);
}
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
index 014f55216ef..801a4d95664 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
@@ -121,7 +121,7 @@ export default Marionette.LayoutView.extend({
onRender () {
const that = this;
this.resultsRegion.show(this.resultsView);
- setTimeout(function () {
+ setTimeout(() => {
that.$('.js-search-input').focus();
}, 0);
},
@@ -174,7 +174,7 @@ export default Marionette.LayoutView.extend({
resetResultsToDefault () {
const recentHistory = RecentHistory.get();
- const history = recentHistory.map(function (historyItem, index) {
+ const history = recentHistory.map((historyItem, index) => {
const url = window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(historyItem.key) +
window.dashboardParameters(true);
return {
@@ -184,7 +184,7 @@ export default Marionette.LayoutView.extend({
extra: index === 0 ? translate('browsed_recently') : null
};
});
- const favorite = this.favorite.slice(0, 6).map(function (f, index) {
+ const favorite = this.favorite.slice(0, 6).map((f, index) => {
return { ...f, extra: index === 0 ? translate('favorite') : null };
});
this.results.reset([].concat(history, favorite));
@@ -235,7 +235,7 @@ export default Marionette.LayoutView.extend({
if (isUserAdmin(this.model.get('currentUser'))) {
customItems.push({ name: translate('layout.settings'), url: window.baseUrl + '/settings' });
}
- const findings = [].concat(DEFAULT_ITEMS, customItems).filter(function (f) {
+ const findings = [].concat(DEFAULT_ITEMS, customItems).filter(f => {
return f.name.match(new RegExp(q, 'i'));
});
if (findings.length > 0) {
@@ -246,10 +246,10 @@ export default Marionette.LayoutView.extend({
getGlobalDashboardFindings (q) {
const dashboards = this.model.get('globalDashboards') || [];
- const items = dashboards.map(function (d) {
+ const items = dashboards.map(d => {
return { name: d.name, url: window.baseUrl + '/dashboard/index?did=' + encodeURIComponent(d.key) };
});
- const findings = items.filter(function (f) {
+ const findings = items.filter(f => {
return f.name.match(new RegExp(q, 'i'));
});
if (findings.length > 0) {
@@ -259,7 +259,7 @@ export default Marionette.LayoutView.extend({
},
getFavoriteFindings (q) {
- const findings = this.favorite.filter(function (f) {
+ const findings = this.favorite.filter(f => {
return f.name.match(new RegExp(q, 'i'));
});
if (findings.length > 0) {
diff --git a/server/sonar-web/src/main/js/app/utils/startAjaxMonitoring.js b/server/sonar-web/src/main/js/app/utils/startAjaxMonitoring.js
index 94525d04434..e10c847f6cf 100644
--- a/server/sonar-web/src/main/js/app/utils/startAjaxMonitoring.js
+++ b/server/sonar-web/src/main/js/app/utils/startAjaxMonitoring.js
@@ -64,7 +64,7 @@ const Process = Backbone.Model.extend({
message: msg
});
this.set('state', 'failed');
- setTimeout(function () {
+ setTimeout(() => {
that.finish({ force: true });
}, 5000);
}
@@ -93,7 +93,7 @@ const ProcessesView = Marionette.ItemView.extend({
.addClass('process-spinner process-spinner-failed shown');
const close = $('<button></button>').html('<i class="icon-close"></i>').addClass('process-spinner-close');
close.appendTo(el);
- close.on('click', function () {
+ close.on('click', () => {
failed.finish({ force: true });
});
el.appendTo(this.$el);
@@ -120,7 +120,7 @@ function addBackgroundProcess () {
const uid = _.uniqueId('process');
const process = new Process({
id: uid,
- timer: setTimeout(function () {
+ timer: setTimeout(() => {
process.timeout();
}, defaults.timeout)
});