From 64e87d5e34f646f0de5b0b310ccaf02cbb119a2b Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 14 May 2015 16:54:02 +0200 Subject: [PATCH] webui: extend user deleter dialog with --permanent and --preserve options Reviewed-By: David Kupka Reviewed-By: Thierry Bordaz --- install/ui/src/freeipa/user.js | 58 +++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js index 787e95f8f..1ee5a28c2 100644 --- a/install/ui/src/freeipa/user.js +++ b/install/ui/src/freeipa/user.js @@ -112,7 +112,10 @@ return { label: '@i18n:buttons.enable', icon: 'fa-check' } - ] + ], + deleter_dialog: { + $factory: IPA.user.deleter_dialog + } }, { $type: 'details', @@ -688,6 +691,59 @@ IPA.user.self_service_other_user_evaluator = function(spec) { return that; }; +IPA.user.deleter_dialog = function(spec) { + + spec = spec || {}; + + var that = IPA.search_deleter_dialog(spec); + + /** + * Adds options to user-del command + * @type {IPA.radio_widget} + */ + that.option_radio = null; + + that.create_content = function() { + + that.deleter_dialog_create_content(); + + that.option_layout = IPA.fluid_layout({ + label_cls: 'col-sm-3', + widget_cls: 'col-sm-9' + }); + + that.option_radio = IPA.radio_widget({ + name: 'deletemode', + label: 'Delete mode', + options: [ + { label: 'default', value: '' }, + { label: 'delete permanently', value: 'permanently' }, + { label: 'preserve', value: 'preserve' } + ] + }); + + var html = that.option_layout.create([that.option_radio]); + that.container.append(html); + that.option_radio.set_value(['']); + }; + + that.create_command = function() { + var batch = that.search_deleter_dialog_create_command(); + var option = that.option_radio.get_value()[0]; + + if (option) { + for (var i=0; i