Limit members editor and memberships editor to 1000 entrires

(closes #3737)
This commit is contained in:
Bryan Housel
2017-04-26 01:15:16 -04:00
parent fb4c64bf70
commit ba97dde0f2
2 changed files with 7 additions and 4 deletions

View File

@@ -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)

View File

@@ -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)