Re: [Freeipa-devel] [PATCH] Fix Update function on details page.

2010-08-17 Thread Adam Young

On 08/17/2010 09:09 AM, Pavel Zuna wrote:

On 08/17/2010 03:08 PM, Pavel Zuna wrote:

This is a fix to the setattr/addattr problem discussed in the thread:
[Freeipa-devel] [PATCH] Change the behaviour of addattr/setattr 
parameters


The problem was that parameters with no values are automatically
set to None by the framework and it wasn't handled properly in
baseldap.py:get_attributes function. Also, there were two logical
bugs in details.js:
1) atttribute callbacks to update values were called for input elements
instead of dt elements
2) it was always trying to update the primary key


I've seen Adam's fix. It's another way to do it, but I think it's better
not to rely on things like element focus to make assumptions about data.
There were also some logical bugs in the update code as mentioned above,
so this patch is a little bit more complete.

By the way; please use Reply All when replying to freeipa-devel threads.

Pavel


Oups. Forgot to attach the patch. :)

Pavel

ACK

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


[Freeipa-devel] Extending Details, user and otherwise

2010-08-17 Thread Adam Young

The structure of our details code is basciallt

[categorid, categoryDisplay,  atrrtibutes]

and attributes are

 [attributeId, attributeDisplay,


I've inlined the user details at the bottom as an example.


In order to make these configuratble by the end user, here is a strawman 
proposal:



Create a dir under /var/lib/ipa/details with code that will, at run 
time, get validated and then appended to the web code.  This code, 
unlike the resources approach, will not be autogenerated.
The code for the user details gets pre-populated there from a 
static copy somewhere under /usr/share/ipa.  The end user can then 
customize it to add or remove fields.
If they so desire, they can add in custom javascript code that will 
provide more advanced UI.  An example might be a n interactive map for 
showing seat and parking assignments.



IPA server install and uninstall will be aware of these files, and 
treat them gently.  Doing an install will not over write the files if 
they are present, but will instead rename and back them up.  Same with 
uninstall, unless an additional option is given ( for example 
--ultraclean) the is repsonbile for removing all vestiges of IPA from a 
system.


The details pages will be named collection-details.js:  
user-details.js,  group-details.js and so forth.



As I said, this is a strawman.  Please poke holes in it, and make better 
suggestions.






var user_details_lists = [
['identity', 'Identity Details', [
['title', 'Title'],
['givenname', 'First Name'],
['sn', 'Last Name'],
['cn', 'Full Name'],
['displayname', 'Dispaly Name'],
['initials', 'Initials']
]
],
['account', 'Account Details', [
['call_a_status', 'Account Status'],
['uid', 'Login'],
['call_a_password', 'Password'],
['uidnumber', 'UID'],
['gidnumber', 'GID'],
['homedirectory', 'homedirectory']
]
],
['contact', 'Contact Details', [
['mail', 'E-mail Address'],
['call_a_numbers', 'Numbers']
]
],
['address', 'Mailing Address', [
['street', 'Address'],
['location', 'City'],
['call_a_st', 'State'],
['postalcode', 'ZIP']
]
],
['employee', 'Employee Information', [
['ou', 'Org. Unit'],
['call_a_manager', 'Manager']
]
],
['misc', 'Misc. Information', [
['carlicense', 'Car License']
]
]
]

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


Re: [Freeipa-devel] [PATCH] Fix Update function on details page.

2010-08-17 Thread Adam Young

On 08/17/2010 09:09 AM, Pavel Zuna wrote:

On 08/17/2010 03:08 PM, Pavel Zuna wrote:

This is a fix to the setattr/addattr problem discussed in the thread:
[Freeipa-devel] [PATCH] Change the behaviour of addattr/setattr 
parameters


The problem was that parameters with no values are automatically
set to None by the framework and it wasn't handled properly in
baseldap.py:get_attributes function. Also, there were two logical
bugs in details.js:
1) atttribute callbacks to update values were called for input elements
instead of dt elements
2) it was always trying to update the primary key


I've seen Adam's fix. It's another way to do it, but I think it's better
not to rely on things like element focus to make assumptions about data.
There were also some logical bugs in the update code as mentioned above,
so this patch is a little bit more complete.

By the way; please use Reply All when replying to freeipa-devel threads.

Pavel


Oups. Forgot to attach the patch. :)

Pavel

ACK

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


Re: [Freeipa-devel] [PATCH] Clean ipa.js and make it load plugin meta-data over JSON-RPC.

2010-08-17 Thread Adam Young

On 08/10/2010 01:30 PM, Pavel Zuna wrote:

What it means?
Well, first I removed some development control variables from ipa.js.
Namely useSampleData and sizelimit. I moved useSampleData to the top
of index.xhtml. This way we won't forget about it when we don't need
it anymore. sizelimit has nothing to do in ipa.js and be hardcoded
for ALL commands! Some don't have this parameter and could fail.

Since ipa_init now loads meta-data over JSON-RPC, we need to wait for
it to finish its job. That's why I put a second parameter to ipa_init:
on_win. ipa_init will call on_win when all data is loaded properly and
we can start building the page.

Pavel


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

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

Re: [Freeipa-devel] [PATCH] Fix Update function on details page.

2010-08-17 Thread Adam Young

On 08/17/2010 09:09 AM, Pavel Zuna wrote:

On 08/17/2010 03:08 PM, Pavel Zuna wrote:

This is a fix to the setattr/addattr problem discussed in the thread:
[Freeipa-devel] [PATCH] Change the behaviour of addattr/setattr 
parameters


The problem was that parameters with no values are automatically
set to None by the framework and it wasn't handled properly in
baseldap.py:get_attributes function. Also, there were two logical
bugs in details.js:
1) atttribute callbacks to update values were called for input elements
instead of dt elements
2) it was always trying to update the primary key


I've seen Adam's fix. It's another way to do it, but I think it's better
not to rely on things like element focus to make assumptions about data.
There were also some logical bugs in the update code as mentioned above,
so this patch is a little bit more complete.

By the way; please use Reply All when replying to freeipa-devel threads.

Pavel


Oups. Forgot to attach the patch. :)

Pavel

Pushed to master

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


Re: [Freeipa-devel] [PATCH] Clean details.js.

2010-08-17 Thread Adam Young

On 08/10/2010 01:30 PM, Pavel Zuna wrote:

What does it mean?
I removed duplicate code, that was pasted here from the user details 
page.


ipa_details_init doesn't call ipa_init anymore.

ipa_details_create takes a second optional parameter, that can be set to
a container element if we want to place the definition lists into a 
specific
element instead of body. In our case, we place stuff in div 
id=content


Pavel


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

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

Re: [Freeipa-devel] [PATCH] Make user details work again in the webUI.

2010-08-17 Thread Adam Young

On 08/10/2010 01:31 PM, Pavel Zuna wrote:

Unfortunately we can't have any javascript in *.inc files, because
the browser will strip them for security reasons. I moved all the
attribute callbacks etc. to the only logical place: user.js.

It's fine for now, but user.js is going to need some serious cleaning
up in the future.

Pavel


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

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