diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-11-07 14:21:45 -0600 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2011-12-21 14:59:49 +0100 |
commit | 5fc064f13e44812042a617a322bcd6111d2b39b2 (patch) | |
tree | f89503069c5d4eabbb940aff34b9733607ce93d2 /install/ui/rule.js | |
parent | 49e5555b11d0bee814bce807acacbfeb381379f1 (diff) | |
download | freeipa.git-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.gz freeipa.git-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.xz freeipa.git-5fc064f13e44812042a617a322bcd6111d2b39b2.zip |
Refactored entity object resolution.
The IPA.get_entity() has been modified to accept either entity name
or entity object. If it receives an entity object it will return
the object itself. Otherwise, it will resolve the name in the entity
registry.
The other_entity variables have been modified to store a reference
to the entity object instead of its name. The test cases have been
modified to use real entity objects instead of just the names.
Ticket #2042
Diffstat (limited to 'install/ui/rule.js')
-rw-r--r-- | install/ui/rule.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/install/ui/rule.js b/install/ui/rule.js index ab2e234d..e8be46ac 100644 --- a/install/ui/rule.js +++ b/install/ui/rule.js @@ -121,7 +121,7 @@ IPA.rule_association_table_widget = function(spec) { that.create_column({ name: that.external, label: IPA.messages.objects.sudorule.external, - entity_name: that.other_entity, + entity: that.other_entity, format: IPA.boolean_format, width: '200px' }); @@ -133,7 +133,7 @@ IPA.rule_association_table_widget = function(spec) { var entity_label = that.entity.metadata.label_singular; var pkey = IPA.nav.get_state(that.entity.name+'-pkey'); - var other_entity_label = IPA.metadata.objects[that.other_entity].label; + var other_entity_label = that.other_entity.metadata.label; var title = that.add_title; title = title.replace('${entity}', entity_label); @@ -213,7 +213,7 @@ IPA.rule_association_table_field = function(spec) { options: {all: true, rights: true} }); - command.set_option(that.widget.other_entity, values.join(',')); + command.set_option(that.widget.other_entity.name, values.join(',')); update_info.append_command(command, that.priority); } } @@ -240,7 +240,7 @@ IPA.rule_association_adder_dialog = function(spec) { that.selected_table.add_rows(rows); if (that.external) { - var pkey_name = IPA.metadata.objects[that.other_entity].primary_key; + var pkey_name = that.other_entity.metadata.primary_key; var value = that.external_field.val(); if (!value) return; |