mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed paging for indirect members.
Since ticket #1273 has been fixed, the indirect members can be shown using the regular association facet which supports paging.
This commit is contained in:
committed by
Adam Young
parent
17dccbdecc
commit
82fbfbd773
@@ -1092,63 +1092,3 @@ IPA.association_facet = function (spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.indirect_association_facet = function (spec) {
|
|
||||||
|
|
||||||
spec = spec || {};
|
|
||||||
|
|
||||||
spec.page_length = 0;
|
|
||||||
spec.read_only = true;
|
|
||||||
|
|
||||||
var that = IPA.association_facet(spec);
|
|
||||||
|
|
||||||
that.refresh = function() {
|
|
||||||
|
|
||||||
function on_success(data, text_status, xhr) {
|
|
||||||
|
|
||||||
that.table.empty();
|
|
||||||
|
|
||||||
var count = data.result.count;
|
|
||||||
if (count === 0) {
|
|
||||||
that.table.summary.text(data.result.summary);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var results = data.result.result;
|
|
||||||
for (var i=0; i<results.length; i++) {
|
|
||||||
var record = results[i];
|
|
||||||
that.table.add_record(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.result.truncated) {
|
|
||||||
var message = IPA.messages.search.truncated;
|
|
||||||
message = message.replace('${counter}', data.result.count);
|
|
||||||
that.table.summary.text(message);
|
|
||||||
} else {
|
|
||||||
that.table.summary.text(data.result.summary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
'all': true
|
|
||||||
};
|
|
||||||
|
|
||||||
var pkey = $.bbq.getState(that.entity_name+'-pkey');
|
|
||||||
|
|
||||||
/* TODO: make a general solution to generate this value */
|
|
||||||
var relationship_filter = 'in_' + that.entity_name;
|
|
||||||
options[relationship_filter] = pkey;
|
|
||||||
|
|
||||||
var command = IPA.command({
|
|
||||||
entity: that.other_entity,
|
|
||||||
method: 'find',
|
|
||||||
options: options,
|
|
||||||
on_success: on_success,
|
|
||||||
on_error: that.on_error
|
|
||||||
});
|
|
||||||
|
|
||||||
command.execute();
|
|
||||||
};
|
|
||||||
|
|
||||||
return that;
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -812,15 +812,7 @@ IPA.entity_builder = function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var factory = spec.factory;
|
var factory = spec.factory || IPA.association_facet;
|
||||||
if (!factory) {
|
|
||||||
if (spec.facet_group == 'memberindirect') {
|
|
||||||
factory = IPA.indirect_association_facet;
|
|
||||||
} else {
|
|
||||||
factory = IPA.association_facet;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
facet = factory(spec);
|
facet = factory(spec);
|
||||||
entity.add_facet(facet);
|
entity.add_facet(facet);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user