Updating lodash (fixes #2293)
This commit is contained in:
parent
8770395274
commit
ceb9e70f6e
@ -26,7 +26,7 @@
|
|||||||
"js-data": "~2.9.0",
|
"js-data": "~2.9.0",
|
||||||
"js-data-angular": "~3.2.1",
|
"js-data-angular": "~3.2.1",
|
||||||
"jsen": "~0.6.1",
|
"jsen": "~0.6.1",
|
||||||
"lodash": "~3.10.0",
|
"lodash": "~4.16.0",
|
||||||
"ng-dialog": "~0.6.4",
|
"ng-dialog": "~0.6.4",
|
||||||
"ng-file-upload": "~11.2.3",
|
"ng-file-upload": "~11.2.3",
|
||||||
"ngBootbox": "~0.1.3",
|
"ngBootbox": "~0.1.3",
|
||||||
|
@ -1607,37 +1607,13 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO (Issue #2293):
|
// unique users and categories
|
||||||
// fix _.uniqWith(importedXXX, _.isEqual);
|
var importedUsersUnique = _.uniqWith(importedUsers, function (u1, u2) {
|
||||||
// (You need lodash version >= 4.0.0)
|
return u1.first_name == u2.first_name &&
|
||||||
|
u1.last_name == u2.last_name;
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
var importedCategoriesUnique = _.uniqWith(importedCategories, function (c1, c2) {
|
||||||
// unique categories
|
return c1.name == c2.name;
|
||||||
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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Promises for users and categories
|
// Promises for users and categories
|
||||||
|
@ -189,7 +189,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
link: function($scope, $element, $attr, ctrl, $transclude) {
|
link: function($scope, $element, $attr, ctrl, $transclude) {
|
||||||
var block, childScope, previousElements, perms;
|
var block, childScope, previousElements, perms;
|
||||||
if ($attr.osPerms[0] === '!') {
|
if ($attr.osPerms[0] === '!') {
|
||||||
perms = _.trimLeft($attr.osPerms, '!');
|
perms = _.trimStart($attr.osPerms, '!');
|
||||||
} else {
|
} else {
|
||||||
perms = $attr.osPerms;
|
perms = $attr.osPerms;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user