From a83e879e18148c763fcb09df42e08e1cf90dee84 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 24 May 2013 17:02:05 +0200 Subject: Better automated test support 1. add class to active facet instead of using direct style modification for hiding/showing 2. add name attribute to tables and dialog buttons and error dialog https://fedorahosted.org/freeipa/ticket/3744 --- install/ui/ipa.css | 5 +++++ install/ui/src/freeipa/aci.js | 7 ++++--- install/ui/src/freeipa/dialog.js | 3 ++- install/ui/src/freeipa/facet.js | 11 +++++------ install/ui/src/freeipa/ipa.js | 1 + install/ui/src/freeipa/widget.js | 3 ++- 6 files changed, 19 insertions(+), 11 deletions(-) (limited to 'install') diff --git a/install/ui/ipa.css b/install/ui/ipa.css index 8ef0a509..5095d73f 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -471,6 +471,11 @@ body { left: 10px; right: 10px; bottom: 0; + display: none; +} + +.active-facet { + display: block; } .facet-header { diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index aa28d721..3ca10dbf 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -483,8 +483,9 @@ IPA.attributes_widget = function(spec) { }).appendTo(container); that.$node = that.table = $('', { - id:id, - 'class':'search-table aci-attribute-table scrollable' + id: id, + name: that.name, + 'class': 'search-table aci-attribute-table scrollable' }). append(''). append(''). @@ -526,7 +527,7 @@ IPA.attributes_widget = function(spec) { var td = $('
').appendTo(tr); var name = that.get_input_name(); - var id = that.option_next_id + name; + var id = that._option_next_id + name; td.append($('',{ id: id, type: 'checkbox', diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js index 36a143d2..d1428fec 100644 --- a/install/ui/src/freeipa/dialog.js +++ b/install/ui/src/freeipa/dialog.js @@ -251,8 +251,9 @@ IPA.dialog = function(spec) { var parent = that.container.parent(); var buttons = $('.ui-dialog-buttonpane .ui-dialog-buttonset button', parent); - buttons.each(function(index) { + buttons.each(function(index, ui_button) { var button = that.buttons.values[index]; + $(ui_button).prop('name', button.name); button.element = $(this); }); }; diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index ad53b80f..166203a9 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -352,7 +352,7 @@ exp.facet = IPA.facet = function(spec, no_init) { that.domNode.detach(); } else { that.domNode = $('
', { - 'class': 'facet', + 'class': 'facet active-facet', name: that.name, 'data-name': that.name, 'data-entity': entity_name @@ -386,8 +386,7 @@ exp.facet = IPA.facet = function(spec, no_init) { }).appendTo(domNode); that.create_content(that.content); - - + domNode.removeClass('active-facet'); }; that.create_header = function(container) { @@ -429,7 +428,7 @@ exp.facet = IPA.facet = function(spec, no_init) { that.clear(); } - that.domNode.css('display', 'block'); + that.domNode.addClass('active-facet'); that.show_content(); that.header.select_tab(); @@ -437,7 +436,7 @@ exp.facet = IPA.facet = function(spec, no_init) { that.refresh(); } } else { - that.domNode.css('display', 'block'); + that.domNode.addClass('active-facet'); that.show_content(); that.header.select_tab(); } @@ -459,7 +458,7 @@ exp.facet = IPA.facet = function(spec, no_init) { }; that.hide = function() { - that.domNode.css('display', 'none'); + that.domNode.removeClass('active-facet'); }; that.load = function(data) { diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 24f450e7..8d54b66e 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -1232,6 +1232,7 @@ IPA.error_dialog = function(spec) { spec = spec || {}; spec.id = spec.id || 'error_dialog'; + spec.name = 'error_dialog'; spec.title = spec.error_thrown.name; var that = IPA.dialog(spec); diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 62a71f0a..06fcef56 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -1561,7 +1561,8 @@ IPA.table_widget = function (spec) { container.addClass('table-widget'); that.table = $('', { - 'class': 'search-table' + 'class': 'search-table', + name: that.name }).appendTo(container); if (that['class']) that.table.addClass(that['class']); -- cgit