aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/groups
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-29 11:37:28 +0100
committerGitHub <noreply@github.com>2016-12-29 11:37:28 +0100
commitc85948205409283fa7dec4ab1db9764acc0d3ce9 (patch)
treeb4fbd692e4ce6cc93ccf417173242398adecf9c1 /server/sonar-web/src/main/js/apps/groups
parent5595c2f862cca1d07312c9219013f836e45a5f90 (diff)
downloadsonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.tar.gz
sonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.zip
remove explicit _ and $ dependecies (#1487)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/groups')
-rw-r--r--server/sonar-web/src/main/js/apps/groups/group.js16
-rw-r--r--server/sonar-web/src/main/js/apps/groups/list-footer-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/groups/search-view.js4
3 files changed, 15 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/groups/group.js b/server/sonar-web/src/main/js/apps/groups/group.js
index bb025e4cb74..f7664f234e4 100644
--- a/server/sonar-web/src/main/js/apps/groups/group.js
+++ b/server/sonar-web/src/main/js/apps/groups/group.js
@@ -17,7 +17,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import _ from 'underscore';
+import defaults from 'lodash/defaults';
+import pick from 'lodash/pick';
import Backbone from 'backbone';
export default Backbone.Model.extend({
@@ -28,22 +29,25 @@ export default Backbone.Model.extend({
sync (method, model, options) {
const opts = options || {};
if (method === 'create') {
- _.defaults(opts, {
+ defaults(opts, {
url: this.urlRoot() + '/create',
type: 'POST',
- data: _.pick(model.toJSON(), 'name', 'description')
+ data: pick(model.toJSON(), 'name', 'description')
});
}
if (method === 'update') {
- const attrs = _.extend(_.pick(model.changed, 'name', 'description'), { id: model.id });
- _.defaults(opts, {
+ const attrs = {
+ ...pick(model.changed, 'name', 'description'),
+ id: model.id
+ };
+ defaults(opts, {
url: this.urlRoot() + '/update',
type: 'POST',
data: attrs
});
}
if (method === 'delete') {
- _.defaults(opts, {
+ defaults(opts, {
url: this.urlRoot() + '/delete',
type: 'POST',
data: { id: this.id }
diff --git a/server/sonar-web/src/main/js/apps/groups/list-footer-view.js b/server/sonar-web/src/main/js/apps/groups/list-footer-view.js
index 035b768470f..2a47a873b39 100644
--- a/server/sonar-web/src/main/js/apps/groups/list-footer-view.js
+++ b/server/sonar-web/src/main/js/apps/groups/list-footer-view.js
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import _ from 'underscore';
import Marionette from 'backbone.marionette';
import Template from './templates/groups-list-footer.hbs';
@@ -42,11 +41,12 @@ export default Marionette.ItemView.extend({
},
serializeData () {
- return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
+ return {
+ ...Marionette.ItemView.prototype.serializeData.apply(this, arguments),
total: this.collection.total,
count: this.collection.length,
more: this.collection.hasMore()
- });
+ };
}
});
diff --git a/server/sonar-web/src/main/js/apps/groups/search-view.js b/server/sonar-web/src/main/js/apps/groups/search-view.js
index b77b32a24cf..26977b8c259 100644
--- a/server/sonar-web/src/main/js/apps/groups/search-view.js
+++ b/server/sonar-web/src/main/js/apps/groups/search-view.js
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import _ from 'underscore';
+import debounce from 'lodash/debounce';
import Marionette from 'backbone.marionette';
import Template from './templates/groups-search.hbs';
@@ -32,7 +32,7 @@ export default Marionette.ItemView.extend({
initialize () {
this._bufferedValue = null;
- this.debouncedOnKeyUp = _.debounce(this.onKeyUp, 400);
+ this.debouncedOnKeyUp = debounce(this.onKeyUp, 400);
},
onRender () {