From 8ca348b99e350862418ac2fe0addfb0e354ea57e Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 2 Nov 2011 14:07:07 -0500 Subject: Added extensible UI framework. The entity definitions have been converted into classes. The entity init() method will use the builder to construct the facets and dialogs. The UI can be customized by creating a subclass of the original entity in extension.js and then overriding the init() method. Ticket #2043 --- install/ui/user.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'install/ui/user.js') diff --git a/install/ui/user.js b/install/ui/user.js index 8e220568..8207bf09 100644 --- a/install/ui/user.js +++ b/install/ui/user.js @@ -23,19 +23,20 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */ +IPA.user = {}; -IPA.entity_factories.user = function() { +IPA.user.entity = function(spec) { + + var that = IPA.entity(spec); var link = true; if (IPA.nav && IPA.nav.name == 'self-service') { link = false; } - var builder = IPA.entity_builder(); + that.init = function(params) { - builder. - entity('user'). - search_facet({ + params.builder.search_facet({ columns: [ 'uid', 'givenname', @@ -105,7 +106,8 @@ IPA.entity_factories.user = function() { { name: 'misc', fields: ['carlicense'] - }]}). + }] + }). association_facet({ name: 'memberof_group', associator: IPA.serial_associator, @@ -167,8 +169,9 @@ IPA.entity_factories.user = function() { } ] }); + }; - return builder.build(); + return that; }; IPA.user_adder_dialog = function(spec) { @@ -461,3 +464,5 @@ IPA.user_password_widget = function(spec) { return that; }; + +IPA.register('user', IPA.user.entity); -- cgit