summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-12-15 13:40:29 +0100
committerEndi S. Dewata <edewata@redhat.com>2011-12-15 19:59:57 +0000
commit187bedafd0e261661c6368b6df90eb9d31ef9ceb (patch)
tree959f57ae298f8a8c85ddf6407ee22f1974a4790d /install
parentcb649f2de2f0399ca02adb14684109ef12a55d52 (diff)
downloadfreeipa.git-187bedafd0e261661c6368b6df90eb9d31ef9ceb.tar.gz
freeipa.git-187bedafd0e261661c6368b6df90eb9d31ef9ceb.tar.xz
freeipa.git-187bedafd0e261661c6368b6df90eb9d31ef9ceb.zip
Fixed displaying of external records in rule association widgets
It's a fix for regression introduced by widget refactoring #2040. https://fedorahosted.org/freeipa/ticket/2040
Diffstat (limited to 'install')
-rw-r--r--install/ui/association.js60
-rw-r--r--install/ui/rule.js6
-rw-r--r--install/ui/sudo.js4
3 files changed, 51 insertions, 19 deletions
diff --git a/install/ui/association.js b/install/ui/association.js
index 9d7950dc..708b2372 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -305,6 +305,8 @@ IPA.association_table_widget = function (spec) {
that.adder_columns = $.ordered_map();
+ that.needs_refresh = IPA.observer();
+
that.get_adder_column = function(name) {
return that.adder_columns.get(name);
};
@@ -644,24 +646,7 @@ IPA.association_table_widget = function (spec) {
that.refresh = function() {
- function on_success(data, text_status, xhr) {
- that.load(data.result.result);
- }
-
- function on_error(xhr, text_status, error_thrown) {
- var summary = $('span[name=summary]', that.tfoot).empty();
- summary.append(error_thrown.name+': '+error_thrown.message);
- }
-
- var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
- IPA.command({
- entity: that.entity.name,
- method: 'show',
- args: [pkey],
- options: { all: true, rights: true },
- on_success: on_success,
- on_error: on_error
- }).execute();
+ that.needs_refresh.notify([], that);
};
/*initialization code*/
@@ -687,6 +672,45 @@ IPA.association_table_widget = function (spec) {
return that;
};
+IPA.association_table_field = function (spec) {
+
+ spec = spec || {};
+
+ var that = IPA.field(spec);
+
+ that.refresh = function() {
+
+ function on_success(data, text_status, xhr) {
+ that.load(data.result.result);
+ }
+
+ function on_error(xhr, text_status, error_thrown) {
+ that.widget.summary.text(error_thrown.name+': '+error_thrown.message);
+ }
+
+ var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
+ IPA.command({
+ entity: that.entity.name,
+ method: 'show',
+ args: [pkey],
+ options: { all: true, rights: true },
+ on_success: on_success,
+ on_error: on_error
+ }).execute();
+ };
+
+ that.widgets_created = function() {
+
+ that.field_widgets_created();
+ that.widget.needs_refresh.attach(that.refresh);
+ };
+
+ return that;
+};
+
+IPA.widget_factories['association_table'] = IPA.association_table_widget;
+IPA.field_factories['association_table'] = IPA.association_table_field;
+
IPA.association_facet = function (spec) {
diff --git a/install/ui/rule.js b/install/ui/rule.js
index 003785bc..d36cd3d3 100644
--- a/install/ui/rule.js
+++ b/install/ui/rule.js
@@ -134,10 +134,14 @@ IPA.rule_association_table_field = function(spec) {
spec = spec || {};
- var that = IPA.field(spec);
+ var that = IPA.association_table_field(spec);
+
+ that.external = spec.external;
+
that.load = function(result) {
that.values = result[that.name] || [];
+
if (that.external) {
var external_values = result[that.external] || [];
$.merge(that.values, external_values);
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 5e1dedc7..99146182 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -278,6 +278,7 @@ IPA.sudorule_details_facet = function(spec) {
type: 'rule_association_table',
name: 'memberuser_user',
widget: 'user.rule.memberuser_user',
+ external: 'externaluser',
priority: IPA.sudo.remove_method_priority
},
{
@@ -352,6 +353,7 @@ IPA.sudorule_details_facet = function(spec) {
type: 'rule_association_table',
name: 'memberhost_host',
widget: 'host.rule.memberhost_host',
+ external: 'externalhost',
priority: IPA.sudo.remove_method_priority
},
{
@@ -541,6 +543,7 @@ IPA.sudorule_details_facet = function(spec) {
type: 'rule_association_table',
name: 'ipasudorunas_user',
widget: 'runas.runas_users.ipasudorunas_user',
+ external: 'ipasudorunasextuser',
priority: IPA.sudo.remove_method_priority
},
{
@@ -558,6 +561,7 @@ IPA.sudorule_details_facet = function(spec) {
type: 'rule_association_table',
name: 'ipasudorunasgroup_group',
widget: 'runas.runas_groups.ipasudorunasgroup_group',
+ external: 'ipasudorunasextgroup',
priority: IPA.sudo.remove_method_priority
}
);