diff options
author | Adam Young <ayoung@redhat.com> | 2011-01-28 15:52:26 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-01-28 17:01:19 -0500 |
commit | fd1d0857b5b559425668f38d85a7d607d0f35767 (patch) | |
tree | 771d613acb5bada684bbf766228aa0579d07ab18 | |
parent | 3625a1e88afd26e3694d33f3a491824ba0d1f9e3 (diff) | |
download | freeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.tar.gz freeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.tar.xz freeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.zip |
unmatched aciattrs
instead of reporting an error on unmatched aciattrs, append them to the table.
-rw-r--r-- | install/ui/aci.js | 26 | ||||
-rw-r--r-- | install/ui/entity.js | 2 | ||||
-rw-r--r-- | install/ui/search.js | 8 | ||||
-rw-r--r-- | install/ui/service.js | 8 |
4 files changed, 32 insertions, 12 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js index 92440dfa5..3f56cbed6 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -78,6 +78,7 @@ IPA.attribute_table_widget= function (spec){ append('<th class="aci-attribute-column">Attribute</th>'); IPA.populate_attribute_table(table, object_type); + that.table = table; }; that.save = function(){ @@ -402,10 +403,10 @@ IPA.target_section = function () { })); } - var attribute_table = IPA.attribute_table_widget( + that.attribute_table = IPA.attribute_table_widget( {name:'aci_attributes_table',object_type:'user'}); - attribute_table.create(dl); + that.attribute_table.create(dl); } @@ -534,13 +535,32 @@ IPA.target_section = function () { IPA.populate_attribute_table($('#aci_attributes_table'), result.type); if (result.attrs){ + var unmatched = []; + for (var a = 0; a < result.attrs.length; a += 1){ var cb = $('#aciattr-'+result.attrs[a]); if (!cb.length){ - alert('unmatched:'+result.attrs[a]); + unmatched.push(result.attrs[a]); } cb.attr('checked',true); } + if (unmatched.length > 0){ + var tbody = $('tbody',that.attribute_table.table); + var td; + for (var u = 0; u < unmatched.length ; u += 1){ + var aci_tr = $('<tr/>').appendTo(tbody); + td = $('<td/>').appendTo(aci_tr); + td.append($('<input/>',{ + type:"checkbox", + checked: true, + id:'aciattr-'+unmatched[u].toLowerCase(), + "class":'aci-attribute' + })); + td = $('<td/>').appendTo(aci_tr); + td.append($('<label/>',{ + text:unmatched[u].toLowerCase()})); + } + } } }else if (result.targetgroup){ var segments = result.targetgroup.split(/,/); diff --git a/install/ui/entity.js b/install/ui/entity.js index ec4a2adc1..7f195a147 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -112,7 +112,7 @@ IPA.entity = function (spec) { that.add_dialog = function(dialog) { return that.dialog(dialog); - } + }; that.dialog = function(dialog) { dialog.entity_name = that.name; diff --git a/install/ui/search.js b/install/ui/search.js index 20a6f51fc..d675e0d3a 100644 --- a/install/ui/search.js +++ b/install/ui/search.js @@ -102,7 +102,7 @@ IPA.search_widget = function (spec) { button = $('input[name=remove]', search_buttons); that.remove_button = IPA.action_button({ 'label': IPA.messages.button.remove, - 'icon': 'ui-icon-trash', + 'icon': 'ui-icon-trash' }); that.remove_button.addClass('input_link_disabled'); @@ -158,14 +158,14 @@ IPA.search_widget = function (spec) { $('input', action_panel).val(null); } - + var remove_button; if(count === 0){ - var remove_button = $('a[title=Delete]', action_panel); + remove_button = $('a[title=Delete]', action_panel); remove_button.addClass('input_link_disabled'); remove_button.unbind('click'); }else{ - var remove_button = $('a[title=Delete]', action_panel); + remove_button = $('a[title=Delete]', action_panel); remove_button.click(function() { that.remove(that.container); }); remove_button.removeClass('input_link_disabled'); } diff --git a/install/ui/service.js b/install/ui/service.js index 2352fa42d..daa38b2bb 100644 --- a/install/ui/service.js +++ b/install/ui/service.js @@ -43,8 +43,8 @@ IPA.entity_factories.service = function () { facet( IPA.service_details_facet()). facet( IPA.service_managedby_host_facet({ 'name': 'managedby_host', - 'label': IPA.messages.association.managedby - +' '+IPA.metadata['host'].label, + 'label': IPA.messages.association.managedby + + ' '+IPA.metadata['host'].label, 'other_entity': 'host' })); }; @@ -71,11 +71,11 @@ IPA.service_select_widget = function (spec){ } container.append(select_widget); that.parent_create(container); - } + }; return that; -} +}; /*TODO: the following labels etc. all need to be replaced with I18N strings */ |