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/entity.js | |
parent | 49e5555b11d0bee814bce807acacbfeb381379f1 (diff) | |
download | freeipa-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.gz freeipa-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.xz freeipa-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/entity.js')
-rw-r--r-- | install/ui/entity.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/install/ui/entity.js b/install/ui/entity.js index a701009a3..acfc9c440 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -72,8 +72,7 @@ IPA.entity = function(spec) { }; that.get_containing_entity = function() { - return that.containing_entity ? - IPA.get_entity(that.containing_entity) : null; + return that.containing_entity; }; that.get_dialog = function(name) { @@ -93,7 +92,7 @@ IPA.entity = function(spec) { }; that.dialog = function(dialog) { - dialog.entity_name = that.name; + dialog.entity = that; that.dialogs.put(dialog.name, dialog); return that; }; @@ -143,7 +142,6 @@ IPA.entity = function(spec) { }; that.add_facet = function(facet) { - facet.entity_name = that.name; facet.entity = that; that.facets.put(facet.name, facet); @@ -321,6 +319,7 @@ IPA.entity_builder = function() { } else { spec = { name: spec }; } + spec.builder = that; entity = factory(spec); @@ -495,7 +494,7 @@ IPA.entity_builder = function() { that.containing_entity = function(entity_name) { add_redirect_info(); - entity.containing_entity = entity_name; + entity.containing_entity = IPA.get_entity(entity_name); return that; }; |