aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/coding-rules
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-02-22 10:39:30 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-02-22 11:17:19 +0100
commitef39ea00c5822b114d728f73d92eed6635437b98 (patch)
tree14cc3591232af48f70ab6d440fc116e0bd05e739 /server/sonar-web/src/main/js/apps/coding-rules
parenta8b9c87ee38ab2458bd0293b1ee099266b7789ab (diff)
downloadsonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.tar.gz
sonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.zip
improve code quality
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/app.js80
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js52
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js20
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js14
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/controller.js74
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js20
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js14
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js32
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js10
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js30
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js28
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js6
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js18
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js56
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js16
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js24
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js12
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js10
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/filters-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/layout.js16
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/models/rule.js20
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/models/rules.js18
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js64
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js94
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js12
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js38
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js80
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js20
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js16
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js30
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js24
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js64
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js36
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js12
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js46
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js4
43 files changed, 579 insertions, 579 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/app.js b/server/sonar-web/src/main/js/apps/coding-rules/app.js
index c23aa61b3d6..5bca4881b0b 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/app.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/app.js
@@ -33,50 +33,50 @@ import FacetsView from './facets-view';
import FiltersView from './filters-view';
import { translate } from '../../helpers/l10n';
-var App = new Marionette.Application(),
- init = function () {
- let options = window.sonarqube;
+const App = new Marionette.Application();
+const init = function () {
+ let options = window.sonarqube;
- this.layout = new Layout({ el: options.el });
- this.layout.render();
- $('#footer').addClass('search-navigator-footer');
+ this.layout = new Layout({ el: options.el });
+ this.layout.render();
+ $('#footer').addClass('search-navigator-footer');
- this.state = new State();
- this.list = new Rules();
- this.facets = new Facets();
+ this.state = new State();
+ this.list = new Rules();
+ this.facets = new Facets();
- this.controller = new Controller({ app: this });
+ this.controller = new Controller({ app: this });
- this.workspaceListView = new WorkspaceListView({
- app: this,
- collection: this.list
- });
- this.layout.workspaceListRegion.show(this.workspaceListView);
- this.workspaceListView.bindScrollEvents();
+ this.workspaceListView = new WorkspaceListView({
+ app: this,
+ collection: this.list
+ });
+ this.layout.workspaceListRegion.show(this.workspaceListView);
+ this.workspaceListView.bindScrollEvents();
- this.workspaceHeaderView = new WorkspaceHeaderView({
- app: this,
- collection: this.list
- });
- this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView);
+ this.workspaceHeaderView = new WorkspaceHeaderView({
+ app: this,
+ collection: this.list
+ });
+ this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView);
- this.facetsView = new FacetsView({
- app: this,
- collection: this.facets
- });
- this.layout.facetsRegion.show(this.facetsView);
+ this.facetsView = new FacetsView({
+ app: this,
+ collection: this.facets
+ });
+ this.layout.facetsRegion.show(this.facetsView);
- this.filtersView = new FiltersView({
- app: this
- });
- this.layout.filtersRegion.show(this.filtersView);
+ this.filtersView = new FiltersView({
+ app: this
+ });
+ this.layout.filtersRegion.show(this.filtersView);
- key.setScope('list');
- this.router = new Router({
- app: this
- });
- Backbone.history.start();
- };
+ key.setScope('list');
+ this.router = new Router({
+ app: this
+ });
+ Backbone.history.start();
+};
App.manualRepository = function () {
return {
@@ -88,15 +88,15 @@ App.manualRepository = function () {
App.getSubCharacteristicName = function (key) {
if (key != null) {
- var ch = _.findWhere(App.characteristics, { key: key }),
- parent = _.findWhere(App.characteristics, { key: ch.parent });
+ const ch = _.findWhere(App.characteristics, { key });
+ const parent = _.findWhere(App.characteristics, { key: ch.parent });
return [parent.name, ch.name].join(' > ');
} else {
return null;
}
};
-var appXHR = $.get('/api/rules/app').done(function (r) {
+const appXHR = $.get('/api/rules/app').done(function (r) {
App.canWrite = r.canWrite;
App.qualityProfiles = _.sortBy(r.qualityprofiles, ['name', 'lang']);
App.languages = _.extend(r.languages, {
@@ -109,7 +109,7 @@ var appXHR = $.get('/api/rules/app').done(function (r) {
App.repositories.push(App.manualRepository());
App.statuses = r.statuses;
App.characteristics = r.characteristics.map(function (item, index) {
- return _.extend(item, { index: index });
+ return _.extend(item, { index });
});
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js
index cf805e393d3..3e4ebc223d9 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js
@@ -26,29 +26,29 @@ import { translateWithParameters } from '../../helpers/l10n';
export default ModalFormView.extend({
template: Template,
- ui: function () {
+ ui () {
return _.extend(ModalFormView.prototype.ui.apply(this, arguments), {
codingRulesSubmitBulkChange: '#coding-rules-submit-bulk-change'
});
},
- showSuccessMessage: function (profile, succeeded) {
- var profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }),
- profileName = profileBase != null ? profileBase.name : profile,
- message = translateWithParameters('coding_rules.bulk_change.success',
- profileName, profileBase.language, succeeded);
+ showSuccessMessage (profile, succeeded) {
+ const profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile });
+ const profileName = profileBase != null ? profileBase.name : profile;
+ const message = translateWithParameters('coding_rules.bulk_change.success',
+ profileName, profileBase.language, succeeded);
this.ui.messagesContainer.append('<div class="alert alert-success">' + message + '</div>');
},
- showWarnMessage: function (profile, succeeded, failed) {
- var profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }),
- profileName = profileBase != null ? profileBase.name : profile,
- message = translateWithParameters('coding_rules.bulk_change.warning',
- profileName, profileBase.language, succeeded, failed);
+ showWarnMessage (profile, succeeded, failed) {
+ const profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile });
+ const profileName = profileBase != null ? profileBase.name : profile;
+ const message = translateWithParameters('coding_rules.bulk_change.warning',
+ profileName, profileBase.language, succeeded, failed);
this.ui.messagesContainer.append('<div class="alert alert-warning">' + message + '</div>');
},
- onRender: function () {
+ onRender () {
ModalFormView.prototype.onRender.apply(this, arguments);
this.$('#coding-rules-bulk-change-profile').select2({
width: '250px',
@@ -57,20 +57,20 @@ export default ModalFormView.extend({
});
},
- onFormSubmit: function () {
+ onFormSubmit () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
- var url = '/api/qualityprofiles/' + this.options.action + '_rules',
- options = _.extend({}, this.options.app.state.get('query'), { wsAction: this.options.action }),
- profiles = this.$('#coding-rules-bulk-change-profile').val() || [this.options.param];
+ const url = '/api/qualityprofiles/' + this.options.action + '_rules';
+ const options = _.extend({}, this.options.app.state.get('query'), { wsAction: this.options.action });
+ const profiles = this.$('#coding-rules-bulk-change-profile').val() || [this.options.param];
this.ui.messagesContainer.empty();
this.sendRequests(url, options, profiles);
},
- sendRequests: function (url, options, profiles) {
- var that = this,
- looper = $.Deferred().resolve();
+ sendRequests (url, options, profiles) {
+ const that = this;
+ let looper = $.Deferred().resolve();
profiles.forEach(function (profile) {
- var opts = _.extend({}, options, { profile_key: profile });
+ const opts = _.extend({}, options, { profile_key: profile });
looper = looper.then(function () {
return $.post(url, opts).done(function (r) {
if (r.failed) {
@@ -89,10 +89,10 @@ export default ModalFormView.extend({
});
},
- getAvailableQualityProfiles: function () {
- var queryLanguages = this.options.app.state.get('query').languages,
- languages = queryLanguages && queryLanguages.length > 0 ? queryLanguages.split(',') : [],
- profiles = this.options.app.qualityProfiles;
+ getAvailableQualityProfiles () {
+ const queryLanguages = this.options.app.state.get('query').languages;
+ const languages = queryLanguages && queryLanguages.length > 0 ? queryLanguages.split(',') : [];
+ let profiles = this.options.app.qualityProfiles;
if (languages.length > 0) {
profiles = _.filter(profiles, function (profile) {
return languages.indexOf(profile.lang) !== -1;
@@ -101,8 +101,8 @@ export default ModalFormView.extend({
return profiles;
},
- serializeData: function () {
- var profile = _.findWhere(this.options.app.qualityProfiles, { key: this.options.param });
+ serializeData () {
+ const profile = _.findWhere(this.options.app.qualityProfiles, { key: this.options.param });
return _.extend(ModalFormView.prototype.serializeData.apply(this, arguments), {
action: this.options.action,
state: this.options.app.state.toJSON(),
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js
index e00fb0199a2..62725a66911 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js
@@ -30,21 +30,21 @@ export default PopupView.extend({
'click .js-bulk-change': 'doAction'
},
- doAction: function (e) {
- var action = $(e.currentTarget).data('action'),
- param = $(e.currentTarget).data('param');
+ doAction (e) {
+ const action = $(e.currentTarget).data('action');
+ const param = $(e.currentTarget).data('param');
new BulkChangeModalView({
app: this.options.app,
- action: action,
- param: param
+ action,
+ param
}).render();
},
- serializeData: function () {
- var query = this.options.app.state.get('query'),
- profileKey = query.qprofile,
- profile = _.findWhere(this.options.app.qualityProfiles, { key: profileKey }),
- activation = '' + query.activation;
+ serializeData () {
+ const query = this.options.app.state.get('query');
+ const profileKey = query.qprofile;
+ const profile = _.findWhere(this.options.app.qualityProfiles, { key: profileKey });
+ const activation = '' + query.activation;
return {
qualityProfile: profileKey,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js b/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
index 31388d56056..3325e156b5a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
@@ -25,22 +25,22 @@ const DEFAULTS = {
html: '',
yesLabel: 'Yes',
noLabel: 'Cancel',
- yesHandler: function () {
+ yesHandler () {
// no op
},
- noHandler: function () {
+ noHandler () {
// no op
},
- always: function () {
+ always () {
// no op
}
};
export default function (options) {
- var settings = _.extend({}, DEFAULTS, options),
- dialog = $('<div><div class="modal-head"><h2>' + settings.title + '</h2></div><div class="modal-body">' +
- settings.html + '</div><div class="modal-foot"><button data-confirm="yes">' + settings.yesLabel +
- '</button> <a data-confirm="no" class="action">' + settings.noLabel + '</a></div></div>');
+ const settings = _.extend({}, DEFAULTS, options);
+ const dialog = $('<div><div class="modal-head"><h2>' + settings.title + '</h2></div><div class="modal-body">' +
+ settings.html + '</div><div class="modal-foot"><button data-confirm="yes">' + settings.yesLabel +
+ '</button> <a data-confirm="no" class="action">' + settings.noLabel + '</a></div></div>');
$('[data-confirm=yes]', dialog).on('click', function () {
dialog.dialog('close');
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/controller.js b/server/sonar-web/src/main/js/apps/coding-rules/controller.js
index 7b627f9e818..a657c3322e5 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/controller.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/controller.js
@@ -31,16 +31,16 @@ export default Controller.extend({
],
- _searchParameters: function () {
- var fields = this.ruleFields.slice(),
- profile = this.app.state.get('query').qprofile;
+ _searchParameters () {
+ const fields = this.ruleFields.slice();
+ const profile = this.app.state.get('query').qprofile;
if (profile != null) {
fields.push('actives');
fields.push('params');
fields.push('isTemplate');
fields.push('severity');
}
- var params = {
+ const params = {
p: this.app.state.get('page'),
ps: this.pageSize,
facets: this._facetsFromServer().join(),
@@ -52,7 +52,7 @@ export default Controller.extend({
return params;
},
- fetchList: function (firstPage) {
+ fetchList (firstPage) {
firstPage = firstPage == null ? true : firstPage;
if (firstPage) {
this.app.state.set({ selectedIndex: 0, page: 1 }, { silent: true });
@@ -60,11 +60,11 @@ export default Controller.extend({
this.hideDetails(firstPage);
- var that = this,
- url = '/api/rules/search',
- options = _.extend(this._searchParameters(), this.app.state.get('query'));
+ const that = this;
+ const url = '/api/rules/search';
+ const options = _.extend(this._searchParameters(), this.app.state.get('query'));
return $.get(url, options).done(function (r) {
- var rules = that.app.list.parseRules(r);
+ const rules = that.app.list.parseRules(r);
if (firstPage) {
that.app.list.reset(rules);
} else {
@@ -87,46 +87,46 @@ export default Controller.extend({
});
},
- isRulePermalink: function () {
- var query = this.app.state.get('query');
+ isRulePermalink () {
+ const query = this.app.state.get('query');
return query.rule_key != null && this.app.list.length === 1;
},
- requestFacet: function (id) {
- var url = '/api/rules/search',
- facet = this.app.facets.get(id),
- options = _.extend({ facets: id, ps: 1 }, this.app.state.get('query'));
+ requestFacet (id) {
+ const url = '/api/rules/search';
+ const facet = this.app.facets.get(id);
+ const options = _.extend({ facets: id, ps: 1 }, this.app.state.get('query'));
return $.get(url, options).done(function (r) {
- var facetData = _.findWhere(r.facets, { property: id });
+ const facetData = _.findWhere(r.facets, { property: id });
if (facetData) {
facet.set(facetData);
}
});
},
- parseQuery: function () {
- var q = Controller.prototype.parseQuery.apply(this, arguments);
+ parseQuery () {
+ const q = Controller.prototype.parseQuery.apply(this, arguments);
delete q.asc;
delete q.s;
return q;
},
- getRuleDetails: function (rule) {
- var that = this,
- url = '/api/rules/show',
- options = {
- key: rule.id,
- actives: true
- };
+ getRuleDetails (rule) {
+ const that = this;
+ const url = '/api/rules/show';
+ const options = {
+ key: rule.id,
+ actives: true
+ };
return $.get(url, options).done(function (data) {
rule.set(data.rule);
rule.addExtraAttributes(that.app.repositories);
});
},
- showDetails: function (rule) {
- var that = this,
- ruleModel = typeof rule === 'string' ? new Rule({ key: rule }) : rule;
+ showDetails (rule) {
+ const that = this;
+ const ruleModel = typeof rule === 'string' ? new Rule({ key: rule }) : rule;
this.app.layout.workspaceDetailsRegion.reset();
this.getRuleDetails(ruleModel).done(function (data) {
key.setScope('details');
@@ -142,12 +142,12 @@ export default Controller.extend({
});
},
- showDetailsForSelected: function () {
- var rule = this.app.list.at(this.app.state.get('selectedIndex'));
+ showDetailsForSelected () {
+ const rule = this.app.list.at(this.app.state.get('selectedIndex'));
this.showDetails(rule);
},
- hideDetails: function (firstPage) {
+ hideDetails (firstPage) {
key.setScope('list');
this.app.state.unset('rule');
this.app.layout.workspaceDetailsRegion.reset();
@@ -158,20 +158,20 @@ export default Controller.extend({
}
},
- activateCurrent: function () {
+ activateCurrent () {
if (this.app.layout.detailsShow()) {
this.app.workspaceDetailsView.$('#coding-rules-quality-profile-activate').click();
} else {
- var rule = this.app.list.at(this.app.state.get('selectedIndex'));
- var ruleView = this.app.workspaceListView.children.findByModel(rule);
+ const rule = this.app.list.at(this.app.state.get('selectedIndex'));
+ const ruleView = this.app.workspaceListView.children.findByModel(rule);
ruleView.$('.coding-rules-detail-quality-profile-activate').click();
}
},
- deactivateCurrent: function () {
+ deactivateCurrent () {
if (!this.app.layout.detailsShow()) {
- var rule = this.app.list.at(this.app.state.get('selectedIndex'));
- var ruleView = this.app.workspaceListView.children.findByModel(rule);
+ const rule = this.app.list.at(this.app.state.get('selectedIndex'));
+ const ruleView = this.app.workspaceListView.children.findByModel(rule);
ruleView.$('.coding-rules-detail-quality-profile-deactivate').click();
}
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets-view.js b/server/sonar-web/src/main/js/apps/coding-rules/facets-view.js
index 5e289266505..19d288096db 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets-view.js
@@ -33,7 +33,7 @@ import InheritanceFacet from './facets/inheritance-facet';
import ActiveSeverityFacet from './facets/active-severity-facet';
import TemplateFacet from './facets/template-facet';
-var viewsMapping = {
+const viewsMapping = {
q: QueryFacet,
rule_key: KeyFacet,
languages: LanguageFacet,
@@ -51,8 +51,8 @@ var viewsMapping = {
export default FacetsView.extend({
- getChildView: function (model) {
- var view = viewsMapping[model.get('property')];
+ getChildView (model) {
+ const view = viewsMapping[model.get('property')];
return view ? view : BaseFacet;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js
index 200cc9c77ba..598f09c3a58 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js
@@ -26,36 +26,36 @@ export default BaseFacet.extend({
template: Template,
severities: ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'],
- initialize: function (options) {
+ initialize (options) {
this.listenTo(options.app.state, 'change:query', this.onQueryChange);
},
- onQueryChange: function () {
- var query = this.options.app.state.get('query'),
- isProfileSelected = query.qprofile != null,
- isActiveShown = '' + query.activation === 'true';
+ onQueryChange () {
+ const query = this.options.app.state.get('query');
+ const isProfileSelected = query.qprofile != null;
+ const isActiveShown = '' + query.activation === 'true';
if (!isProfileSelected || !isActiveShown) {
this.forbid();
}
},
- onRender: function () {
+ onRender () {
BaseFacet.prototype.onRender.apply(this, arguments);
this.onQueryChange();
},
- forbid: function () {
+ forbid () {
BaseFacet.prototype.forbid.apply(this, arguments);
this.$el.prop('title', translate('coding_rules.filters.active_severity.inactive'));
},
- allow: function () {
+ allow () {
BaseFacet.prototype.allow.apply(this, arguments);
this.$el.prop('title', null);
},
- sortValues: function (values) {
- var order = this.severities;
+ sortValues (values) {
+ const order = this.severities;
return _.sortBy(values, function (v) {
return order.indexOf(v.val);
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js
index 94b968b1fca..cb20c128832 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js
@@ -24,13 +24,13 @@ import Template from '../templates/facets/coding-rules-available-since-facet.hbs
export default BaseFacet.extend({
template: Template,
- events: function () {
+ events () {
return _.extend(BaseFacet.prototype.events.apply(this, arguments), {
'change input': 'applyFacet'
});
},
- onRender: function () {
+ onRender () {
this.$el.toggleClass('search-navigator-facet-box-collapsed', !this.model.get('enabled'));
this.$el.attr('data-property', this.model.get('property'));
this.$('input').datepicker({
@@ -38,20 +38,20 @@ export default BaseFacet.extend({
changeMonth: true,
changeYear: true
});
- var value = this.options.app.state.get('query').available_since;
+ const value = this.options.app.state.get('query').available_since;
if (value) {
this.$('input').val(value);
}
},
- applyFacet: function () {
- var obj = {},
- property = this.model.get('property');
+ applyFacet () {
+ const obj = {};
+ const property = this.model.get('property');
obj[property] = this.$('input').val();
this.options.app.state.updateFilter(obj);
},
- getLabelsSource: function () {
+ getLabelsSource () {
return this.options.app.languages;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js
index 864aea8cd90..8245e239174 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js
@@ -25,21 +25,21 @@ import Template from '../templates/facets/coding-rules-characteristic-facet.hbs'
export default BaseFacet.extend({
template: Template,
- onRender: function () {
+ onRender () {
BaseFacet.prototype.onRender.apply(this, arguments);
- var value = this.options.app.state.get('query').has_debt_characteristic;
+ const value = this.options.app.state.get('query').has_debt_characteristic;
if (value != null && ('' + value === 'false')) {
this.$('.js-facet').filter('[data-empty-characteristic]').addClass('active');
}
},
- toggleFacet: function (e) {
- var noneCharacteristic = $(e.currentTarget).is('[data-empty-characteristic]'),
- property = this.model.get('property'),
- obj = {};
+ toggleFacet (e) {
+ const noneCharacteristic = $(e.currentTarget).is('[data-empty-characteristic]');
+ const property = this.model.get('property');
+ const obj = {};
$(e.currentTarget).toggleClass('active');
if (noneCharacteristic) {
- var checked = $(e.currentTarget).is('.active');
+ const checked = $(e.currentTarget).is('.active');
obj.has_debt_characteristic = checked ? 'false' : null;
obj[property] = null;
} else {
@@ -49,19 +49,19 @@ export default BaseFacet.extend({
this.options.app.state.updateFilter(obj);
},
- disable: function () {
- var property = this.model.get('property'),
- obj = {};
+ disable () {
+ const property = this.model.get('property');
+ const obj = {};
obj.has_debt_characteristic = null;
obj[property] = null;
this.options.app.state.updateFilter(obj);
},
- getValues: function () {
- var values = this.model.getValues(),
- characteristics = this.options.app.characteristics;
+ getValues () {
+ const values = this.model.getValues();
+ const characteristics = this.options.app.characteristics;
return values.map(function (value) {
- var ch = _.findWhere(characteristics, { key: value.val });
+ const ch = _.findWhere(characteristics, { key: value.val });
if (ch != null) {
_.extend(value, ch, { label: ch.name });
}
@@ -69,11 +69,11 @@ export default BaseFacet.extend({
});
},
- sortValues: function (values) {
+ sortValues (values) {
return _.sortBy(values, 'index');
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
values: this.sortValues(this.getValues())
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js
index 47191f744cb..3cd599acaf8 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js
@@ -22,13 +22,13 @@ import BaseFacet from './base-facet';
export default BaseFacet.extend({
- getLabelsSource: function () {
+ getLabelsSource () {
return [];
},
- getValues: function () {
- var that = this,
- labels = that.getLabelsSource();
+ getValues () {
+ const that = this;
+ const labels = that.getLabelsSource();
return this.model.getValues().map(function (item) {
return _.extend(item, {
label: labels[item.val]
@@ -36,7 +36,7 @@ export default BaseFacet.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
values: this.getValues()
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js
index ef9417f855d..5902c89ee78 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js
@@ -25,33 +25,33 @@ import { translate, translateWithParameters } from '../../../helpers/l10n';
export default BaseFacet.extend({
template: Template,
- events: function () {
+ events () {
return _.extend(BaseFacet.prototype.events.apply(this, arguments), {
'change .js-custom-value': 'addCustomValue'
});
},
- getUrl: function () {
+ getUrl () {
return '';
},
- onRender: function () {
+ onRender () {
BaseFacet.prototype.onRender.apply(this, arguments);
this.prepareSearch();
},
- prepareSearch: function () {
+ prepareSearch () {
this.$('.js-custom-value').select2({
placeholder: translate('search_verb'),
minimumInputLength: 1,
allowClear: false,
- formatNoMatches: function () {
+ formatNoMatches () {
return translate('select2.noMatches');
},
- formatSearching: function () {
+ formatSearching () {
return translate('select2.searching');
},
- formatInputTooShort: function () {
+ formatInputTooShort () {
return translateWithParameters('select2.tooShort', 1);
},
width: '100%',
@@ -59,28 +59,28 @@ export default BaseFacet.extend({
});
},
- prepareAjaxSearch: function () {
+ prepareAjaxSearch () {
return {
quietMillis: 300,
url: this.getUrl(),
- data: function (term, page) {
+ data (term, page) {
return { s: term, p: page };
},
- results: function (data) {
+ results (data) {
return { more: data.more, results: data.results };
}
};
},
- addCustomValue: function () {
- var property = this.model.get('property'),
- customValue = this.$('.js-custom-value').select2('val'),
- value = this.getValue();
+ addCustomValue () {
+ const property = this.model.get('property');
+ const customValue = this.$('.js-custom-value').select2('val');
+ let value = this.getValue();
if (value.length > 0) {
value += ',';
}
value += customValue;
- var obj = {};
+ const obj = {};
obj[property] = value;
this.options.app.state.updateFilter(obj);
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js
index 9df375e79de..bd7a3bba91c 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js
@@ -26,15 +26,15 @@ import { translate } from '../../../helpers/l10n';
export default BaseFacet.extend({
template: Template,
- initialize: function (options) {
+ initialize (options) {
this.listenTo(options.app.state, 'change:query', this.onQueryChange);
},
- onQueryChange: function () {
- var query = this.options.app.state.get('query'),
- isProfileSelected = query.qprofile != null;
+ onQueryChange () {
+ const query = this.options.app.state.get('query');
+ const isProfileSelected = query.qprofile != null;
if (isProfileSelected) {
- var profile = _.findWhere(this.options.app.qualityProfiles, { key: query.qprofile });
+ const profile = _.findWhere(this.options.app.qualityProfiles, { key: query.qprofile });
if (profile != null && profile.parentKey == null) {
this.forbid();
}
@@ -43,23 +43,23 @@ export default BaseFacet.extend({
}
},
- onRender: function () {
+ onRender () {
BaseFacet.prototype.onRender.apply(this, arguments);
this.onQueryChange();
},
- forbid: function () {
+ forbid () {
BaseFacet.prototype.forbid.apply(this, arguments);
this.$el.prop('title', translate('coding_rules.filters.inheritance.inactive'));
},
- allow: function () {
+ allow () {
BaseFacet.prototype.allow.apply(this, arguments);
this.$el.prop('title', null);
},
- getValues: function () {
- var values = ['NONE', 'INHERITED', 'OVERRIDES'];
+ getValues () {
+ const values = ['NONE', 'INHERITED', 'OVERRIDES'];
return values.map(function (key) {
return {
label: translate('coding_rules.filters.inheritance', key.toLowerCase()),
@@ -68,9 +68,9 @@ export default BaseFacet.extend({
});
},
- toggleFacet: function (e) {
- var obj = {},
- property = this.model.get('property');
+ toggleFacet (e) {
+ const obj = {};
+ const property = this.model.get('property');
if ($(e.currentTarget).is('.active')) {
obj[property] = null;
} else {
@@ -79,7 +79,7 @@ export default BaseFacet.extend({
this.options.app.state.updateFilter(obj);
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
values: this.getValues()
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js
index 538c2b7f75f..62613aabed5 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js
@@ -24,15 +24,15 @@ import Template from '../templates/facets/coding-rules-key-facet.hbs';
export default BaseFacet.extend({
template: Template,
- onRender: function () {
+ onRender () {
this.$el.toggleClass('hidden', !this.options.app.state.get('query').rule_key);
},
- disable: function () {
+ disable () {
this.options.app.state.updateFilter({ rule_key: null });
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
key: this.options.app.state.get('query').rule_key
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js
index 56703f8a0a6..05c268aeb09 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js
@@ -22,18 +22,18 @@ import CustomValuesFacet from './custom-values-facet';
export default CustomValuesFacet.extend({
- getUrl: function () {
+ getUrl () {
return '/api/languages/list';
},
- prepareAjaxSearch: function () {
+ prepareAjaxSearch () {
return {
quietMillis: 300,
url: this.getUrl(),
- data: function (term) {
+ data (term) {
return { q: term, ps: 10000 };
},
- results: function (data) {
+ results (data) {
return {
more: false,
results: data.languages.map(function (lang) {
@@ -44,13 +44,13 @@ export default CustomValuesFacet.extend({
};
},
- getLabelsSource: function () {
+ getLabelsSource () {
return this.options.app.languages;
},
- getValues: function () {
- var that = this,
- labels = that.getLabelsSource();
+ getValues () {
+ const that = this;
+ const labels = that.getLabelsSource();
return this.model.getValues().map(function (item) {
return _.extend(item, {
label: labels[item.val]
@@ -58,7 +58,7 @@ export default CustomValuesFacet.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(CustomValuesFacet.prototype.serializeData.apply(this, arguments), {
values: this.getValues()
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js
index fd77e0863fa..b50c8bd7481 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js
@@ -25,35 +25,35 @@ import Template from '../templates/facets/coding-rules-quality-profile-facet.hbs
export default BaseFacet.extend({
template: Template,
- events: function () {
+ events () {
return _.extend(BaseFacet.prototype.events.apply(this, arguments), {
'click .js-active': 'setActivation',
'click .js-inactive': 'unsetActivation'
});
},
- getValues: function () {
- var that = this,
- languagesQuery = this.options.app.state.get('query').languages,
- languages = languagesQuery != null ? languagesQuery.split(',') : [],
- lang = languages.length === 1 ? languages[0] : null,
- values = this.options.app.qualityProfiles
- .filter(function (profile) {
- return lang != null ? profile.lang === lang : true;
- })
- .map(function (profile) {
- return {
- label: profile.name,
- extra: that.options.app.languages[profile.lang],
- val: profile.key
- };
- });
+ getValues () {
+ const that = this;
+ const languagesQuery = this.options.app.state.get('query').languages;
+ const languages = languagesQuery != null ? languagesQuery.split(',') : [];
+ const lang = languages.length === 1 ? languages[0] : null;
+ const values = this.options.app.qualityProfiles
+ .filter(function (profile) {
+ return lang != null ? profile.lang === lang : true;
+ })
+ .map(function (profile) {
+ return {
+ label: profile.name,
+ extra: that.options.app.languages[profile.lang],
+ val: profile.key
+ };
+ });
return _.sortBy(values, 'label');
},
- toggleFacet: function (e) {
- var obj = {},
- property = this.model.get('property');
+ toggleFacet (e) {
+ const obj = {};
+ const property = this.model.get('property');
if ($(e.currentTarget).is('.active')) {
obj.activation = null;
obj[property] = null;
@@ -64,29 +64,29 @@ export default BaseFacet.extend({
this.options.app.state.updateFilter(obj);
},
- setActivation: function (e) {
+ setActivation (e) {
e.stopPropagation();
this.options.app.state.updateFilter({ activation: 'true' });
},
- unsetActivation: function (e) {
+ unsetActivation (e) {
e.stopPropagation();
this.options.app.state.updateFilter({ activation: 'false', active_severities: null });
},
- getToggled: function () {
- var activation = this.options.app.state.get('query').activation;
+ getToggled () {
+ const activation = this.options.app.state.get('query').activation;
return activation === 'true' || activation === true;
},
- disable: function () {
- var obj = { activation: null },
- property = this.model.get('property');
+ disable () {
+ const obj = { activation: null };
+ const property = this.model.get('property');
obj[property] = null;
this.options.app.state.updateFilter(obj);
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
values: this.getValues(),
toggled: this.getToggled()
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js
index e279c81648b..8192403a2f6 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js
@@ -24,29 +24,29 @@ import Template from '../templates/facets/coding-rules-query-facet.hbs';
export default BaseFacet.extend({
template: Template,
- events: function () {
+ events () {
return _.extend(BaseFacet.prototype.events.apply(this, arguments), {
'submit form': 'onFormSubmit'
});
},
- onRender: function () {
+ onRender () {
this.$el.attr('data-property', this.model.get('property'));
- var query = this.options.app.state.get('query'),
- value = query.q;
+ const query = this.options.app.state.get('query');
+ const value = query.q;
if (value != null) {
this.$('input').val(value);
}
},
- onFormSubmit: function (e) {
+ onFormSubmit (e) {
e.preventDefault();
this.applyFacet();
},
- applyFacet: function () {
- var obj = {},
- property = this.model.get('property');
+ applyFacet () {
+ const obj = {};
+ const property = this.model.get('property');
obj[property] = this.$('input').val();
this.options.app.state.updateFilter(obj, { force: true });
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js
index 73d4b6ebcb2..3c5fea1b300 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js
@@ -22,18 +22,18 @@ import CustomValuesFacet from './custom-values-facet';
export default CustomValuesFacet.extend({
- getUrl: function () {
+ getUrl () {
return '/api/rules/repositories';
},
- prepareAjaxSearch: function () {
+ prepareAjaxSearch () {
return {
quietMillis: 300,
url: this.getUrl(),
- data: function (term) {
+ data (term) {
return { q: term, ps: 10000 };
},
- results: function (data) {
+ results (data) {
return {
more: false,
results: data.repositories.map(function (repo) {
@@ -44,25 +44,25 @@ export default CustomValuesFacet.extend({
};
},
- getLabelsSource: function () {
- var repos = this.options.app.repositories;
+ getLabelsSource () {
+ const repos = this.options.app.repositories;
return _.object(_.pluck(repos, 'key'), _.pluck(repos, 'name'));
},
- getValues: function () {
- var that = this,
- labels = that.getLabelsSource();
+ getValues () {
+ const that = this;
+ const labels = that.getLabelsSource();
return this.model.getValues().map(function (value) {
- var repo = _.findWhere(that.options.app.repositories, { key: value.val });
+ const repo = _.findWhere(that.options.app.repositories, { key: value.val });
if (repo != null) {
- var langName = that.options.app.languages[repo.language];
+ const langName = that.options.app.languages[repo.language];
_.extend(value, { extra: langName });
}
return _.extend(value, { label: labels[value.val] });
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(CustomValuesFacet.prototype.serializeData.apply(this, arguments), {
values: this.getValues()
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js
index defdef17325..970722c318c 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js
@@ -25,8 +25,8 @@ export default BaseFacet.extend({
template: Template,
severities: ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'],
- sortValues: function (values) {
- var order = this.severities;
+ sortValues (values) {
+ const order = this.severities;
return _.sortBy(values, function (v) {
return order.indexOf(v.val);
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js
index 544dcffbb05..eab8055cfe2 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js
@@ -24,22 +24,22 @@ import { translate } from '../../../helpers/l10n';
export default BaseFacet.extend({
statuses: ['READY', 'DEPRECATED', 'BETA'],
- getValues: function () {
- var values = this.model.getValues();
- var x = values.map(function (value) {
+ getValues () {
+ const values = this.model.getValues();
+ const x = values.map(function (value) {
return _.extend(value, { label: translate('rules.status', value.val.toLowerCase()) });
});
return x;
},
- sortValues: function (values) {
- var order = this.statuses;
+ sortValues (values) {
+ const order = this.statuses;
return _.sortBy(values, function (v) {
return order.indexOf(v.val);
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
values: this.sortValues(this.getValues())
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js
index 91d3cb52624..210a73a9434 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js
@@ -21,18 +21,18 @@ import CustomValuesFacet from './custom-values-facet';
export default CustomValuesFacet.extend({
- getUrl: function () {
+ getUrl () {
return '/api/rules/tags';
},
- prepareAjaxSearch: function () {
+ prepareAjaxSearch () {
return {
quietMillis: 300,
url: this.getUrl(),
- data: function (term) {
+ data (term) {
return { q: term, ps: 10000 };
},
- results: function (data) {
+ results (data) {
return {
more: false,
results: data.tags.map(function (tag) {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js
index 7b06a5ca7e8..85f420c7bde 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js
@@ -24,18 +24,18 @@ import Template from '../templates/facets/coding-rules-template-facet.hbs';
export default BaseFacet.extend({
template: Template,
- onRender: function () {
+ onRender () {
BaseFacet.prototype.onRender.apply(this, arguments);
- var value = this.options.app.state.get('query').is_template;
+ const value = this.options.app.state.get('query').is_template;
if (value != null) {
this.$('.js-facet').filter('[data-value="' + value + '"]').addClass('active');
}
},
- toggleFacet: function (e) {
+ toggleFacet (e) {
$(e.currentTarget).toggleClass('active');
- var property = this.model.get('property'),
- obj = {};
+ const property = this.model.get('property');
+ const obj = {};
if ($(e.currentTarget).hasClass('active')) {
obj[property] = '' + $(e.currentTarget).data('value');
} else {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js
index 8fd942bf7be..fb91769a46f 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js
@@ -29,13 +29,13 @@ export default Marionette.ItemView.extend({
'click .js-create-manual-rule': 'createManualRule'
},
- createManualRule: function () {
+ createManualRule () {
new ManualRuleCreationView({
app: this.options.app
}).render();
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/layout.js b/server/sonar-web/src/main/js/apps/coding-rules/layout.js
index 20a559ad713..9d40b1c5833 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/layout.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/layout.js
@@ -32,27 +32,27 @@ export default Marionette.LayoutView.extend({
workspaceDetailsRegion: '.search-navigator-workspace-details'
},
- onRender: function () {
- var navigator = this.$('.search-navigator');
- var top = navigator.offset().top;
- this.$('.search-navigator-workspace-header').css({ top: top });
- this.$('.search-navigator-side').css({ top: top }).isolatedScroll();
+ onRender () {
+ const navigator = this.$('.search-navigator');
+ const top = navigator.offset().top;
+ this.$('.search-navigator-workspace-header').css({ top });
+ this.$('.search-navigator-side').css({ top }).isolatedScroll();
},
- showDetails: function () {
+ showDetails () {
this.scroll = $(window).scrollTop();
this.$('.search-navigator').addClass('search-navigator-extended-view');
},
- hideDetails: function () {
+ hideDetails () {
this.$('.search-navigator').removeClass('search-navigator-extended-view');
if (this.scroll != null) {
$(window).scrollTop(this.scroll);
}
},
- detailsShow: function () {
+ detailsShow () {
return this.$('.search-navigator').is('.search-navigator-extended-view');
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js
index ed356e6ed24..8ceb2ec3dc8 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js
@@ -23,21 +23,21 @@ import Backbone from 'backbone';
export default Backbone.Model.extend({
idAttribute: 'key',
- addExtraAttributes: function (repositories) {
- var repo = _.findWhere(repositories, { key: this.get('repo') }) || this.get('repo'),
- repoName = repo != null ? repo.name : repo,
- isManual = this.get('repo') === 'manual',
- isCustom = this.has('templateKey');
+ addExtraAttributes (repositories) {
+ const repo = _.findWhere(repositories, { key: this.get('repo') }) || this.get('repo');
+ const repoName = repo != null ? repo.name : repo;
+ const isManual = this.get('repo') === 'manual';
+ const isCustom = this.has('templateKey');
this.set({
- repoName: repoName,
- isManual: isManual,
- isCustom: isCustom
+ repoName,
+ isManual,
+ isCustom
}, { silent: true });
},
- getInactiveProfiles: function (actives, profiles) {
+ getInactiveProfiles (actives, profiles) {
return actives.map(function (profile) {
- var profileBase = _.findWhere(profiles, { key: profile.qProfile });
+ const profileBase = _.findWhere(profiles, { key: profile.qProfile });
if (profileBase != null) {
_.extend(profile, profileBase);
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js
index b68a377f575..57906ae9c7f 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js
@@ -24,16 +24,16 @@ import Rule from './rule';
export default Backbone.Collection.extend({
model: Rule,
- parseRules: function (r) {
- var rules = r.rules,
- profiles = r.qProfiles || [];
+ parseRules (r) {
+ let rules = r.rules;
+ const profiles = r.qProfiles || [];
if (r.actives != null) {
rules = rules.map(function (rule) {
- var activations = (r.actives[rule.key] || []).map(function (activation) {
- var profile = profiles[activation.qProfile];
+ const activations = (r.actives[rule.key] || []).map(function (activation) {
+ const profile = profiles[activation.qProfile];
if (profile != null) {
- _.extend(activation, { profile: profile });
+ _.extend(activation, { profile });
if (profile.parent != null) {
_.extend(activation, { parentProfile: profiles[profile.parent] });
}
@@ -46,13 +46,13 @@ export default Backbone.Collection.extend({
return rules;
},
- setIndex: function () {
+ setIndex () {
this.forEach(function (rule, index) {
- rule.set({ index: index });
+ rule.set({ index });
});
},
- addExtraAttributes: function (repositories) {
+ addExtraAttributes (repositories) {
this.models.forEach(function (model) {
model.addExtraAttributes(repositories);
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
index c13e5538ee4..ddf87c1efbe 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
@@ -53,7 +53,7 @@ export default Marionette.LayoutView.extend({
'click .js-delete': 'deleteRule'
},
- initialize: function () {
+ initialize () {
this.bindShortcuts();
this.customRules = new Rules();
if (this.model.get('isTemplate')) {
@@ -62,7 +62,7 @@ export default Marionette.LayoutView.extend({
this.listenTo(this.options.app.state, 'change:selectedIndex', this.select);
},
- onRender: function () {
+ onRender () {
this.metaRegion.show(new MetaView({
app: this.options.app,
model: this.model
@@ -92,28 +92,28 @@ export default Marionette.LayoutView.extend({
this.$el.scrollParent().scrollTop(0);
},
- onDestroy: function () {
+ onDestroy () {
this.unbindShortcuts();
},
- fetchCustomRules: function () {
- var that = this,
- url = '/api/rules/search',
- options = {
- template_key: this.model.get('key'),
- f: 'name,severity,params'
- };
+ fetchCustomRules () {
+ const that = this;
+ const url = '/api/rules/search';
+ const options = {
+ template_key: this.model.get('key'),
+ f: 'name,severity,params'
+ };
return $.get(url, options).done(function (data) {
that.customRules.reset(data.rules);
});
},
- getQualityProfiles: function () {
+ getQualityProfiles () {
return this.model.getInactiveProfiles(this.options.actives, this.options.app.qualityProfiles);
},
- bindShortcuts: function () {
- var that = this;
+ bindShortcuts () {
+ const that = this;
key('up', 'details', function () {
that.options.app.controller.selectPrev();
return false;
@@ -128,33 +128,33 @@ export default Marionette.LayoutView.extend({
});
},
- unbindShortcuts: function () {
+ unbindShortcuts () {
key.deleteScope('details');
},
- editManualRule: function () {
+ editManualRule () {
new ManualRuleCreationView({
app: this.options.app,
model: this.model
}).render();
},
- editCustomRule: function () {
+ editCustomRule () {
new CustomRuleCreationView({
app: this.options.app,
model: this.model
}).render();
},
- deleteRule: function () {
- var that = this,
- ruleType = this.model.has('templateKey') ? 'custom' : 'manual';
+ deleteRule () {
+ const that = this;
+ const ruleType = this.model.has('templateKey') ? 'custom' : 'manual';
confirmDialog({
title: translate('delete'),
html: translateWithParameters('coding_rules.delete.' + ruleType + '.confirm', this.model.get('name')),
- yesHandler: function () {
- var url = '/api/rules/delete',
- options = { key: that.model.id };
+ yesHandler () {
+ const url = '/api/rules/delete';
+ const options = { key: that.model.id };
$.post(url, options).done(function () {
that.options.app.controller.fetchList();
});
@@ -162,17 +162,17 @@ export default Marionette.LayoutView.extend({
});
},
- select: function () {
- var selected = this.options.app.state.get('selectedIndex'),
- selectedRule = this.options.app.list.at(selected);
+ select () {
+ const selected = this.options.app.state.get('selectedIndex');
+ const selectedRule = this.options.app.list.at(selected);
this.options.app.controller.showDetails(selectedRule);
},
- serializeData: function () {
- var isManual = this.model.get('isManual'),
- isCustom = this.model.has('templateKey'),
- isEditable = this.options.app.canWrite && (isManual || isCustom),
- qualityProfilesVisible = !isManual;
+ serializeData () {
+ const isManual = this.model.get('isManual');
+ const isCustom = this.model.has('templateKey');
+ const isEditable = this.options.app.canWrite && (isManual || isCustom);
+ let qualityProfilesVisible = !isManual;
if (qualityProfilesVisible) {
if (this.model.get('isTemplate')) {
@@ -184,9 +184,9 @@ export default Marionette.LayoutView.extend({
}
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
- isEditable: isEditable,
+ isEditable,
canWrite: this.options.app.canWrite,
- qualityProfilesVisible: qualityProfilesVisible,
+ qualityProfilesVisible,
allTags: _.union(this.model.get('sysTags'), this.model.get('tags'))
});
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js
index 7893cf5e5db..577d63af9e1 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js
@@ -25,14 +25,14 @@ import Template from './templates/coding-rules-rule-filter-form.hbs';
export default ActionOptionsView.extend({
template: Template,
- selectOption: function (e) {
- var property = $(e.currentTarget).data('property'),
- value = $(e.currentTarget).data('value');
+ selectOption (e) {
+ const property = $(e.currentTarget).data('property');
+ const value = $(e.currentTarget).data('value');
this.trigger('select', property, value);
return ActionOptionsView.prototype.selectOption.apply(this, arguments);
},
- serializeData: function () {
+ serializeData () {
return _.extend(ActionOptionsView.prototype.serializeData.apply(this, arguments), {
tags: _.union(this.model.get('sysTags'), this.model.get('tags'))
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js
index dc0ad6fb708..a76577128f9 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js
@@ -28,7 +28,7 @@ import { translate } from '../../../helpers/l10n';
export default ModalFormView.extend({
template: Template,
- ui: function () {
+ ui () {
return _.extend(ModalFormView.prototype.ui.apply(this, arguments), {
customRuleCreationKey: '#coding-rules-custom-rule-creation-key',
customRuleCreationName: '#coding-rules-custom-rule-creation-name',
@@ -42,7 +42,7 @@ export default ModalFormView.extend({
});
},
- events: function () {
+ events () {
return _.extend(ModalFormView.prototype.events.apply(this, arguments), {
'input @ui.customRuleCreationName': 'generateKey',
'keydown @ui.customRuleCreationName': 'generateKey',
@@ -58,31 +58,31 @@ export default ModalFormView.extend({
});
},
- generateKey: function () {
+ generateKey () {
if (!this.keyModifiedByUser && this.ui.customRuleCreationKey) {
- var generatedKey = latinize(this.ui.customRuleCreationName.val()).replace(/[^A-Za-z0-9]/g, '_');
+ const generatedKey = latinize(this.ui.customRuleCreationName.val()).replace(/[^A-Za-z0-9]/g, '_');
this.ui.customRuleCreationKey.val(generatedKey);
}
},
- flagKey: function () {
+ flagKey () {
this.keyModifiedByUser = true;
},
- onRender: function () {
+ onRender () {
ModalFormView.prototype.onRender.apply(this, arguments);
this.keyModifiedByUser = false;
- var format = function (state) {
- if (!state.id) {
- return state.text;
- } else {
- return '<i class="icon-severity-' + state.id.toLowerCase() + '"></i> ' + state.text;
- }
- },
- severity = (this.model && this.model.get('severity')) || this.options.templateRule.get('severity'),
- status = (this.model && this.model.get('status')) || this.options.templateRule.get('status');
+ const format = function (state) {
+ if (!state.id) {
+ return state.text;
+ } else {
+ return '<i class="icon-severity-' + state.id.toLowerCase() + '"></i> ' + state.text;
+ }
+ };
+ const severity = (this.model && this.model.get('severity')) || this.options.templateRule.get('severity');
+ const status = (this.model && this.model.get('status')) || this.options.templateRule.get('status');
this.ui.customRuleCreationSeverity.val(severity);
this.ui.customRuleCreationSeverity.select2({
@@ -99,15 +99,15 @@ export default ModalFormView.extend({
});
},
- create: function (e) {
+ create (e) {
e.preventDefault();
- var action = (this.model && this.model.has('key')) ? 'update' : 'create',
- options = {
- name: this.ui.customRuleCreationName.val(),
- markdown_description: this.ui.customRuleCreationHtmlDescription.val(),
- severity: this.ui.customRuleCreationSeverity.val(),
- status: this.ui.customRuleCreationStatus.val()
- };
+ const action = (this.model && this.model.has('key')) ? 'update' : 'create';
+ const options = {
+ name: this.ui.customRuleCreationName.val(),
+ markdown_description: this.ui.customRuleCreationHtmlDescription.val(),
+ severity: this.ui.customRuleCreationSeverity.val(),
+ status: this.ui.customRuleCreationStatus.val()
+ };
if (this.model && this.model.has('key')) {
options.key = this.model.get('key');
} else {
@@ -117,15 +117,15 @@ export default ModalFormView.extend({
prevent_reactivation: true
});
}
- var params = this.ui.customRuleCreationParameters.map(function () {
- var node = $(this),
- value = node.val();
+ const params = this.ui.customRuleCreationParameters.map(function () {
+ const node = $(this);
+ let value = node.val();
if (!value && action === 'create') {
value = node.prop('placeholder') || '';
}
return {
key: node.prop('name'),
- value: value
+ value
};
}).get();
options.params = params.map(function (param) {
@@ -134,29 +134,29 @@ export default ModalFormView.extend({
this.sendRequest(action, options);
},
- reactivate: function () {
- var options = {
- name: this.existingRule.name,
- markdown_description: this.existingRule.mdDesc,
- severity: this.existingRule.severity,
- status: this.existingRule.status,
- template_key: this.existingRule.templateKey,
- custom_key: this.ui.customRuleCreationKey.val(),
- prevent_reactivation: false
- },
- params = this.existingRule.params;
+ reactivate () {
+ const options = {
+ name: this.existingRule.name,
+ markdown_description: this.existingRule.mdDesc,
+ severity: this.existingRule.severity,
+ status: this.existingRule.status,
+ template_key: this.existingRule.templateKey,
+ custom_key: this.ui.customRuleCreationKey.val(),
+ prevent_reactivation: false
+ };
+ const params = this.existingRule.params;
options.params = params.map(function (param) {
return param.key + '=' + param.defaultValue;
}).join(';');
this.sendRequest('create', options);
},
- sendRequest: function (action, options) {
+ sendRequest (action, options) {
this.$('.alert').addClass('hidden');
- var that = this,
- url = '/api/rules/' + action;
+ const that = this;
+ const url = '/api/rules/' + action;
return $.ajax({
- url: url,
+ url,
type: 'POST',
data: options,
statusCode: {
@@ -182,8 +182,8 @@ export default ModalFormView.extend({
});
},
- serializeData: function () {
- var params = {};
+ serializeData () {
+ let params = {};
if (this.options.templateRule) {
params = this.options.templateRule.get('params');
} else if (this.model && this.model.has('params')) {
@@ -192,7 +192,7 @@ export default ModalFormView.extend({
});
}
- var statuses = ['READY', 'BETA', 'DEPRECATED'].map(function (status) {
+ const statuses = ['READY', 'BETA', 'DEPRECATED'].map(function (status) {
return {
id: status,
text: translate('rules.status', status.toLowerCase())
@@ -201,9 +201,9 @@ export default ModalFormView.extend({
return _.extend(ModalFormView.prototype.serializeData.apply(this, arguments), {
change: this.model && this.model.has('key'),
- params: params,
+ params,
severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'],
- statuses: statuses
+ statuses
});
}
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js
index 992d662ef31..41f9a7f5912 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js
@@ -36,14 +36,14 @@ export default Marionette.ItemView.extend({
'click .js-delete-custom-rule': 'deleteRule'
},
- deleteRule: function () {
- var that = this;
+ deleteRule () {
+ const that = this;
confirmDialog({
title: translate('delete'),
html: translate('are_you_sure'),
- yesHandler: function () {
- var url = '/api/rules/delete',
- options = { key: that.model.id };
+ yesHandler () {
+ const url = '/api/rules/delete';
+ const options = { key: that.model.id };
$.post(url, options).done(function () {
that.model.collection.remove(that.model);
that.destroy();
@@ -52,7 +52,7 @@ export default Marionette.ItemView.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite,
templateRule: this.options.templateRule,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js
index 119a95feb8e..134dd5c057e 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js
@@ -28,7 +28,7 @@ export default Marionette.CompositeView.extend({
childView: CustomRuleView,
childViewContainer: '#coding-rules-detail-custom-rules',
- childViewOptions: function () {
+ childViewOptions () {
return {
app: this.options.app,
templateRule: this.model
@@ -43,18 +43,18 @@ export default Marionette.CompositeView.extend({
'click .js-create-custom-rule': 'createCustomRule'
},
- onRender: function () {
+ onRender () {
this.$el.toggleClass('hidden', !this.model.get('isTemplate'));
},
- createCustomRule: function () {
+ createCustomRule () {
new CustomRuleCreationView({
app: this.options.app,
templateRule: this.model
}).render();
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js
index 9e807573888..a34ad593ce6 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js
@@ -27,7 +27,7 @@ import { translate } from '../../../helpers/l10n';
export default ModalFormView.extend({
template: Template,
- ui: function () {
+ ui () {
return _.extend(ModalFormView.prototype.ui.apply(this.arguments), {
manualRuleCreationKey: '#coding-rules-manual-rule-creation-key',
manualRuleCreationName: '#coding-rules-manual-rule-creation-name',
@@ -41,7 +41,7 @@ export default ModalFormView.extend({
});
},
- events: function () {
+ events () {
return _.extend(ModalFormView.prototype.events.apply(this.arguments), {
'input @ui.manualRuleCreationName': 'generateKey',
'keydown @ui.manualRuleCreationName': 'generateKey',
@@ -57,29 +57,29 @@ export default ModalFormView.extend({
});
},
- onRender: function () {
+ onRender () {
ModalFormView.prototype.onRender.apply(this, arguments);
this.keyModifiedByUser = false;
this.ui.manualRuleCreationReactivate.addClass('hidden');
},
- generateKey: function () {
+ generateKey () {
if (!this.keyModifiedByUser && this.ui.manualRuleCreationKey) {
- var generatedKey = latinize(this.ui.manualRuleCreationName.val()).replace(/[^A-Za-z0-9]/g, '_');
+ const generatedKey = latinize(this.ui.manualRuleCreationName.val()).replace(/[^A-Za-z0-9]/g, '_');
this.ui.manualRuleCreationKey.val(generatedKey);
}
},
- flagKey: function () {
+ flagKey () {
this.keyModifiedByUser = true;
},
- create: function () {
- var action = (this.model && this.model.has('key')) ? 'update' : 'create',
- options = {
- name: this.ui.manualRuleCreationName.val(),
- markdown_description: this.ui.manualRuleCreationHtmlDescription.val()
- };
+ create () {
+ const action = (this.model && this.model.has('key')) ? 'update' : 'create';
+ const options = {
+ name: this.ui.manualRuleCreationName.val(),
+ markdown_description: this.ui.manualRuleCreationHtmlDescription.val()
+ };
if (action === 'update') {
options.key = this.model.get('key');
} else {
@@ -89,8 +89,8 @@ export default ModalFormView.extend({
this.sendRequest(action, options);
},
- reactivate: function () {
- var options = {
+ reactivate () {
+ const options = {
name: this.existingRule.name,
markdown_description: this.existingRule.mdDesc,
manual_key: this.ui.manualRuleCreationKey.val(),
@@ -99,11 +99,11 @@ export default ModalFormView.extend({
this.sendRequest('create', options);
},
- sendRequest: function (action, options) {
- var that = this,
- url = '/api/rules/' + action;
+ sendRequest (action, options) {
+ const that = this;
+ const url = '/api/rules/' + action;
return $.ajax({
- url: url,
+ url,
type: 'POST',
data: options,
statusCode: {
@@ -128,7 +128,7 @@ export default ModalFormView.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(ModalFormView.prototype.serializeData.apply(this, arguments), {
change: this.model && this.model.has('key')
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js
index 84b4784c44d..e9f526e398e 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js
@@ -27,7 +27,7 @@ import { csvEscape } from '../../../helpers/csv';
export default ModalForm.extend({
template: Template,
- ui: function () {
+ ui () {
return _.extend(ModalForm.prototype.ui.apply(this, arguments), {
qualityProfileSelect: '#coding-rules-quality-profile-activation-select',
qualityProfileSeverity: '#coding-rules-quality-profile-activation-severity',
@@ -36,13 +36,13 @@ export default ModalForm.extend({
});
},
- events: function () {
+ events () {
return _.extend(ModalForm.prototype.events.apply(this, arguments), {
'click @ui.qualityProfileActivate': 'activate'
});
},
- onRender: function () {
+ onRender () {
ModalForm.prototype.onRender.apply(this, arguments);
this.ui.qualityProfileSelect.select2({
@@ -50,15 +50,15 @@ export default ModalForm.extend({
minimumResultsForSearch: 5
});
- var that = this,
- format = function (state) {
- if (!state.id) {
- return state.text;
- } else {
- return '<i class="icon-severity-' + state.id.toLowerCase() + '"></i> ' + state.text;
- }
- },
- severity = (this.model && this.model.get('severity')) || this.options.rule.get('severity');
+ const that = this;
+ const format = function (state) {
+ if (!state.id) {
+ return state.text;
+ } else {
+ return '<i class="icon-severity-' + state.id.toLowerCase() + '"></i> ' + state.text;
+ }
+ };
+ const severity = (this.model && this.model.get('severity')) || this.options.rule.get('severity');
this.ui.qualityProfileSeverity.val(severity);
this.ui.qualityProfileSeverity.select2({
width: '250px',
@@ -71,19 +71,19 @@ export default ModalForm.extend({
}, 0);
},
- activate: function (e) {
+ activate (e) {
e.preventDefault();
- var that = this,
- profileKey = this.ui.qualityProfileSelect.val(),
- params = this.ui.qualityProfileParameters.map(function () {
- return {
- key: $(this).prop('name'),
- value: $(this).val() || $(this).prop('placeholder') || ''
- };
- }).get(),
- paramsHash = (params.map(function (param) {
- return param.key + '=' + csvEscape(param.value);
- })).join(';');
+ const that = this;
+ let profileKey = this.ui.qualityProfileSelect.val();
+ const params = this.ui.qualityProfileParameters.map(function () {
+ return {
+ key: $(this).prop('name'),
+ value: $(this).val() || $(this).prop('placeholder') || ''
+ };
+ }).get();
+ const paramsHash = (params.map(function (param) {
+ return param.key + '=' + csvEscape(param.value);
+ })).join(';');
if (this.model) {
profileKey = this.model.get('qProfile');
@@ -92,8 +92,8 @@ export default ModalForm.extend({
}
}
- var severity = this.ui.qualityProfileSeverity.val(),
- ruleKey = this.options.rule.get('key');
+ const severity = this.ui.qualityProfileSeverity.val();
+ const ruleKey = this.options.rule.get('key');
this.disableForm();
@@ -103,7 +103,7 @@ export default ModalForm.extend({
data: {
profile_key: profileKey,
rule_key: ruleKey,
- severity: severity,
+ severity,
params: paramsHash
},
statusCode: {
@@ -119,23 +119,23 @@ export default ModalForm.extend({
});
},
- getAvailableQualityProfiles: function (lang) {
- var activeQualityProfiles = this.collection || new Backbone.Collection(),
- inactiveProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
- return activeQualityProfiles.findWhere({ key: profile.key });
- });
+ getAvailableQualityProfiles (lang) {
+ const activeQualityProfiles = this.collection || new Backbone.Collection();
+ const inactiveProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
+ return activeQualityProfiles.findWhere({ key: profile.key });
+ });
return _.filter(inactiveProfiles, function (profile) {
return profile.lang === lang;
});
},
- serializeData: function () {
- var params = this.options.rule.get('params');
+ serializeData () {
+ let params = this.options.rule.get('params');
if (this.model != null) {
- var modelParams = this.model.get('params');
+ const modelParams = this.model.get('params');
if (_.isArray(modelParams)) {
params = params.map(function (p) {
- var parentParam = _.findWhere(modelParams, { key: p.key });
+ const parentParam = _.findWhere(modelParams, { key: p.key });
if (parentParam != null) {
_.extend(p, { value: parentParam.value });
}
@@ -144,14 +144,14 @@ export default ModalForm.extend({
}
}
- var availableProfiles = this.getAvailableQualityProfiles(this.options.rule.get('lang')),
- contextProfile = this.options.app.state.get('query').qprofile;
+ const availableProfiles = this.getAvailableQualityProfiles(this.options.rule.get('lang'));
+ const contextProfile = this.options.app.state.get('query').qprofile;
return _.extend(ModalForm.prototype.serializeData.apply(this, arguments), {
change: this.model && this.model.has('severity'),
- params: params,
+ params,
qualityProfiles: availableProfiles,
- contextProfile: contextProfile,
+ contextProfile,
severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'],
saveEnabled: !_.isEmpty(availableProfiles) || (this.model && this.model.get('qProfile')),
isCustomRule: (this.model && this.model.has('templateKey')) || this.options.rule.has('templateKey')
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js
index b6d7b78f0b3..80ddf0dd6b2 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js
@@ -48,19 +48,19 @@ export default Marionette.ItemView.extend({
'click @ui.extendDescriptionRemove': 'removeExtendedDescription'
},
- showExtendDescriptionForm: function () {
+ showExtendDescriptionForm () {
this.ui.descriptionExtra.addClass('hidden');
this.ui.extendDescriptionForm.removeClass('hidden');
this.ui.extendDescriptionText.focus();
},
- hideExtendDescriptionForm: function () {
+ hideExtendDescriptionForm () {
this.ui.descriptionExtra.removeClass('hidden');
this.ui.extendDescriptionForm.addClass('hidden');
},
- submitExtendDescription: function () {
- var that = this;
+ submitExtendDescription () {
+ const that = this;
this.ui.extendDescriptionForm.addClass('hidden');
return $.ajax({
type: 'POST',
@@ -81,22 +81,22 @@ export default Marionette.ItemView.extend({
});
},
- removeExtendedDescription: function () {
- var that = this;
+ removeExtendedDescription () {
+ const that = this;
confirmDialog({
html: translate('coding_rules.remove_extended_description.confirm'),
- yesHandler: function () {
+ yesHandler () {
that.ui.extendDescriptionText.val('');
that.submitExtendDescription();
}
});
},
- serializeData: function () {
- var isEditable = this.options.app.canWrite && (this.model.get('isManual') || this.model.get('isCustom'));
+ serializeData () {
+ const isEditable = this.options.app.canWrite && (this.model.get('isManual') || this.model.get('isCustom'));
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
- isEditable: isEditable,
+ isEditable,
canWrite: this.options.app.canWrite
});
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
index 5c37921d9df..2d142bda5e1 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
@@ -21,18 +21,18 @@ import $ from 'jquery';
import RuleFilterView from '../rule-filter-view';
export default {
- onRuleFilterClick: function (e) {
+ onRuleFilterClick (e) {
e.preventDefault();
e.stopPropagation();
$('body').click();
- var that = this,
- popup = new RuleFilterView({
- triggerEl: $(e.currentTarget),
- bottomRight: true,
- model: this.model
- });
+ const that = this;
+ const popup = new RuleFilterView({
+ triggerEl: $(e.currentTarget),
+ bottomRight: true,
+ model: this.model
+ });
popup.on('select', function (property, value) {
- var obj = {};
+ const obj = {};
obj[property] = '' + value;
that.options.app.state.updateFilter(obj);
popup.destroy();
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
index bcb5bd09191..afd73aa6957 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
@@ -25,8 +25,8 @@ import Template from '../templates/rule/coding-rules-rule-issues.hbs';
export default Marionette.ItemView.extend({
template: Template,
- initialize: function () {
- var that = this;
+ initialize () {
+ const that = this;
this.total = null;
this.projects = [];
this.requestIssues().done(function () {
@@ -34,20 +34,20 @@ export default Marionette.ItemView.extend({
});
},
- requestIssues: function () {
- var that = this,
- url = '/api/issues/search',
- options = {
- rules: this.model.id,
- resolved: false,
- ps: 1,
- facets: 'projectUuids'
- };
+ requestIssues () {
+ const that = this;
+ const url = '/api/issues/search';
+ const options = {
+ rules: this.model.id,
+ resolved: false,
+ ps: 1,
+ facets: 'projectUuids'
+ };
return $.get(url, options).done(function (r) {
- var projectsFacet = _.findWhere(r.facets, { property: 'projectUuids' }),
- projects = projectsFacet != null ? projectsFacet.values : [];
+ const projectsFacet = _.findWhere(r.facets, { property: 'projectUuids' });
+ let projects = projectsFacet != null ? projectsFacet.values : [];
projects = projects.map(function (project) {
- var projectBase = _.findWhere(r.components, { uuid: project.val });
+ const projectBase = _.findWhere(r.components, { uuid: project.val });
return _.extend(project, {
name: projectBase != null ? projectBase.longName : ''
});
@@ -57,7 +57,7 @@ export default Marionette.ItemView.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
total: this.total,
projects: this.projects,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
index 129eb7744fb..f8a182a74a8 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
@@ -46,23 +46,23 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
'click .js-rule-filter': 'onRuleFilterClick'
},
- onRender: function () {
+ onRender () {
this.$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
},
- onDestroy: function () {
+ onDestroy () {
this.$('[data-toggle="tooltip"]').tooltip('destroy');
},
- requestTags: function () {
- var url = '/api/rules/tags';
+ requestTags () {
+ const url = '/api/rules/tags';
return $.get(url);
},
- changeTags: function () {
- var that = this;
+ changeTags () {
+ const that = this;
this.requestTags().done(function (r) {
that.ui.tagInput.select2({
tags: _.difference(_.difference(r.tags, that.model.get('tags')), that.model.get('sysTags')),
@@ -76,7 +76,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
});
},
- cancelEdit: function () {
+ cancelEdit () {
this.ui.tagsList.removeClass('hidden');
this.ui.tagsEdit.addClass('hidden');
if (this.ui.tagInput.select2) {
@@ -85,15 +85,15 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
}
},
- editDone: function () {
- var that = this,
- tags = this.ui.tagInput.val();
+ editDone () {
+ const that = this;
+ const tags = this.ui.tagInput.val();
return $.ajax({
type: 'POST',
url: '/api/rules/update',
data: {
key: this.model.get('key'),
- tags: tags
+ tags
}
}).done(function (r) {
that.model.set('tags', r.rule.tags);
@@ -103,7 +103,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite,
subCharacteristic: this.options.app.getSubCharacteristicName(this.model.get('debtSubChar')),
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js
index 3f252636a47..89a66d8ad03 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js
@@ -28,15 +28,15 @@ export default Marionette.ItemView.extend({
'change': 'render'
},
- onRender: function () {
+ onRender () {
this.$el.toggleClass('hidden', _.isEmpty(this.model.get('params')));
},
- serializeData: function () {
- var isEditable = this.options.app.canWrite && (this.model.get('isManual') || this.model.get('isCustom'));
+ serializeData () {
+ const isEditable = this.options.app.canWrite && (this.model.get('isManual') || this.model.get('isCustom'));
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
- isEditable: isEditable,
+ isEditable,
canWrite: this.options.app.canWrite
});
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
index 22ed2b47ad5..e30ed43fd77 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
@@ -46,33 +46,33 @@ export default Marionette.ItemView.extend({
'click @ui.deactivate': 'deactivate'
},
- onRender: function () {
+ onRender () {
this.$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
},
- change: function () {
- var that = this,
- activationView = new ProfileActivationView({
- model: this.model,
- collection: this.model.collection,
- rule: this.options.rule,
- app: this.options.app
- });
+ change () {
+ const that = this;
+ const activationView = new ProfileActivationView({
+ model: this.model,
+ collection: this.model.collection,
+ rule: this.options.rule,
+ app: this.options.app
+ });
activationView.on('profileActivated', function () {
that.options.refreshActives();
});
activationView.render();
},
- revert: function () {
- var that = this,
- ruleKey = this.options.rule.get('key');
+ revert () {
+ const that = this;
+ const ruleKey = this.options.rule.get('key');
confirmDialog({
title: translate('coding_rules.revert_to_parent_definition'),
html: translateWithParameters('coding_rules.revert_to_parent_definition.confirm', this.getParent().name),
- yesHandler: function () {
+ yesHandler () {
return $.ajax({
type: 'POST',
url: '/api/qualityprofiles/activate_rule',
@@ -88,13 +88,13 @@ export default Marionette.ItemView.extend({
});
},
- deactivate: function () {
- var that = this,
- ruleKey = this.options.rule.get('key');
+ deactivate () {
+ const that = this;
+ const ruleKey = this.options.rule.get('key');
confirmDialog({
title: translate('coding_rules.deactivate'),
html: translateWithParameters('coding_rules.deactivate.confirm'),
- yesHandler: function () {
+ yesHandler () {
return $.ajax({
type: 'POST',
url: '/api/qualityprofiles/deactivate_rule',
@@ -109,34 +109,34 @@ export default Marionette.ItemView.extend({
});
},
- enableUpdate: function () {
+ enableUpdate () {
return this.ui.update.prop('disabled', false);
},
- getParent: function () {
+ getParent () {
if (!(this.model.get('inherit') && this.model.get('inherit') !== 'NONE')) {
return null;
}
- var myProfile = _.findWhere(this.options.app.qualityProfiles, {
- key: this.model.get('qProfile')
- }),
- parentKey = myProfile.parentKey,
- parent = _.extend({}, _.findWhere(this.options.app.qualityProfiles, {
- key: parentKey
- })),
- parentActiveInfo = this.model.collection.findWhere({ qProfile: parentKey }) || new Backbone.Model();
+ const myProfile = _.findWhere(this.options.app.qualityProfiles, {
+ key: this.model.get('qProfile')
+ });
+ const parentKey = myProfile.parentKey;
+ const parent = _.extend({}, _.findWhere(this.options.app.qualityProfiles, {
+ key: parentKey
+ }));
+ const parentActiveInfo = this.model.collection.findWhere({ qProfile: parentKey }) || new Backbone.Model();
_.extend(parent, parentActiveInfo.toJSON());
return parent;
},
- enhanceParameters: function () {
- var parent = this.getParent(),
- params = _.sortBy(this.model.get('params'), 'key');
+ enhanceParameters () {
+ const parent = this.getParent();
+ const params = _.sortBy(this.model.get('params'), 'key');
if (!parent) {
return params;
}
return params.map(function (p) {
- var parentParam = _.findWhere(parent.params, { key: p.key });
+ const parentParam = _.findWhere(parent.params, { key: p.key });
if (parentParam != null) {
return _.extend(p, {
original: _.findWhere(parent.params, { key: p.key }).value
@@ -147,7 +147,7 @@ export default Marionette.ItemView.extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite,
parent: this.getParent(),
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js
index 0d18bf216fa..2dda9a223a5 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js
@@ -28,7 +28,7 @@ export default Marionette.CompositeView.extend({
childView: ProfileView,
childViewContainer: '#coding-rules-detail-quality-profiles',
- childViewOptions: function () {
+ childViewOptions () {
return {
app: this.options.app,
rule: this.model,
@@ -44,9 +44,9 @@ export default Marionette.CompositeView.extend({
'click #coding-rules-quality-profile-activate': 'activate'
},
- onRender: function () {
- var isManual = this.model.get('isManual'),
- qualityProfilesVisible = !isManual;
+ onRender () {
+ const isManual = this.model.get('isManual');
+ let qualityProfilesVisible = !isManual;
if (qualityProfilesVisible) {
if (this.model.get('isTemplate')) {
@@ -60,36 +60,36 @@ export default Marionette.CompositeView.extend({
this.$el.toggleClass('hidden', !qualityProfilesVisible);
},
- activate: function () {
- var that = this,
- activationView = new ProfileActivationView({
- rule: this.model,
- collection: this.collection,
- app: this.options.app
- });
+ activate () {
+ const that = this;
+ const activationView = new ProfileActivationView({
+ rule: this.model,
+ collection: this.collection,
+ app: this.options.app
+ });
activationView.on('profileActivated', function (severity, params, profile) {
if (that.options.app.state.get('query').qprofile === profile) {
- var activation = {
- severity: severity,
+ const activation = {
+ severity,
inherit: 'NONE',
- params: params,
+ params,
qProfile: profile
};
- that.model.set({ activation: activation });
+ that.model.set({ activation });
}
that.refreshActives();
});
activationView.render();
},
- refreshActives: function () {
- var that = this;
+ refreshActives () {
+ const that = this;
this.options.app.controller.getRuleDetails(this.model).done(function (data) {
that.collection.reset(that.model.getInactiveProfiles(data.actives, that.options.app.qualityProfiles));
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js
index df9e564de53..1e976b2cbdb 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-header-view.js
@@ -26,7 +26,7 @@ import Template from './templates/coding-rules-workspace-header.hbs';
export default WorkspaceHeaderView.extend({
template: Template,
- events: function () {
+ events () {
return _.extend(WorkspaceHeaderView.prototype.events.apply(this, arguments), {
'click .js-back': 'onBackClick',
'click .js-bulk-change': 'onBulkChangeClick',
@@ -35,11 +35,11 @@ export default WorkspaceHeaderView.extend({
});
},
- onBackClick: function () {
+ onBackClick () {
this.options.app.controller.hideDetails();
},
- onBulkChangeClick: function (e) {
+ onBulkChangeClick (e) {
e.stopPropagation();
$('body').click();
new BulkChangePopup({
@@ -49,15 +49,15 @@ export default WorkspaceHeaderView.extend({
}).render();
},
- reload: function () {
+ reload () {
this.options.app.controller.fetchList(true);
},
- newSearch: function () {
+ newSearch () {
this.options.app.controller.newSearch();
},
- serializeData: function () {
+ serializeData () {
return _.extend(WorkspaceHeaderView.prototype.serializeData.apply(this, arguments), {
canWrite: this.options.app.canWrite
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js
index 3048fe8925a..57df8c95027 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js
@@ -23,7 +23,7 @@ import { translate } from '../../helpers/l10n';
export default Marionette.ItemView.extend({
className: 'search-navigator-no-results',
- template: function () {
+ template () {
return translate('coding_rules.no_results');
}
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js
index 8a87b4e951c..86e26521d02 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js
@@ -46,45 +46,45 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({
'click .coding-rules-detail-quality-profile-deactivate': 'deactivate'
},
- selectCurrent: function () {
+ selectCurrent () {
this.options.app.state.set({ selectedIndex: this.model.get('index') });
},
- openRule: function () {
+ openRule () {
this.options.app.controller.showDetails(this.model);
},
- activate: function () {
- var that = this,
- selectedProfile = this.options.app.state.get('query').qprofile,
- othersQualityProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
- return profile.key === selectedProfile;
- }),
- activationView = new ProfileActivationView({
- rule: this.model,
- collection: new Backbone.Collection(othersQualityProfiles),
- app: this.options.app
- });
+ activate () {
+ const that = this;
+ const selectedProfile = this.options.app.state.get('query').qprofile;
+ const othersQualityProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
+ return profile.key === selectedProfile;
+ });
+ const activationView = new ProfileActivationView({
+ rule: this.model,
+ collection: new Backbone.Collection(othersQualityProfiles),
+ app: this.options.app
+ });
activationView.on('profileActivated', function (severity, params, profile) {
- var activation = {
- severity: severity,
+ const activation = {
+ severity,
inherit: 'NONE',
- params: params,
+ params,
qProfile: profile
};
- that.model.set({ activation: activation });
+ that.model.set({ activation });
});
activationView.render();
},
- deactivate: function () {
- var that = this,
- ruleKey = this.model.get('key'),
- activation = this.model.get('activation');
+ deactivate () {
+ const that = this;
+ const ruleKey = this.model.get('key');
+ const activation = this.model.get('activation');
confirmDialog({
title: translate('coding_rules.deactivate'),
html: translateWithParameters('coding_rules.deactivate.confirm'),
- yesHandler: function () {
+ yesHandler () {
return $.ajax({
type: 'POST',
url: '/api/qualityprofiles/deactivate_rule',
@@ -99,7 +99,7 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({
});
},
- serializeData: function () {
+ serializeData () {
return _.extend(WorkspaceListItemView.prototype.serializeData.apply(this, arguments), {
tags: _.union(this.model.get('sysTags'), this.model.get('tags')),
canWrite: this.options.app.canWrite,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
index 5d25dfd3ee4..ebcaada5b0d 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
@@ -28,9 +28,9 @@ export default WorkspaceListView.extend({
childViewContainer: '.js-list',
emptyView: WorkspaceListEmptyView,
- bindShortcuts: function () {
+ bindShortcuts () {
WorkspaceListView.prototype.bindShortcuts.apply(this, arguments);
- var that = this;
+ const that = this;
key('right', 'list', function () {
that.options.app.controller.showDetailsForSelected();
return false;