aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-04-05 11:46:02 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-04-05 11:46:02 +0200
commit0bac18d71ccd2504254cd82c89ea208320a5fb30 (patch)
tree1a5c465a5411469833a612f0893f2de907997682 /server/sonar-web/src/main/js/apps/projects
parent7c90d26047935985378a3aa0f26ee316acba59e1 (diff)
downloadsonarqube-0bac18d71ccd2504254cd82c89ea208320a5fb30.tar.gz
sonarqube-0bac18d71ccd2504254cd82c89ea208320a5fb30.zip
enforce js code style5.5-M14
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/app.js6
-rw-r--r--server/sonar-web/src/main/js/apps/projects/create-view.js1
-rw-r--r--server/sonar-web/src/main/js/apps/projects/delete-view.js1
-rw-r--r--server/sonar-web/src/main/js/apps/projects/main.js17
-rw-r--r--server/sonar-web/src/main/js/apps/projects/projects.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/search.js14
6 files changed, 20 insertions, 21 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/app.js b/server/sonar-web/src/main/js/apps/projects/app.js
index 8ac06e62dd0..7c68d2c4b6e 100644
--- a/server/sonar-web/src/main/js/apps/projects/app.js
+++ b/server/sonar-web/src/main/js/apps/projects/app.js
@@ -24,9 +24,9 @@ import { getCurrentUser } from '../../api/users';
window.sonarqube.appStarted.then(options => {
getCurrentUser().then(user => {
- let el = document.querySelector(options.el);
- let hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1;
- let topLevelQualifiers = options.rootQualifiers;
+ const el = document.querySelector(options.el);
+ const hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1;
+ const topLevelQualifiers = options.rootQualifiers;
ReactDOM.render(<Main hasProvisionPermission={hasProvisionPermission}
topLevelQualifiers={topLevelQualifiers}/>, el);
});
diff --git a/server/sonar-web/src/main/js/apps/projects/create-view.js b/server/sonar-web/src/main/js/apps/projects/create-view.js
index 5a3eb9d4c73..9dc15b0b9f5 100644
--- a/server/sonar-web/src/main/js/apps/projects/create-view.js
+++ b/server/sonar-web/src/main/js/apps/projects/create-view.js
@@ -21,7 +21,6 @@ import ModalForm from '../../components/common/modal-form';
import { createProject } from '../../api/components';
import Template from './templates/projects-create-form.hbs';
-
export default ModalForm.extend({
template: Template,
diff --git a/server/sonar-web/src/main/js/apps/projects/delete-view.js b/server/sonar-web/src/main/js/apps/projects/delete-view.js
index a39823d42a5..7d7ee00be62 100644
--- a/server/sonar-web/src/main/js/apps/projects/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/projects/delete-view.js
@@ -30,4 +30,3 @@ export default ModalForm.extend({
}
});
-
diff --git a/server/sonar-web/src/main/js/apps/projects/main.js b/server/sonar-web/src/main/js/apps/projects/main.js
index ae005a9165e..48bc0cd8a6a 100644
--- a/server/sonar-web/src/main/js/apps/projects/main.js
+++ b/server/sonar-web/src/main/js/apps/projects/main.js
@@ -54,7 +54,7 @@ export default React.createClass({
},
getFilters() {
- let filters = { ps: PAGE_SIZE };
+ const filters = { ps: PAGE_SIZE };
if (this.state.page !== 1) {
filters.p = this.state.page;
}
@@ -76,12 +76,13 @@ export default React.createClass({
this.requestGhosts();
break;
default:
+
// should never happen
}
},
requestGhosts() {
- let data = this.getFilters();
+ const data = this.getFilters();
getGhosts(data).then(r => {
let projects = r.projects.map(project => {
return _.extend(project, { id: project.uuid, qualifier: 'TRK' });
@@ -94,7 +95,7 @@ export default React.createClass({
},
requestProvisioned() {
- let data = this.getFilters();
+ const data = this.getFilters();
getProvisioned(data).then(r => {
let projects = r.projects.map(project => {
return _.extend(project, { id: project.uuid, qualifier: 'TRK' });
@@ -107,7 +108,7 @@ export default React.createClass({
},
requestAllProjects() {
- let data = this.getFilters();
+ const data = this.getFilters();
data.qualifiers = this.state.qualifiers;
getComponents(data).then(r => {
let projects = r.components;
@@ -154,17 +155,17 @@ export default React.createClass({
},
onProjectSelected(project) {
- let newSelection = _.uniq([].concat(this.state.selection, project.id));
+ const newSelection = _.uniq([].concat(this.state.selection, project.id));
this.setState({ selection: newSelection });
},
onProjectDeselected(project) {
- let newSelection = _.without(this.state.selection, project.id);
+ const newSelection = _.without(this.state.selection, project.id);
this.setState({ selection: newSelection });
},
onAllSelected() {
- let newSelection = this.state.projects.map(project => {
+ const newSelection = this.state.projects.map(project => {
return project.id;
});
this.setState({ selection: newSelection });
@@ -175,7 +176,7 @@ export default React.createClass({
},
deleteProjects() {
- let ids = this.state.selection.join(',');
+ const ids = this.state.selection.join(',');
deleteComponents({ ids }).then(() => {
this.setState({ page: 1, selection: [] }, this.requestProjects);
});
diff --git a/server/sonar-web/src/main/js/apps/projects/projects.js b/server/sonar-web/src/main/js/apps/projects/projects.js
index a67d6b090b9..bf92990d726 100644
--- a/server/sonar-web/src/main/js/apps/projects/projects.js
+++ b/server/sonar-web/src/main/js/apps/projects/projects.js
@@ -63,7 +63,7 @@ export default React.createClass({
},
render() {
- let className = classNames('data', 'zebra', { 'new-loading': !this.props.ready });
+ const className = classNames('data', 'zebra', { 'new-loading': !this.props.ready });
return (
<table className={className}>
<tbody>{this.props.projects.map(this.renderProject)}</tbody>
diff --git a/server/sonar-web/src/main/js/apps/projects/search.js b/server/sonar-web/src/main/js/apps/projects/search.js
index 08c9f99898d..f6f0d126db2 100644
--- a/server/sonar-web/src/main/js/apps/projects/search.js
+++ b/server/sonar-web/src/main/js/apps/projects/search.js
@@ -36,7 +36,7 @@ export default React.createClass({
},
search() {
- let q = this.refs.input.value;
+ const q = this.refs.input.value;
this.props.onSearch(q);
},
@@ -49,7 +49,7 @@ export default React.createClass({
},
getQualifierOptions() {
- let options = this.props.topLevelQualifiers.map(q => {
+ const options = this.props.topLevelQualifiers.map(q => {
return { value: q, label: translate('qualifiers', q) };
});
return _.sortBy(options, option => {
@@ -58,12 +58,12 @@ export default React.createClass({
},
renderCheckbox() {
- let isAllChecked = this.props.projects.length > 0 &&
+ const isAllChecked = this.props.projects.length > 0 &&
this.props.selection.length === this.props.projects.length;
- let thirdState = this.props.projects.length > 0 &&
+ const thirdState = this.props.projects.length > 0 &&
this.props.selection.length > 0 &&
this.props.selection.length < this.props.projects.length;
- let isChecked = isAllChecked || thirdState;
+ const isChecked = isAllChecked || thirdState;
return <Checkbox onCheck={this.onCheck} initiallyChecked={isChecked} thirdState={thirdState}/>;
},
@@ -93,7 +93,7 @@ export default React.createClass({
},
renderQualifierFilter() {
- let options = this.getQualifierOptions();
+ const options = this.getQualifierOptions();
if (options.length < 2) {
return null;
}
@@ -106,7 +106,7 @@ export default React.createClass({
},
render() {
- let isSomethingSelected = this.props.projects.length > 0 && this.props.selection.length > 0;
+ const isSomethingSelected = this.props.projects.length > 0 && this.props.selection.length > 0;
return (
<div className="panel panel-vertical bordered-bottom spacer-bottom">
<table className="data">