mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
WebUI: Add Custom command multivalued adder dialog
Adder dialog which is used along with custom_command_multivalued_widget. It behaivor of confirm dialog and adds fields which are necessary. Part of: https://fedorahosted.org/freeipa/ticket/6601 Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
fba318b833
commit
d3700275c1
@ -1451,6 +1451,40 @@ IPA.confirm_dialog = function(spec) {
|
|||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom command multivalued dialog
|
||||||
|
*
|
||||||
|
* Combines confirmation dialog which could be reopen after unsucessful command
|
||||||
|
* call. It also allows to define fields and widgets in the dialog.
|
||||||
|
*
|
||||||
|
* Acceptation is done by clicking on 'Add' button or hitting 'ENTER' key,
|
||||||
|
* refusal by clicking on 'Cancel' button or hitting 'ESCAPE' key.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @extends IPA.form_dialog
|
||||||
|
*/
|
||||||
|
IPA.custom_command_multivalued_dialog = function(spec) {
|
||||||
|
spec = spec || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of confirmation button, by default set to 'Add'.
|
||||||
|
* @param {String} ok_label
|
||||||
|
*/
|
||||||
|
spec.ok_label = spec.ok_label || '@i18n:buttons.add';
|
||||||
|
|
||||||
|
var that = IPA.form_dialog(spec);
|
||||||
|
|
||||||
|
that.close = function() {
|
||||||
|
that.dialog_close();
|
||||||
|
};
|
||||||
|
|
||||||
|
that.on_confirm = function() {
|
||||||
|
if (that.on_ok) that.on_ok();
|
||||||
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user