diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-05-14 16:54:02 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-05-20 14:04:10 +0200 |
commit | 64e87d5e34f646f0de5b0b310ccaf02cbb119a2b (patch) | |
tree | 7c2635597e0afe20b6e409e947bef67e8f306e3a /install/ui/src/freeipa | |
parent | 14525598f97f57d165682247ef7f5cf63f810be5 (diff) | |
download | freeipa-64e87d5e34f646f0de5b0b310ccaf02cbb119a2b.tar.gz freeipa-64e87d5e34f646f0de5b0b310ccaf02cbb119a2b.tar.xz freeipa-64e87d5e34f646f0de5b0b310ccaf02cbb119a2b.zip |
webui: extend user deleter dialog with --permanent and --preserve options
Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r-- | install/ui/src/freeipa/user.js | 58 |
1 files changed, 57 insertions, 1 deletions
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<batch.commands.length; i++) { + var command = batch.commands[i]; + command.set_option(option, true); + } + } + + return batch; + }; + + return that; +}; + exp.entity_spec = make_spec(); exp.register = function() { var e = reg.entity; |