mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Refactored builder interface.
The IPA.entity_builder has been modified to take a 'factory' parameter in custom facet's and custom dialog's spec. The IPA.dialog has been modified to take an array of fields in the spec. The IPA.search_facet has been modified to take an array of columns in the spec.
This commit is contained in:
committed by
Endi Sukma Dewata
parent
f0f83a862e
commit
689fd30b52
@@ -265,6 +265,25 @@ IPA.dialog = function(spec) {
|
||||
that.dialog_setup = that.setup;
|
||||
that.dialog_open = that.open;
|
||||
|
||||
var fields = spec.fields || [];
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
var field_spec = fields[i];
|
||||
var field;
|
||||
|
||||
if (field_spec instanceof Object) {
|
||||
if (field_spec.factory) {
|
||||
field = field_spec.factory(field_spec);
|
||||
} else {
|
||||
field = IPA.text_widget(field_spec);
|
||||
}
|
||||
} else {
|
||||
var field_name = field_spec;
|
||||
field = IPA.text_widget({ name: field_name, undo: false });
|
||||
}
|
||||
|
||||
that.add_field(field);
|
||||
}
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user