diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-06-01 13:52:38 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-02 20:09:07 -0400 |
commit | 34c5d996d760abeaede782253931ed7bc36320cc (patch) | |
tree | 27d4556fbafab47fb40f0f893d28f784d7cf6410 /install/ui/associate.js | |
parent | 7486a332211ed13318c0a689657cb4ff7e7d25a3 (diff) | |
download | freeipa.git-34c5d996d760abeaede782253931ed7bc36320cc.tar.gz freeipa.git-34c5d996d760abeaede782253931ed7bc36320cc.tar.xz freeipa.git-34c5d996d760abeaede782253931ed7bc36320cc.zip |
Temporary fix for indirect member tabs.
Since the group-show command doesn't return indirect members, the tabs
for group's indirect members have been reverted to call user-find with
the --in-groups parameter to get the entries.
However, this is only a temporary solution since the user-find command
returns both direct and indirect members (ticket #1273).
The Selenium test for groups has been modified to test nested groups
and verify indirect members. The verification currently will fail due
to the above issue.
Diffstat (limited to 'install/ui/associate.js')
-rw-r--r-- | install/ui/associate.js | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js index eb4a5a05..f7ac1505 100644 --- a/install/ui/associate.js +++ b/install/ui/associate.js @@ -707,7 +707,7 @@ IPA.association_facet = function (spec) { that.columns = $.ordered_map(); that.adder_columns = $.ordered_map(); - that.page_length = 20; + that.page_length = spec.page_length === undefined ? 20 : spec.page_length; that.get_column = function(name) { return that.columns.get(name); @@ -1107,21 +1107,62 @@ IPA.association_facet = function (spec) { return that; }; +IPA.indirect_association_facet = function (spec) { -IPA.deleter_dialog_setup = function () { + spec = spec || {}; - var that = this; + spec.page_length = 0; + spec.read_only = true; - var ul = $('<ul/>'); - ul.appendTo(that.dialog); + var that = IPA.association_facet(spec); - for (var i=0; i<that.values.length; i++) { - $('<li/>',{ - 'text': that.values[i] - }).appendTo(ul); - } + 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 + }); - $('<p/>', { - 'text': IPA.messages.search.delete_confirm - }).appendTo(that.dialog); + command.execute(); + }; + + return that; }; |