webui: adjust user deleter dialog to new api

In user_del, flags 'permanently' and 'preserve' were replaced with single
bool option 'preserve'

part of: https://fedorahosted.org/freeipa/ticket/3813

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Petr Vobornik
2015-06-18 12:59:05 +02:00
parent 1d60825138
commit baca55c665
4 changed files with 18 additions and 14 deletions

View File

@@ -833,13 +833,13 @@ IPA.user.deleter_dialog = function(spec) {
});
that.option_radio = IPA.radio_widget({
name: 'deletemode',
label: 'Delete mode',
name: 'preserve',
label: '@i18n:objects.user.delete_mode',
options: [
{ label: 'default', value: '' },
{ label: 'delete permanently', value: 'permanently' },
{ label: 'preserve', value: 'preserve' }
]
{ label: '@i18n:objects.user.mode_delete', value: 'false' },
{ label: '@i18n:objects.user.mode_preserve', value: 'true' }
],
default_value: 'false'
});
var html = that.option_layout.create([that.option_radio]);
@@ -849,13 +849,11 @@ IPA.user.deleter_dialog = function(spec) {
that.create_command = function() {
var batch = that.search_deleter_dialog_create_command();
var option = that.option_radio.get_value()[0];
var preserve = that.option_radio.get_value()[0];
if (option) {
for (var i=0; i<batch.commands.length; i++) {
var command = batch.commands[i];
command.set_option(option, true);
}
for (var i=0; i<batch.commands.length; i++) {
var command = batch.commands[i];
command.set_option('preserve', preserve);
}
return batch;

View File

@@ -1425,8 +1425,8 @@ IPA.option_widget_base = function(spec, that) {
// classic properties
that.name = spec.name;
that.label = spec.label;
that.title = spec.title;
that.label = text.get(spec.label);
that.title = text.get(spec.title);
that.sort = spec.sort === undefined ? false : spec.sort;
that.value_changed = that.value_changed || IPA.observer();

View File

@@ -578,11 +578,14 @@
"account_status": "Account Status",
"activeuser_label": "Active users",
"contact": "Contact Settings",
"delete_mode": "Delete mode",
"employee": "Employee Information",
"error_changing_status": "Error changing account status",
"krbpasswordexpiration": "Password expiration",
"mailing": "Mailing Address",
"misc": "Misc. Information",
"mode_delete": "delete",
"mode_preserve": "preserve",
"noprivate": "No private group",
"status_confirmation": "Are you sure you want to ${action} the user?<br/>The change will take effect immediately.",
"status_link": "Click to ${action}",