diff --git a/bower.json b/bower.json index e6539fe8d..911996f26 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,7 @@ "js-data": "~2.9.0", "js-data-angular": "~3.2.1", "jsen": "~0.6.1", - "lodash": "~3.10.0", + "lodash": "~4.16.0", "ng-dialog": "~0.6.4", "ng-file-upload": "~11.2.3", "ngBootbox": "~0.1.3", diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 6cc5693fe..3f451bbd2 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -1607,37 +1607,13 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid } }); - // TODO (Issue #2293): - // fix _.uniqWith(importedXXX, _.isEqual); - // (You need lodash version >= 4.0.0) - - // unique users - var importedUsersUnique = []; - importedUsers.forEach(function (u1) { - var unique = true; - importedUsersUnique.forEach(function (u2) { - if (u1.first_name == u2.first_name && - u1.last_name == u2.last_name) { - unique = false; - } - }); - if (unique) { - importedUsersUnique.push(u1); - } + // unique users and categories + var importedUsersUnique = _.uniqWith(importedUsers, function (u1, u2) { + return u1.first_name == u2.first_name && + u1.last_name == u2.last_name; }); - - // unique categories - var importedCategoriesUnique = []; - importedCategories.forEach(function (c1) { - var unique = true; - importedCategoriesUnique.forEach(function (c2) { - if (c1.name == c2.name) { - unique = false; - } - }); - if (unique) { - importedCategoriesUnique.push(c1); - } + var importedCategoriesUnique = _.uniqWith(importedCategories, function (c1, c2) { + return c1.name == c2.name; }); // Promises for users and categories diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index fe2eaf8c3..88337768b 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -189,7 +189,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) link: function($scope, $element, $attr, ctrl, $transclude) { var block, childScope, previousElements, perms; if ($attr.osPerms[0] === '!') { - perms = _.trimLeft($attr.osPerms, '!'); + perms = _.trimStart($attr.osPerms, '!'); } else { perms = $attr.osPerms; }