mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
unmatched aciattrs
instead of reporting an error on unmatched aciattrs, append them to the table.
This commit is contained in:
parent
3625a1e88a
commit
fd1d0857b5
@ -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(/,/);
|
||||
|
@ -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;
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user