From fd1d0857b5b559425668f38d85a7d607d0f35767 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 28 Jan 2011 15:52:26 -0500 Subject: unmatched aciattrs instead of reporting an error on unmatched aciattrs, append them to the table. --- install/ui/aci.js | 26 +++++++++++++++++++++++--- install/ui/entity.js | 2 +- install/ui/search.js | 8 ++++---- 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('Attribute'); 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 = $('').appendTo(tbody); + td = $('').appendTo(aci_tr); + td.append($('',{ + type:"checkbox", + checked: true, + id:'aciattr-'+unmatched[u].toLowerCase(), + "class":'aci-attribute' + })); + td = $('').appendTo(aci_tr); + td.append($('