mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Limit members editor and memberships editor to 1000 entrires
(closes #3737)
This commit is contained in:
@@ -51,7 +51,7 @@ export function uiRawMemberEditor(context) {
|
||||
var entity = context.entity(id),
|
||||
memberships = [];
|
||||
|
||||
entity.members.forEach(function(member, index) {
|
||||
entity.members.slice(0, 1000).forEach(function(member, index) {
|
||||
memberships.push({
|
||||
index: index,
|
||||
id: member.id,
|
||||
@@ -62,8 +62,9 @@ export function uiRawMemberEditor(context) {
|
||||
});
|
||||
});
|
||||
|
||||
var gt = entity.members.length > 1000 ? '>' : '';
|
||||
selection.call(uiDisclosure()
|
||||
.title(t('inspector.all_members') + ' (' + memberships.length + ')')
|
||||
.title(t('inspector.all_members') + ' (' + gt + memberships.length + ')')
|
||||
.expanded(true)
|
||||
.on('toggled', toggled)
|
||||
.content(content)
|
||||
|
||||
@@ -117,9 +117,10 @@ export function uiRawMembershipEditor(context) {
|
||||
|
||||
function rawMembershipEditor(selection) {
|
||||
var entity = context.entity(id),
|
||||
parents = context.graph().parentRelations(entity),
|
||||
memberships = [];
|
||||
|
||||
context.graph().parentRelations(entity).forEach(function(relation) {
|
||||
parents.slice(0, 1000).forEach(function(relation) {
|
||||
relation.members.forEach(function(member, index) {
|
||||
if (member.id === entity.id) {
|
||||
memberships.push({ relation: relation, member: member, index: index });
|
||||
@@ -127,8 +128,9 @@ export function uiRawMembershipEditor(context) {
|
||||
});
|
||||
});
|
||||
|
||||
var gt = parents.length > 1000 ? '>' : '';
|
||||
selection.call(uiDisclosure()
|
||||
.title(t('inspector.all_relations') + ' (' + memberships.length + ')')
|
||||
.title(t('inspector.all_relations') + ' (' + gt + memberships.length + ')')
|
||||
.expanded(true)
|
||||
.on('toggled', toggled)
|
||||
.content(content)
|
||||
|
||||
Reference in New Issue
Block a user