Re: [Freeipa-devel] [PATCH] 697-702 webui: usability improvements in attribute widget

2014-07-21 Thread Petr Vobornik

On 18.7.2014 00:06, Endi Sukma Dewata wrote:

On 7/10/2014 8:02 AM, Petr Vobornik wrote:

ACK. Comments below:


== [PATCH] 699 webui: optimize (re)creation of option widget ==

There is a case where attributes widget can contain  1000 items.
It's about 3000 nodes. It's slow in jQuery. Simple move to dojo
speeds it up (is closer to native calls) while maintaining developer
friendliness.

Now the biggest lag is in browser's render. It's probably not worth
developer time to optimize that.


Is it common to have many items in this widget (doesn't have to be
bigger than 1000, but just large enough)? Maybe the UI should provide
some kind of paging interface, not just for performance reason, but also
for usability.


It's not common, it's only in one case and therefore IMO we don't have 
to spend more time on this issue.


WRT paging: IMHO the classic one won't help, but 'infinite scroll 
paging' might. I would rather see this type of paging on search facets 
first.





== [PATCH] 700 webui: custom attr in attributes widget ==

Web UI doesn't always know what are the possible attributes
for target object. This will allow to add custom attributes
if necessary.


Right now you can add an undefined attribute, but it will fail when you
try to save it. Should the UI perform a schema validation before
accepting the new attribute? Or should the UI provide a list of valid
attributes?



If we knew the list of valid attrs/schema we would not need this patch.



pushed to:

master:
* b68f819de75073285c17c28a30afe5b5dbfe5176 webui: improve usability of 
attributes widget
* 740d42257fc00235b1cebdc90866fe34bf9464b3 webui: add filter to 
attributes widget
* 9fa447cb6e5f1476072cf167eec8502cfc3e38e3 webui: optimize (re)creation 
of option widget
* 4aefc0d6fe7a4879a9b8024eb7424b4dfa5fa7ca webui: custom attr in 
attributes widget
* d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a webui: attr widget: get list 
of possible attrs from ipapermdefaultattr
* 8fcf6d6b34400c1924f509701856b86e4f647624 webui: option_widget_base: 
sort options

ipa-4-1:
* b68f819de75073285c17c28a30afe5b5dbfe5176 webui: improve usability of 
attributes widget
* 740d42257fc00235b1cebdc90866fe34bf9464b3 webui: add filter to 
attributes widget
* 9fa447cb6e5f1476072cf167eec8502cfc3e38e3 webui: optimize (re)creation 
of option widget
* 4aefc0d6fe7a4879a9b8024eb7424b4dfa5fa7ca webui: custom attr in 
attributes widget
* d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a webui: attr widget: get list 
of possible attrs from ipapermdefaultattr
* 8fcf6d6b34400c1924f509701856b86e4f647624 webui: option_widget_base: 
sort options

ipa-4-0:
* b68f819de75073285c17c28a30afe5b5dbfe5176 webui: improve usability of 
attributes widget
* 740d42257fc00235b1cebdc90866fe34bf9464b3 webui: add filter to 
attributes widget
* 9fa447cb6e5f1476072cf167eec8502cfc3e38e3 webui: optimize (re)creation 
of option widget
* 4aefc0d6fe7a4879a9b8024eb7424b4dfa5fa7ca webui: custom attr in 
attributes widget
* d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a webui: attr widget: get list 
of possible attrs from ipapermdefaultattr
* 8fcf6d6b34400c1924f509701856b86e4f647624 webui: option_widget_base: 
sort options



--
Petr Vobornik

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


Re: [Freeipa-devel] [PATCH] 697-702 webui: usability improvements in attribute widget

2014-07-17 Thread Endi Sukma Dewata

On 7/10/2014 8:02 AM, Petr Vobornik wrote:

ACK. Comments below:


== [PATCH] 699 webui: optimize (re)creation of option widget ==

There is a case where attributes widget can contain  1000 items.
It's about 3000 nodes. It's slow in jQuery. Simple move to dojo
speeds it up (is closer to native calls) while maintaining developer
friendliness.

Now the biggest lag is in browser's render. It's probably not worth
developer time to optimize that.


Is it common to have many items in this widget (doesn't have to be 
bigger than 1000, but just large enough)? Maybe the UI should provide 
some kind of paging interface, not just for performance reason, but also 
for usability.



== [PATCH] 700 webui: custom attr in attributes widget ==

Web UI doesn't always know what are the possible attributes
for target object. This will allow to add custom attributes
if necessary.


Right now you can add an undefined attribute, but it will fail when you 
try to save it. Should the UI perform a schema validation before 
accepting the new attribute? Or should the UI provide a list of valid 
attributes?


--
Endi S. Dewata

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


[Freeipa-devel] [PATCH] 697-702 webui: usability improvements in attribute widget

2014-07-10 Thread Petr Vobornik

ticket: https://fedorahosted.org/freeipa/ticket/4253

== [PATCH] 697 webui: improve usability of attributes widget ==

Attributes widget layour was changed from tiny table which allowed
to display only few options to a checkbox list with multiple
columns (depends on container).

Check all attributes option was removed to force the user
to read through the attributes which he selects.

Initial version authored by: Adam Misnyovszki


== [PATCH] 698 webui: add filter to attributes widget ==

Adds filter field to attribute box in permissions for better user
experience. User can then quickly find the desired attribute.

Initial version of the patch authored by: Adam Misnyovszki


== [PATCH] 699 webui: optimize (re)creation of option widget ==

There is a case where attributes widget can contain  1000 items.
It's about 3000 nodes. It's slow in jQuery. Simple move to dojo
speeds it up (is closer to native calls) while maintaining developer
friendliness.

Now the biggest lag is in browser's render. It's probably not worth
developer time to optimize that.


== [PATCH] 700 webui: custom attr in attributes widget ==

Web UI doesn't always know what are the possible attributes
for target object. This will allow to add custom attributes
if necessary.

== [PATCH] 701 webui: attr widget: get list of possible attrs from 
ipapermdefaultattr ==


Very useful for managed permissions since the list of attrs in metadata
might be smaller that default attributes. This smooths behavior if one
removes an attr from effective attrs which is not in metadata. Without
this it will disappear from the list and one has to add it manually
through 'Add'.


