From caa9d52666e5beb7321dc6c80820eeacca356077 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Fri, 18 Nov 2011 19:47:39 -0600 Subject: Refactored facet.load(). The load() in IPA.facet has been modified to accept the complete data returned by the server instead of just the result. This is needed by HBAC Test to access other attributes returned in the test result. Ticket #388 --- install/ui/automount.js | 58 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 18 deletions(-) (limited to 'install/ui/automount.js') diff --git a/install/ui/automount.js b/install/ui/automount.js index 8db08e38..6c0f64ff 100644 --- a/install/ui/automount.js +++ b/install/ui/automount.js @@ -160,6 +160,7 @@ IPA.automount.key_entity = function(spec) { that.builder.containing_entity('automountmap'). details_facet({ + factory: IPA.automount.key_details_facet, sections: [ { name:'identity', @@ -173,24 +174,7 @@ IPA.automount.key_entity = function(spec) { ] } ], - disable_breadcrumb: false, - pre_execute_hook : function (command){ - var entity_name = this.entity_name; - var info = IPA.nav.get_state(entity_name + '-info'); - var key = IPA.nav.get_state(entity_name + '-pkey'); - - - if (command.args.length ==3){ - command.args.pop(); - } - if (command.method === 'mod'){ - command.options['newautomountinformation'] = - command.options['automountinformation']; - - } - command.options['automountkey'] = key; - command.options['automountinformation'] = info; - } + disable_breadcrumb: false }). adder_dialog({ show_edit_page : function(entity, result){ @@ -210,6 +194,44 @@ IPA.automount.key_entity = function(spec) { return that; }; +IPA.automount.key_details_facet = function(spec) { + + var that = IPA.details_facet(spec); + + that.create_update_command = function() { + + var command = that.details_facet_create_update_command(); + + command.args.pop(); + + var key = IPA.nav.get_state(that.entity.name + '-pkey'); + var info = IPA.nav.get_state(that.entity.name + '-info'); + + command.options.newautomountinformation = command.options.automountinformation; + command.options.automountkey = key; + command.options.automountinformation = info; + + return command; + }; + + that.create_refresh_command = function() { + + var command = that.details_facet_create_refresh_command(); + + command.args.pop(); + + var key = IPA.nav.get_state(that.entity.name + '-pkey'); + var info = IPA.nav.get_state(that.entity.name + '-info'); + + command.options.automountkey = key; + command.options.automountinformation = info; + + return command; + }; + + return that; +}; + IPA.automount_key_column = function(spec) { var that = IPA.column(spec); -- cgit