Re: [Freeipa-devel] [PATCh] admiyo-0120-hidden-filter.

2010-12-22 Thread Rob Crittenden

Adam Young wrote:

This handles the ACI creation problem.


nack. The change to widget.js causes the first two labels to not be 
displayed in the Add ACI modal dialog.


It otherwise looks ok.

rob

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


Re: [Freeipa-devel] [PATCh] admiyo-0120-hidden-filter.

2010-12-22 Thread Adam Young

On 12/22/2010 12:06 PM, Rob Crittenden wrote:

Adam Young wrote:

This handles the ACI creation problem.


nack. The change to widget.js causes the first two labels to not be 
displayed in the Add ACI modal dialog.


It otherwise looks ok.

rob

Ah...should have looked for 'undefined'
From 863c85c629e1f9679d6cb90e1543c82f7a10c60c Mon Sep 17 00:00:00 2001
From: Adam Young ayo...@redhat.com
Date: Tue, 21 Dec 2010 15:14:08 -0500
Subject: [PATCH] hidden filter

The filter field on aci add is hidden, and prefilled with an object class that doesn't exist.

Fixed the error where the other fields were removed
---
 install/static/aci.js |   25 +++--
 install/static/details.js |6 --
 install/static/widget.js  |4 +++-
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/install/static/aci.js b/install/static/aci.js
index f31449f02efee26ba95603e9ffa6c74dcbec85ce..43fa8f0f2524ba09190bef974a7483681eecdd45 100644
--- a/install/static/aci.js
+++ b/install/static/aci.js
@@ -260,6 +260,28 @@ IPA.rights_widget = function(spec){
 return that;
 }
 
+IPA.hidden_widget = function(spec){
+spec.label = '';
+var that = ipa_widget(spec);
+that.id = spec.id;
+var value = spec.value || '';
+that.create = function(container){
+$('input/',{
+type:'hidden',
+'id':that.id,
+value: value
+}).
+appendTo(container);
+}
+
+that.save = function(){
+return [value];
+}
+that.reset = function(){
+
+}
+return that;
+}
 
 
 
@@ -600,9 +622,8 @@ function ipa_permission_add_dialog(spec) {
 }));
 
 that.add_field(IPA.rights_widget({name:'permissions'}));
-that.add_field(ipa_text_widget({name:'filter'}));
+that.add_field(IPA.hidden_widget({name:'filter','value':'objectClass=changethisvalue'}));
 that.add_dialog_init();
-
 };
 
 
diff --git a/install/static/details.js b/install/static/details.js
index 1aeffb1dfa4834374641fbb5e8bb53a1cb480f84..1e510692922a126d24fd2f1cb257124816e88d98 100644
--- a/install/static/details.js
+++ b/install/static/details.js
@@ -332,12 +332,14 @@ function ipa_details_list_section(spec){
 var field = fields[i];
 
 var label = field.label;
-
+if (label !== ''){
+label += ':';
+}
 var param_info = ipa_get_param_info(that.entity_name, field.name);
 if (param_info  param_info['label']) label = param_info['label'];
 
 $('dt/', {
-html: label + ':'
+html: label
 }).appendTo(dl);
 
 var span = $('span/', { 'name': field.name }).appendTo(dl);
diff --git a/install/static/widget.js b/install/static/widget.js
index 07973c7ffaa3c205685765c36a8a0871b38f5bec..4da5df03f55786accd5e98ba0f6c305f021dba9e 100755
--- a/install/static/widget.js
+++ b/install/static/widget.js
@@ -55,7 +55,9 @@ function ipa_widget(spec) {
 function init() {
 if (that.entity_name  !that.label){
 var param_info = ipa_get_param_info(that.entity_name, spec.name);
-if (param_info) that.label = param_info.label;
+if ((param_info)  (that.label === undefined)){
+that.label = param_info.label;
+}
 }
 }
 
-- 
1.7.2.3

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

Re: [Freeipa-devel] [PATCh] admiyo-0120-hidden-filter.

2010-12-22 Thread Rob Crittenden

Adam Young wrote:

On 12/22/2010 12:06 PM, Rob Crittenden wrote:

Adam Young wrote:

This handles the ACI creation problem.


nack. The change to widget.js causes the first two labels to not be
displayed in the Add ACI modal dialog.

It otherwise looks ok.

rob

Ah...should have looked for 'undefined'


ack, pushed to master

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