[PATCH] 702 webui: option_widget_base: sort options
--
Petr Vobornik
From b668671d78f6e23cf9a77371c59fd778fc262f61 Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Wed, 9 Jul 2014 16:14:32 +0200
Subject: [PATCH] webui: option_widget_base: sort options

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/aci.js|  1 +
 install/ui/src/freeipa/widget.js | 19 +--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 8bca08783c818af5ce98d7005ee5db748a7ccf9f..c79af2cb079a8dddc905eef7c15442082f546914 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -545,6 +545,7 @@ aci.attributes_widget = function(spec) {
 
 spec = spec || {};
 spec.layout = spec.layout || 'columns attribute_widget';
+spec.sort = spec.sort === undefined ? true : spec.sort;
 
 var that = IPA.checkboxes_widget(spec);
 
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 3204b353e49bd819d295a0280f863c76bade6983..c12115592c2303236b38ae3534c352e7a3b6be9c 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -1259,6 +1259,7 @@ IPA.option_widget_base = function(spec, that) {
 that.name = spec.name;
 that.label = spec.label;
 that.tooltip = spec.tooltip;
+that.sort = spec.sort === undefined ? false : spec.sort;
 that.value_changed = that.value_changed || IPA.observer();
 that.default_value = spec.default_value || null;
 that.default_on_empty = spec.default_on_empty === undefined ? true : spec.default_on_empty;
@@ -1379,11 +1380,25 @@ IPA.option_widget_base = function(spec, that) {
 }
 };
 
+that.sort_options = function() {
+var options = that.options.concat();
+options.sort(function(a,b) {
+if (a.value  b.value)
+  return 1;
+if (a.value  b.value)
+  return -1;
+return 0;
+});
+return options;
+};
+
 that.create_options = function(container) {
 container = $(container)[0];
-for (var i=0, l=that.options.length; il; i++) {
+var options = that.options;
+if (that.sort) options = that.sort_options();
+for (var i=0, l=options.length; il; i++) {
 var option_container = that.create_option_container();
-var option = that.options[i];
+var option = options[i];
 that.create_option(option, option_container);
 construct.place(option_container, container);
 }
-- 
1.9.3

From a580174d980fb9357275881bcf28beb9bd8c55db Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Wed, 9 Jul 2014 16:49:46 +0200
Subject: [PATCH] webui: attr widget: get list of possible attrs from
 ipapermdefaultattr

Very useful for managed permissions since the list of attrs in metadata
might be smaller that default attributes. This smooths behavior if one
removes an attr from effective attrs which is not in metadata. Without
this it will disappear from the list and one has to add it manually
through 'Add'.

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/aci.js | 10 ++
 1 file changed, 10 insertions(+)

diff --git 

Re: [Freeipa-devel] [PATCH] 697-702 webui: usability improvements in attribute widget

2014-07-10 Thread Petr Vobornik

There is an issue in patch #701, new version attached.

On 10.7.2014 14:29, Petr Vobornik wrote:

ticket: https://fedorahosted.org/freeipa/ticket/4253

== [PATCH] 697 webui: improve usability of attributes widget ==

Attributes widget layour was changed from tiny table which allowed
to display only few options to a checkbox list with multiple
columns (depends on container).

Check all attributes option was removed to force the user
to read through the attributes which he selects.

Initial version authored by: Adam Misnyovszki


== [PATCH] 698 webui: add filter to attributes widget ==

Adds filter field to attribute box in permissions for better user
experience. User can then quickly find the desired attribute.

Initial version of the patch authored by: Adam Misnyovszki


== [PATCH] 699 webui: optimize (re)creation of option widget ==

There is a case where attributes widget can contain  1000 items.
It's about 3000 nodes. It's slow in jQuery. Simple move to dojo
speeds it up (is closer to native calls) while maintaining developer
friendliness.

Now the biggest lag is in browser's render. It's probably not worth
developer time to optimize that.


== [PATCH] 700 webui: custom attr in attributes widget ==

Web UI doesn't always know what are the possible attributes
for target object. This will allow to add custom attributes
if necessary.

== [PATCH] 701 webui: attr widget: get list of possible attrs from
ipapermdefaultattr ==

Very useful for managed permissions since the list of attrs in metadata
might be smaller that default attributes. This smooths behavior if one
removes an attr from effective attrs which is not in metadata. Without
this it will disappear from the list and one has to add it manually
through 'Add'.


[PATCH] 702 webui: option_widget_base: sort options


--
Petr Vobornik
From 8f2adbe422a24639f7d6bee83f7b198c15bf9497 Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Wed, 9 Jul 2014 16:49:46 +0200
Subject: [PATCH] webui: attr widget: get list of possible attrs from
 ipapermdefaultattr

Very useful for managed permissions since the list of attrs in metadata
might be smaller that default attributes. This smooths behavior if one
removes an attr from effective attrs which is not in metadata. Without
this it will disappear from the list and one has to add it manually
through 'Add'.

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/aci.js | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 4cf93c9b15c5361c8162e17a4b8cb7b28c604490..d4eb0febef59c41e66f833f8b0d8464cbc97c3fc 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -898,6 +898,16 @@ aci.permission_target_policy = function (spec) {
 var attribute_table = that.permission_target.widgets.get_widget('attrs');
 var skip_unmatched_org = attribute_table.skip_unmatched;
 attribute_table.object_type = type;
+
+// UI doesn't always know what are the possible attributes.
+// In case of managed permissions, one of the possible lists is in ipapermdefaultattr.
+var default_attrs = that.container.fields.get_field('ipapermdefaultattr');
+if (default_attrs  default_attrs.enabled) { // if managed permission
+attribute_table.custom_options = default_attrs.get_value();
+} else {
+attribute_table.custom_options = [];
+}
+
 // skip values which don't belong to new type. Bug #2617
 attribute_table.skip_unmatched =  skip_unmatched || skip_unmatched_org;
 attribute_field.reset();
-- 
1.9.3

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