From 95ea68a2175cc1bec0dbb901311e40f55b692c42 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 6 Dec 2010 13:51:49 -0600 Subject: Column i18n The ipa_column has been modified to get the label from metadata during initialization. The ipa_table_widget has been modified to initialize the columns. Hard-coded labels have been removed from column declarations. The ipa_adder_dialog has been modified to execute a search at the end of setup. --- install/static/associate.js | 37 +- install/static/group.js | 13 +- install/static/hbac.js | 16 +- install/static/hbacsvc.js | 8 +- install/static/hbacsvcgroup.js | 12 +- install/static/host.js | 5 +- install/static/search.js | 11 +- install/static/service.js | 9 +- install/static/sudocmd.js | 8 +- install/static/sudocmdgroup.js | 12 +- install/static/sudorule.js | 12 +- install/static/test/data/ipa_init.json | 1875 +++++++++++++++++++++++++++++++- install/static/widget.js | 41 +- 13 files changed, 1932 insertions(+), 127 deletions(-) (limited to 'install/static') diff --git a/install/static/associate.js b/install/static/associate.js index 1a96362f5..48bb0225f 100644 --- a/install/static/associate.js +++ b/install/static/associate.js @@ -153,15 +153,9 @@ function ipa_association_adder_dialog(spec) { } that.adder_dialog_init(); - execute_search(''); - }; that.search = function() { - execute_search(that.get_filter()); - }; - - function execute_search(filter){ function on_success(data, text_status, xhr) { var results = data.result; that.clear_available_values(); @@ -172,8 +166,8 @@ function ipa_association_adder_dialog(spec) { } } - ipa_cmd('find', [filter], {'all': true}, on_success, null, that.other_entity); - } + ipa_cmd('find', [that.get_filter()], {'all': true}, on_success, null, that.other_entity); + }; return that; } @@ -250,7 +244,6 @@ function ipa_association_table_widget(spec) { }; that.add_adder_column = function(column) { - column.entity_name = that.entity_name; that.adder_columns.push(column); that.adder_columns_by_name[column.name] = column; }; @@ -284,6 +277,16 @@ function ipa_association_table_widget(spec) { }); } + for (var i=0; i', { @@ -927,7 +939,6 @@ function ipa_adder_dialog(spec) { }; that.add_column = function(column) { - column.entity_name = that.entity_name; that.columns.push(column); that.columns_by_name[column.name] = column; }; @@ -959,6 +970,8 @@ function ipa_adder_dialog(spec) { that.available_table.set_columns(that.columns); + that.available_table.init(); + that.selected_table = ipa_table_widget({ name: 'selected', scrollable: true, @@ -966,6 +979,8 @@ function ipa_adder_dialog(spec) { }); that.selected_table.set_columns(that.columns); + + that.selected_table.init(); }; that.create = function() { @@ -1081,6 +1096,8 @@ function ipa_adder_dialog(spec) { } }); button.replaceWith(that.add_button); + + that.search(); }; that.open = function(container) { -- cgit