Allow having a custom title of 'Remove' dialog for 'attribute_table' widget

Fixes: https://pagure.io/freeipa/issue/7704
Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-09-19 16:18:28 +03:00 committed by Serhii Tsymbaliuk
parent 79aa59205a
commit c2e6e010b9

View File

@ -4188,6 +4188,7 @@ IPA.attribute_table_widget = function(spec) {
that.attribute_name = spec.attribute_name || that.name;
that.adder_dialog_spec = spec.adder_dialog;
that.deleter_dialog_spec = spec.deleter_dialog;
that.css_class = spec.css_class;
that.add_command = spec.add_command;
@ -4335,9 +4336,17 @@ IPA.attribute_table_widget = function(spec) {
return null;
}
var title;
if (that.deleter_dialog_spec) {
var pkey = that.facet.get_pkey();
title = text.get(that.deleter_dialog_spec.title);
title = title.replace('${primary_key}', pkey);
}
var dialog = IPA.deleter_dialog({
entity: that.entity,
values: selected_values
values: selected_values,
title: title,
});
dialog.execute = function() {