[Freeipa-devel] [PATCH] 006 Uncheck checkboxes in association after deletion

Endi Sukma Dewata edewata at redhat.com
Thu Aug 18 20:30:34 UTC 2011


On 8/18/2011 8:18 AM, Petr Vobornik wrote:
> https://fedorahosted.org/freeipa/ticket/1639
>
> - added unchecking all checkboxes of table_widget and its derivates to
> on_load method.
>
> line '$('input[name=select]', that.tbody).attr('checked', false);' can
> be unnecessary because load method is recreating all rows in table. But
> I sense, it could be useful later.
>
> As I was implementing it, I noticed that after removing or adding sudo
> option it refreshes facet -> all other associations. Don't know if it's
> a feature or a bug. (sudo.js: 679, 683, 723, 727).

Some issues:

1. In IPA.table_widget when the select all checkbox is changed the 
tooltip will change too (see line 1265). When the checkbox is changed 
using unselect_all() it doesn't trigger the 'changed' event so the 
tooltip is not updated.

I think the code in 1265 can be moved into a separate function and the 
unselect_all() can call this function too. You can replace the loop with 
your code:
   $('input[name=select]', that.tbody).attr('checked', false);

2. In IPA.association_facet the select all checkbox is not unchecked 
because the content is loaded using refresh_table() in line 1017.

3. In IPA.search_facet the select all checkbox is unchecked at line 248. 
It would be better to call the table.unselect_all() from the 
search_facet.load() at line 226.

Optional: the code inside search_facet.load() probably could be moved 
into table.load() then the search_facet.load() can call table.load().

4. About the sudo options refreshing the whole facet, it would be nicer 
if we can limit the update to the options table only. This can be fixed 
separately.

-- 
Endi S. Dewata




More information about the Freeipa-devel mailing list