diff options
author | Pavel Vomacka <pvomacka@redhat.com> | 2016-08-22 14:45:14 +0200 |
---|---|---|
committer | Martin Babinsky <mbabinsk@redhat.com> | 2016-09-08 09:44:20 +0200 |
commit | c3374c6e16a10e8780401c58c04dcf8d95ea1a4d (patch) | |
tree | 18a52918bdf8197308ab79d9ad6a40ff20e16aab /install/ui/src | |
parent | b232ad463cf43596cdf397e51469df13a89e83fa (diff) | |
download | freeipa-c3374c6e16a10e8780401c58c04dcf8d95ea1a4d.tar.gz freeipa-c3374c6e16a10e8780401c58c04dcf8d95ea1a4d.tar.xz freeipa-c3374c6e16a10e8780401c58c04dcf8d95ea1a4d.zip |
Add 'Restore' option to action dropdown menu
Also moving activate_action method several lines up - correcting logical order of methods.
https://fedorahosted.org/freeipa/ticket/5818
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'install/ui/src')
-rw-r--r-- | install/ui/src/freeipa/stageuser.js | 37 | ||||
-rw-r--r-- | install/ui/src/freeipa/user.js | 6 |
2 files changed, 34 insertions, 9 deletions
diff --git a/install/ui/src/freeipa/stageuser.js b/install/ui/src/freeipa/stageuser.js index bd563847b..bf244914e 100644 --- a/install/ui/src/freeipa/stageuser.js +++ b/install/ui/src/freeipa/stageuser.js @@ -364,6 +364,26 @@ stageuser.batch_activate_action = function(spec) { return IPA.batch_items_action(spec); }; +stageuser.activate_action = function(spec) { + spec = spec || {}; + spec.name = spec.name || 'activate'; + spec.method = spec.method || 'activate'; + spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true; + spec.confirm_msg = spec.confirm_msg || '@i18n:objects.stageuser.activate_one_confirm'; + spec.label = spec.label || '@i18n:buttons.activate'; + + var that = IPA.object_action(spec); + + that.on_success = function(facet, data, text_status, xhr) { + + IPA.notify_success(data.result.summary); + facet.on_update.notify(); + facet.redirect(); + }; + + return that; +}; + stageuser.batch_undel_action = function(spec) { spec = spec || {}; @@ -379,18 +399,18 @@ stageuser.batch_undel_action = function(spec) { return IPA.batch_items_action(spec); }; -stageuser.activate_action = function(spec) { +stageuser.undel_action = function(spec) { spec = spec || {}; - spec.name = spec.name || 'activate'; - spec.method = spec.method || 'activate'; - spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true; - spec.confirm_msg = spec.confirm_msg || '@i18n:objects.stageuser.activate_one_confirm'; - spec.label = spec.label || '@i18n:buttons.activate'; + + spec.name = spec.name || 'undel'; + spec.method = spec.method || 'undel'; + spec.needs_confirm = spec.needs_confirm === undefined ? true : spec.needs_confirm; + spec.confirm_msg = spec.confirm_msg || '@i18n:objects.stageuser.undel_one_confirm'; + spec.label = spec.label || '@i18n:buttons.restore'; var that = IPA.object_action(spec); that.on_success = function(facet, data, text_status, xhr) { - IPA.notify_success(data.result.summary); facet.on_update.notify(); facet.redirect(); @@ -451,8 +471,9 @@ stageuser.register = function() { var e = reg.entity; var f = reg.facet; a.register('batch_activate', stageuser.batch_activate_action); - a.register('batch_undel', stageuser.batch_undel_action); a.register('activate', stageuser.activate_action); + a.register('batch_undel', stageuser.batch_undel_action); + a.register('undel', stageuser.undel_action); a.register('batch_stage', stageuser.batch_stage_action); a.register('stage', stageuser.stage_action); e.register({type: 'stageuser', spec: stageuser.stageuser_spec}); diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js index 0bebf443a..e3eda509f 100644 --- a/install/ui/src/freeipa/user.js +++ b/install/ui/src/freeipa/user.js @@ -373,6 +373,10 @@ return { show_cond: ['preserved-user'] }, { + $type: 'undel', + show_cond: ['preserved-user'] + }, + { $type: 'stage', show_cond: ['preserved-user'] }, @@ -401,7 +405,7 @@ return { } ], header_actions: [ - 'reset_password', 'enable', 'disable', 'stage', + 'reset_password', 'enable', 'disable', 'stage', 'undel', 'delete_active_user', 'delete', 'unlock', 'add_otptoken', 'automember_rebuild', 'request_cert' ], |