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; i<l; i++) {
+        var options = that.options;
+        if (that.sort) options = that.sort_options();
+        for (var i=0, l=options.length; i<l; 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 a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 4cf93c9b15c5361c8162e17a4b8cb7b28c604490..8bca08783c818af5ce98d7005ee5db748a7ccf9f 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.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

From 150b51ce3925fc3b6603bbe34af9c82644701989 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 9 Jul 2014 13:39:14 +0200
Subject: [PATCH] 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.

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/aci.js      | 76 ++++++++++++++++++++++++++++++++------
 install/ui/src/freeipa/dialog.js   | 15 +++++++-
 install/ui/test/data/ipa_init.json |  2 +
 ipalib/plugins/internal.py         |  2 +
 4 files changed, 82 insertions(+), 13 deletions(-)

diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 929ec92a4c069dac2e2540ba9d24bb1783734215..4cf93c9b15c5361c8162e17a4b8cb7b28c604490 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -548,6 +548,12 @@ aci.attributes_widget = function(spec) {
 
     var that = IPA.checkboxes_widget(spec);
 
+    /**
+     * Additional options which are not defined in metadata
+     * @property {string[]}
+     */
+    that.custom_options = spec.custom_options || [];
+
     that.object_type = spec.object_type;
     that.skip_unmatched = spec.skip_unmatched === undefined ? false : spec.skip_unmatched;
 
@@ -555,15 +561,20 @@ aci.attributes_widget = function(spec) {
 
     that.create = function(container) {
         that.container = container;
-
         that.widget_create(container);
-        that.create_search_filter(container);
-        that.owb_create(container);
 
+        that.controls = $('<div/>', {
+            'class': 'form-inline controls'
+        });
+        that.controls.appendTo(container);
+        that.create_search_filter(that.controls);
+        that.create_add_control(that.controls);
         if (that.undo) {
-            that.create_undo(container);
+            that.create_undo(that.controls);
         }
 
+        that.owb_create(container);
+
         that.create_error_link(container);
     };
 
@@ -595,6 +606,39 @@ aci.attributes_widget = function(spec) {
         filter_container.appendTo(container);
     };
 
+    that.create_add_control = function(container) {
+
+        that.add_button = IPA.button({
+            label: '@i18n:buttons.add',
+            click: that.show_add_dialog
+        });
+        container.append(' ');
+        that.add_button.appendTo(container);
+    };
+
+    that.show_add_dialog = function() {
+
+        var dialog = IPA.form_dialog({
+            name: "add_option",
+            title: "@i18n:objects.permission.add_custom_attr",
+            fields: [
+                {
+                    name: 'attr',
+                    label: '@i18n:objects.permission.attribute',
+                    required: true
+                }
+            ]
+        });
+        dialog.on_confirm = function() {
+            if (!dialog.validate()) return;
+            var attr = dialog.get_field('attr');
+            var value = attr.get_value()[0];
+            that.add_custom_option(value, false, true, true);
+            dialog.close();
+        };
+        dialog.open();
+    };
+
     that.filter_options = function() {
         $("li", that.$node).each(function() {
             var item = $(this);
@@ -641,21 +685,31 @@ aci.attributes_widget = function(spec) {
 
     that.append = function() {
 
-        if (!that.values) return;
-
         var unmatched = [];
 
-        for (var i=0; i<that.values.length; i++) {
-            if (!that.has_option(that.values[i])) {
-                unmatched.push(that.values[i]);
+        function add_unmatched(source) {
+            for (var i=0, l=source.length; i<l; i++) {
+                if (!that.has_option(source[i])) {
+                    that.add_option(source[i], true /* suppress update */);
+                }
             }
         }
 
-        if (unmatched.length > 0 && !that.skip_unmatched) {
-            that.options.push.apply(that.options, that.prepare_options(unmatched));
+        add_unmatched(that.custom_options);
+
+        if (that.values && !that.skip_unmatched) {
+            add_unmatched(that.values);
         }
     };
 
+    that.add_custom_option = function(name, to_custom, check, update) {
+
+        var value = (name || '').toLowerCase();
+        if (to_custom) that.custom_options.push(value);
+        if (check) that.values.push(value);
+        if (update) that.update(that.values);
+    };
+
     that.has_option = function(value) {
         var o = that.options;
         for (var i=0, l=o.length; i<l; i++) {
diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js
index c593787fec70cf80fe6a07948ce24c08365b873e..22bda3e99fa1b43cbae9f85bcec00a905f773cac 100644
--- a/install/ui/src/freeipa/dialog.js
+++ b/install/ui/src/freeipa/dialog.js
@@ -1395,8 +1395,7 @@ IPA.confirm_dialog = function(spec) {
             name: 'ok',
             label: that.ok_label,
             click: function() {
-                that.confirmed = true;
-                that.close();
+                that.on_confirm();
             }
         });
 
@@ -1419,6 +1418,18 @@ IPA.confirm_dialog = function(spec) {
 };
 
 /**
+ * General form dialog with confirmation feature
+ * @class  dialog.form_dialog
+ * @extends {IPA.confirm_dialog}
+ */
+IPA.form_dialog = function(spec) {
+
+    var that = IPA.confirm_dialog(spec);
+    that.create_content = that.dialog_create_content;
+    return that;
+};
+
+/**
  * Confirm mixin
  *
  * Can extend a dialog by confirmation by keyboard functionality. When applied
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index a6a3acd4c0f11b1ad799e1f01ffac6277fec3ac4..8a482134d70976ecfe4748dd102351a64dbd4dd6 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -374,6 +374,8 @@
                             "enable": "Enable token"
                         },
                         "permission": {
+                            "add_custom_attr": "Add custom attribute",
+                            "attribute": "Attribute",
                             "filter": "Filter",
                             "identity": "Permission settings",
                             "managed": "Attribute breakdown",
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 6d925c5c24dad9425f1adfe450949c60781c1010..1a8d9cad3427ee75e7774f67c2b4c08eaba8479e 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -518,6 +518,8 @@ class i18n_messages(Command):
                 "enable": "Enable token",
             },
             "permission": {
+                "add_custom_attr": _("Add custom attribute"),
+                "attribute": _("Attribute"),
                 "filter": _("Filter"),
                 "identity": _("Permission settings"),
                 "managed": _("Attribute breakdown"),
-- 
1.9.3

From 13b2c7081819c9b710cd0768c960a17b89e63a85 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 9 Jul 2014 14:00:54 +0200
Subject: [PATCH] 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.

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/widget.js | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 1bda37350a4c9d7d80a4bdc453e538e0de756cfc..3204b353e49bd819d295a0280f863c76bade6983 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -24,6 +24,7 @@
 
 define(['dojo/_base/array',
        'dojo/_base/lang',
+       'dojo/dom-construct',
        'dojo/Evented',
        'dojo/has',
        'dojo/keys',
@@ -43,7 +44,7 @@ define(['dojo/_base/array',
        './util',
        'exports'
        ],
-       function(array, lang, Evented, has, keys, on, string, topic, builder,
+       function(array, lang, construct, Evented, has, keys, on, string, topic, builder,
                 datetime, entity_mod, IPA, $, navigation, phases, reg, rpc, text, util, exp) {
 
 /**
@@ -1379,16 +1380,17 @@ IPA.option_widget_base = function(spec, that) {
     };
 
     that.create_options = function(container) {
-        for (var i=0; i<that.options.length; i++) {
+        container = $(container)[0];
+        for (var i=0, l=that.options.length; i<l; i++) {
             var option_container = that.create_option_container();
             var option = that.options[i];
             that.create_option(option, option_container);
-            option_container.appendTo(container);
+            construct.place(option_container, container);
         }
     };
 
     that.create_option_container = function() {
-        return $('<li/>');
+        return construct.create('li');
     };
 
     that._create_option = function(option, container) {
@@ -1396,11 +1398,11 @@ IPA.option_widget_base = function(spec, that) {
         var id = that._option_next_id + input_name;
         var enabled = that.enabled && option.enabled;
 
-        var opt_cont = $('<span/>', {
+        var opt_cont = construct.create('span', {
             "class": that.intput_type + '-cnt'
-        }).appendTo(container);
+        });
 
-        option.input_node = $('<input/>', {
+        option.input_node = construct.create('input', {
             id: id,
             type: that.input_type,
             name: input_name,
@@ -1408,15 +1410,16 @@ IPA.option_widget_base = function(spec, that) {
             value: option.value,
             title: option.tooltip || that.tooltip,
             change: that.on_input_change
-        }).appendTo(opt_cont);
+        }, opt_cont);
 
-        option.label_node =  $('<label/>', {
-            html: option.label || '',
+        option.label_node = construct.create('label', {
             title: option.tooltip || that.tooltip,
             'for': id
-        }).appendTo(opt_cont);
+        }, opt_cont);
+        option.label_node.textContent = option.label || '';
 
         that.new_option_id();
+        construct.place(opt_cont, container);
     };
 
     that.create_option = function(option, container) {
-- 
1.9.3

From 59f617ba999640fefb4a2cf8ec7e562ef0fa9c11 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Fri, 4 Jul 2014 13:33:10 +0200
Subject: [PATCH] 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

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/src/freeipa/aci.js      | 53 ++++++++++++++++++++++++++++++++++++++
 install/ui/test/data/ipa_init.json |  1 +
 ipalib/plugins/internal.py         |  1 +
 3 files changed, 55 insertions(+)

diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index ce7d427871f1cc0093a89f21867bc24f84c54e16..929ec92a4c069dac2e2540ba9d24bb1783734215 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -553,6 +553,59 @@ aci.attributes_widget = function(spec) {
 
     var id = spec.name;
 
+    that.create = function(container) {
+        that.container = container;
+
+        that.widget_create(container);
+        that.create_search_filter(container);
+        that.owb_create(container);
+
+        if (that.undo) {
+            that.create_undo(container);
+        }
+
+        that.create_error_link(container);
+    };
+
+    that.create_search_filter = function(container) {
+        var filter_container = $('<div/>', {
+            'class': 'search-filter'
+        });
+
+        that.filter = $('<input/>', {
+            type: 'text',
+            name: 'filter',
+            'class': 'form-control',
+            placeholder: text.get('@i18n:objects.permission.filter')
+        }).appendTo(filter_container);
+
+        that.filter.keyup(function(e) {
+            that.filter_options();
+        });
+
+        var find_button = IPA.action_button({
+            name: 'find',
+            icon: 'fa-search',
+            click: function() {
+                that.filter_options();
+                return false;
+            }
+        }).appendTo(filter_container);
+
+        filter_container.appendTo(container);
+    };
+
+    that.filter_options = function() {
+        $("li", that.$node).each(function() {
+            var item = $(this);
+            if(item.find('input').val().indexOf(that.filter.val()) === -1) {
+                item.css('display','none');
+            } else {
+                item.css('display','inline');
+            }
+        });
+    };
+
     that.update = function(values) {
 
         that.values = [];
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index b3d38590070b2e3e7ea96527a44a98db192d559b..a6a3acd4c0f11b1ad799e1f01ffac6277fec3ac4 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -374,6 +374,7 @@
                             "enable": "Enable token"
                         },
                         "permission": {
+                            "filter": "Filter",
                             "identity": "Permission settings",
                             "managed": "Attribute breakdown",
                             "target": "Target"
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 53f117f3f41a34eddf5e8545a3118abd9c73dbd3..6d925c5c24dad9425f1adfe450949c60781c1010 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -518,6 +518,7 @@ class i18n_messages(Command):
                 "enable": "Enable token",
             },
             "permission": {
+                "filter": _("Filter"),
                 "identity": _("Permission settings"),
                 "managed": _("Attribute breakdown"),
                 "target": _("Target"),
-- 
1.9.3

From 253bc1cf32e699d3901fe6441477a14310f3a306 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Fri, 4 Jul 2014 13:24:47 +0200
Subject: [PATCH] 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

https://fedorahosted.org/freeipa/ticket/4253
---
 install/ui/ipa.css                      | 15 +++++-
 install/ui/src/freeipa/aci.js           | 88 ++-------------------------------
 install/ui/src/freeipa/widget.js        |  1 -
 ipatests/test_webui/test_delegation.py  |  6 +--
 ipatests/test_webui/test_rbac.py        |  6 +--
 ipatests/test_webui/test_selfservice.py |  6 +--
 6 files changed, 26 insertions(+), 96 deletions(-)

diff --git a/install/ui/ipa.css b/install/ui/ipa.css
index 8d350cc5d7684d0fb3a209e266d03a6603e8d30f..ec79688a2efc9a3620334e72368816e454ba3c47 100644
--- a/install/ui/ipa.css
+++ b/install/ui/ipa.css
@@ -345,7 +345,7 @@ table.scrollable tbody {
 .option_widget {
     list-style-type: none;
     margin: 0;
-    padding: 0;
+    padding: 0 0 0 1px;
 }
 
 .option_widget.nested {
@@ -365,6 +365,19 @@ table.scrollable tbody {
     max-width: 150px;
 }
 
+.option_widget.columns.attribute_widget {
+    position: relative;
+    overflow-y: auto;
+    max-height: 36em;
+}
+
+.option_widget.columns.attribute_widget > li {
+    float: left;
+    width: 50%;
+    min-width: 90px;
+    max-width: 200px;
+}
+
 .combobox-widget-input {
     position: relative;
 }
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 67579026fd08c0bab80ef5c2eefc102aad274f8f..ce7d427871f1cc0093a89f21867bc24f84c54e16 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -544,6 +544,7 @@ return {
 aci.attributes_widget = function(spec) {
 
     spec = spec || {};
+    spec.layout = spec.layout || 'columns attribute_widget';
 
     var that = IPA.checkboxes_widget(spec);
 
@@ -552,83 +553,6 @@ aci.attributes_widget = function(spec) {
 
     var id = spec.name;
 
-    that.create = function(container) {
-        that.container = container;
-
-        var attr_container = $('<div/>', {
-            'class': 'aci-attribute-table-container'
-        }).appendTo(container);
-
-        that.$node = that.table = $('<table/>', {
-            id: id,
-            name: that.name,
-            'class': 'table table-bordered table-condensed aci-attribute-table scrollable'
-        }).
-            append('<thead/>').
-            append('<tbody/>').
-            appendTo(attr_container);
-
-        var tr = $('<tr></tr>').appendTo($('thead', that.table));
-
-        var th = $('<th/>').appendTo(tr);
-        IPA.standalone_option({
-            type: "checkbox",
-            click: function() {
-                $('.aci-attribute', that.table).
-                    prop('checked', $(this).prop('checked'));
-                that.value_changed.notify([], that);
-                that.emit('value-change', { source: that });
-            }
-        }, th);
-
-        tr.append($('<th/>', {
-            'class': 'aci-attribute-column',
-            html: text.get('@i18n:objects.aci.attribute')
-        }));
-
-        if (that.undo) {
-            that.create_undo(container);
-        }
-
-        if (that.object_type) {
-            that.populate(that.object_type);
-        }
-
-        that.create_error_link(container);
-    };
-
-    that.create_options = function(options) {
-        var tbody = $('tbody', that.table);
-
-        for (var i=0; i<options.length ; i++){
-            var option = options[i];
-            var value = option.value.toLowerCase();
-            var tr = $('<tr/>').appendTo(tbody);
-
-            var td =  $('<td/>').appendTo(tr);
-            var name = that.get_input_name();
-            var id = that._option_next_id + name;
-            var opt = IPA.standalone_option({
-                id: id,
-                type: 'checkbox',
-                name: name,
-                value: value,
-                'class': 'aci-attribute',
-                change: function() {
-                    that.value_changed.notify([], that);
-                    that.emit('value-change', { source: that });
-                }
-            }, td);
-            td = $('<td/>').appendTo(tr);
-            td.append($('<label/>',{
-                text: value,
-                'for': id
-            }));
-            option.input_node = opt[0];
-            that.new_option_id();
-        }
-    };
-
     that.update = function(values) {
 
         that.values = [];
@@ -646,14 +570,12 @@ aci.attributes_widget = function(spec) {
 
         that.populate(that.object_type);
         that.append();
-        that.create_options(that.options);
+        that.owb_create(that.container);
         that.owb_update(values);
     };
 
     that.populate = function(object_type) {
 
-        $('tbody tr', that.table).remove();
-
         if (!object_type || object_type === '') return;
 
         var metadata = metadata_provider.get('@mo:'+object_type);
@@ -689,10 +611,6 @@ aci.attributes_widget = function(spec) {
         return false;
     };
 
-    that.show_undo = function() {
-        $(that.undo_span).css('display', 'inline-block');
-    };
-
     return that;
 };
 
@@ -1080,4 +998,4 @@ aci.register = function() {
 phases.on('registration', aci.register);
 
 return aci;
-});
\ No newline at end of file
+});
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 780afb2bc14c26fa4fb795c2d086bd1d17ecc649..1bda37350a4c9d7d80a4bdc453e538e0de756cfc 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -1444,7 +1444,6 @@ IPA.option_widget_base = function(spec, that) {
 
     that.create = function(container) {
         that.destroy();
-        that.create_options(that.$node);
         var css_class = [that.css_class, 'option_widget', that.layout,
                 that.nested ? 'nested': ''].join(' ');
 
diff --git a/ipatests/test_webui/test_delegation.py b/ipatests/test_webui/test_delegation.py
index 22276c2e710d77283394c45b2385571b01768bbb..a3e70609f3542e3d141e470a6519805ddc0eb9ed 100644
--- a/ipatests/test_webui/test_delegation.py
+++ b/ipatests/test_webui/test_delegation.py
@@ -33,11 +33,11 @@ DATA = {
         ('textbox', 'aciname', PKEY),
         ('combobox', 'group', 'editors'),
         ('combobox', 'memberof', 'ipausers'),
-        ('table', 'attrs', 'audio'),
-        ('table', 'attrs', 'businesscategory'),
+        ('checkbox', 'attrs', 'audio'),
+        ('checkbox', 'attrs', 'businesscategory'),
     ],
     'mod': [
-        ('table', 'attrs', 'businesscategory'),
+        ('checkbox', 'attrs', 'businesscategory'),
     ],
 }
 
diff --git a/ipatests/test_webui/test_rbac.py b/ipatests/test_webui/test_rbac.py
index 8477b118da6cd659158ed96b84d50e8b1a33efb8..07cc2882636b49e43636abd2b598d70367eb354e 100644
--- a/ipatests/test_webui/test_rbac.py
+++ b/ipatests/test_webui/test_rbac.py
@@ -61,11 +61,11 @@ PERMISSION_DATA = {
         ('checkbox', 'ipapermright', 'write'),
         ('checkbox', 'ipapermright', 'read'),
         ('selectbox', 'type', 'user'),
-        ('table', 'attrs', 'audio'),
-        ('table', 'attrs', 'cn'),
+        ('checkbox', 'attrs', 'audio'),
+        ('checkbox', 'attrs', 'cn'),
     ],
     'mod': [
-        ('table', 'attrs', 'carlicense'),
+        ('checkbox', 'attrs', 'carlicense'),
     ],
 }
 
diff --git a/ipatests/test_webui/test_selfservice.py b/ipatests/test_webui/test_selfservice.py
index ce1971e540dba93579cb2bf543f650fa87c4e302..15fd23d4ea4717871d0bb3cd6ff9f722e8fa4b8c 100644
--- a/ipatests/test_webui/test_selfservice.py
+++ b/ipatests/test_webui/test_selfservice.py
@@ -30,11 +30,11 @@ DATA = {
     'pkey': PKEY,
     'add': [
         ('textbox', 'aciname', PKEY),
-        ('table', 'attrs', 'audio'),
-        ('table', 'attrs', 'businesscategory'),
+        ('checkbox', 'attrs', 'audio'),
+        ('checkbox', 'attrs', 'businesscategory'),
     ],
     'mod': [
-        ('table', 'attrs', 'businesscategory'),
+        ('checkbox', 'attrs', 'businesscategory'),
     ],
 }
 
-- 
1.9.3

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

Reply via email to