[Freeipa-devel] [PATCH] 168 Fixed problem deleting value in text field.

2011-05-27 Thread Endi Sukma Dewata

Previously deleting a value in a text field did not work because
the field is not included in the modify operation when the value
is empty. The details facet's update() method has been modified
to update only dirty fields.

The section lists in details facet and dialog have been converted
into ordered maps.

Ticket #1256

--
Endi S. Dewata
From a099a945d47eea4e93d911f8603042912fcd2dee Mon Sep 17 00:00:00 2001
From: Endi S. Dewata edew...@redhat.com
Date: Fri, 27 May 2011 12:04:20 -0500
Subject: [PATCH] Fixed problem deleting value in text field.

Previously deleting a value in a text field did not work because
the field is not included in the modify operation when the value
is empty. The details facet's update() method has been modified
to update only dirty fields.

The section lists in details facet and dialog have been converted
into ordered maps.

Ticket #1256
---
 install/ui/add.js|5 +-
 install/ui/details.js|  119 --
 install/ui/dialog.js |   36 +++-
 install/ui/hbac.js   |   42 ++---
 install/ui/ipa.js|9 +++
 install/ui/sudo.js   |   35 ++-
 install/ui/test/details_tests.js |   10 ++-
 7 files changed, 143 insertions(+), 113 deletions(-)

diff --git a/install/ui/add.js b/install/ui/add.js
index 0df0db61279016752c44ae04300cf9be9162ce83..73a423f00744394241638acceeb0dfa315af40cf 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -128,8 +128,9 @@ IPA.add_dialog = function (spec) {
 }
 }
 
-for (var j=0; jthat.sections.length; j++) {
-var section = that.sections[j];
+var sections = that.sections.values;
+for (var j=0; jsections.length; j++) {
+var section = sections[j];
 
 var section_fields = section.fields.values;
 for (var k=0; ksection_fields.length; k++) {
diff --git a/install/ui/details.js b/install/ui/details.js
index 4aa864fed7d572a34fc254d205b32700379966e5..fbf2ff52d45e4ffce1069f6029e7836aedfcf5c0 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -269,7 +269,7 @@ IPA.details_facet = function(spec) {
 that.label = (IPA.messages  IPA.messages.facets  IPA.messages.facets.details) || spec.label;
 that.facet_group = spec.facet_group || 'settings';
 
-that.sections = [];
+that.sections = $.ordered_map();
 
 that.__defineGetter__(entity_name, function(){
 return that._entity_name;
@@ -278,14 +278,15 @@ IPA.details_facet = function(spec) {
 that.__defineSetter__(entity_name, function(entity_name){
 that._entity_name = entity_name;
 
-for (var i=0; ithat.sections.length; i++) {
-that.sections[i].entity_name = entity_name;
+var sections = that.sections.values;
+for (var i=0; isections.length; i++) {
+sections[i].entity_name = entity_name;
 }
 });
 
 that.add_section = function(section) {
 section.entity_name = that.entity_name;
-that.sections.push(section);
+that.sections.put(section.name, section);
 return section;
 };
 
@@ -304,8 +305,9 @@ IPA.details_facet = function(spec) {
 
 that.facet_init();
 
-for (var i=0; ithat.sections.length; i++) {
-var section = that.sections[i];
+var sections = that.sections.values;
+for (var i=0; isections.length; i++) {
+var section = sections[i];
 section.init();
 }
 };
@@ -375,8 +377,9 @@ IPA.details_facet = function(spec) {
 that.expand_button.css('display', 'none');
 that.collapse_button.css('display', 'inline');
 
-for (var i=0; ithat.sections.length; i++) {
-var section = that.sections[i];
+var sections = that.sections.values;
+for (var i=0; isections.length; i++) {
+var section = sections[i];
 that.toggle(section, true);
 }
 
@@ -393,8 +396,9 @@ IPA.details_facet = function(spec) {
 that.expand_button.css('display', 'inline');
 that.collapse_button.css('display', 'none');
 
-for (var i=0; ithat.sections.length; i++) {
-var section = that.sections[i];
+var sections = that.sections.values;
+for (var i=0; isections.length; i++) {
+var section = sections[i];
 that.toggle(section, false);
 }
 
@@ -409,8 +413,9 @@ IPA.details_facet = function(spec) {
 'name': 'details'
 }).appendTo(container);
 
-for (var i = 0; i  that.sections.length; ++i) {
-var section = that.sections[i];
+var sections = that.sections.values;
+for (var i=0; isections.length; i++) {
+var section = sections[i];
 
 var header = $('h2/', {
 

Re: [Freeipa-devel] [PATCH] 168 Fixed problem deleting value in text field.

2011-05-27 Thread Adam Young

On 05/27/2011 01:44 PM, Endi Sukma Dewata wrote:

Previously deleting a value in a text field did not work because
the field is not included in the modify operation when the value
is empty. The details facet's update() method has been modified
to update only dirty fields.

The section lists in details facet and dialog have been converted
into ordered maps.

Ticket #1256


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

ACK.  Pushed to master
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel