Merge pull request #2411 from FinnStutzenstein/Issue2293
Updating lodash (fixes #2293)
This commit is contained in:
commit
349a078f20
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user