diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-02-02 16:18:35 -0600 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-02-03 20:09:15 -0500 |
commit | bd493d47a736fab4e74efbe9b603dcc8f1986512 (patch) | |
tree | 00f21fb46a747c8ef3219773b2d669c9b1d76f7f /install/ui/test/details_tests.js | |
parent | ff646ec3a428647cac8fa9304a5695c7f29456a2 (diff) | |
download | freeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.tar.gz freeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.tar.xz freeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.zip |
Added multi-valued text widget.
A multi-valued text widget has been created to replace the old
IPA.details_field. The old code was designed to handle all data
types, and it uses one <dd> tag for each value, so the code is
still incomplete and complex. The new code was designed to handle
only multi-valued text attributes, and it uses one <dd> tag for
all values, so it's easier to maintain. There are already other
widgets that can be used to handle other data types.
The new code supports line-level undo and line-out for removal
like the old code, but there are some changes:
- Undoing a newly added line will remove the entire line.
- Editing the value of a removed line will cancel the removal.
- It provides 'undo all' link to reset the entire attribute.
The old code will be cleaned up in a subsequent patch.
Diffstat (limited to 'install/ui/test/details_tests.js')
-rw-r--r-- | install/ui/test/details_tests.js | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js index fb33808c7..cf4de0825 100644 --- a/install/ui/test/details_tests.js +++ b/install/ui/test/details_tests.js @@ -21,12 +21,24 @@ module('details', { setup: function() { + IPA.ajax_options.async = false; + + IPA.init( + "data", + true, + function(data, text_status, xhr) { + }, + function(xhr, text_status, error_thrown) { + ok(false, "ipa_init() failed: "+error_thrown); + } + ); + var obj_name = 'user'; IPA.entity_factories.user= function(){ return IPA.entity({name:obj_name}); }; - IPA.start_entities(); + IPA.start_entities(); }, teardown: function() { } @@ -35,24 +47,13 @@ module('details', { test("Testing IPA.details_section.create().", function() { - IPA.ajax_options.async = false; - - IPA.init( - "data", - true, - function(data, text_status, xhr) { - ok(true, "ipa_init() succeeded."); - }, - function(xhr, text_status, error_thrown) { - ok(false, "ipa_init() failed: "+error_thrown); - } - ); - var section = IPA.stanza({name:'IDIDID', label:'NAMENAMENAME'}). input({name:'cn'}). - input({name:'description'}). - input({name:'number'}); + input({name:'uid'}). + input({name:'mail'}); + section.entity_name = 'user'; + section.init(); var fields = section.fields; var container = $("<div/>"); @@ -105,19 +106,6 @@ test("Testing IPA.details_section.create().", function() { test("Testing details lifecycle: create, setup, load.", function(){ - IPA.ajax_options.async = false; - - IPA.init( - "data", - true, - function(data, text_status, xhr) { - ok(true, "ipa_init() succeeded."); - }, - function(xhr, text_status, error_thrown) { - ok(false, "ipa_init() failed: "+error_thrown); - } - ); - var result = {}; IPA.cmd( |