diff --git a/install/ui/aci.js b/install/ui/aci.js index 02e03f309..ec3c8065b 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -52,7 +52,8 @@ IPA.aci.permission_entity = function(spec) { { type: 'select', name: 'target', - widget: 'target.target' + widget: 'target.target', + enabled: false }, { name: 'filter', @@ -62,7 +63,8 @@ IPA.aci.permission_entity = function(spec) { { type: 'entity_select', name: 'memberof', - widget: 'target.memberof' + widget: 'target.memberof', + enabled: false }, { name: 'subtree', @@ -85,6 +87,13 @@ IPA.aci.permission_entity = function(spec) { name: 'attrs', widget: 'target.attrs', enabled: false + }, + { + name: 'attrs_multi', + param: 'attrs', + type: 'multivalued', + widget: 'target.attrs_multi', + enabled: false } ], widgets: [ @@ -139,7 +148,8 @@ IPA.aci.permission_entity = function(spec) { { type: 'select', name: 'target', - widget: 'target.target' + widget: 'target.target', + enabled: false }, { name: 'filter', @@ -149,7 +159,8 @@ IPA.aci.permission_entity = function(spec) { { type: 'entity_select', name: 'memberof', - widget: 'target.memberof' + widget: 'target.memberof', + enabled: false }, { name: 'subtree', @@ -172,6 +183,13 @@ IPA.aci.permission_entity = function(spec) { name: 'attrs', widget: 'target.attrs', enabled: false + }, + { + name: 'attrs_multi', + type: 'multivalued', + param: 'attrs', + widget: 'target.attrs_multi', + enabled: false } ], widgets: [ @@ -702,6 +720,14 @@ IPA.permission_target_widget = function(spec) { }); that.widgets.add_widget(that.attribute_table); + + that.attribute_multivalued = IPA.multivalued_widget({ + entity: that.entity, + name: 'attrs_multi', + hidden: true + }); + + that.widgets.add_widget(that.attribute_multivalued); }; init(); @@ -725,34 +751,41 @@ IPA.permission_target_policy = function (widget_name) { }); var type_select = widgets.get_widget('type'); - var attribute_table = widgets.get_widget('attrs'); - var attribute_field = that.container.fields.get_field('attrs'); + type_select.value_changed.attach(function() { var type = type_select.save()[0]; - attribute_table.object_type = type; - attribute_field.reset(); + that.set_attrs_type(type); }); }; + that.set_attrs_type = function(type) { + var attribute_field = that.container.fields.get_field('attrs'); + var attribute_table = that.permission_target.widgets.get_widget('attrs'); + attribute_table.object_type = type; + attribute_field.reset(); + }; + that.post_create = function() { that.select_target(that.permission_target.targets[0]); }; that.post_load = function(data) { - var targets = that.permission_target.targets; + var displayed_target; - that.set_target_visible_core('memberof', false); + for (var target in that.target_mapping) { - for (var i=0; i 2, @@ -252,7 +261,7 @@ test("Testing filter target.", function() { same(target_widget.target, 'filter', 'filter selected'); - same(get_visible_rows(target_widget), ['filter'], 'filter row visible'); + same(get_visible_rows(target_widget), ['filter', 'attrs_multi'], 'filter row visible'); ok(record.filter[0], data.result.result.filter, 'filter set correctly'); }); diff --git a/install/ui/widget.js b/install/ui/widget.js index a54c9b826..642d3250d 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -436,7 +436,7 @@ IPA.multivalued_widget = function(spec) { row.widget = that.widget_factory({ name: that.name+'-'+row_index, - undo: that.undo, + undo: that.undo || row.is_new, read_only: that.read_only, writable: that.writable });