mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Disable enroll button if nothing selected.
A new IPA.dialog_button class has been added to encapsulate the buttons in the dialog box so they can be managed more easily. The adder dialog has been modified to disable the enroll button if there is no entries selected. Ticket #1856
This commit is contained in:
@@ -609,33 +609,41 @@ IPA.sudo.options_section = function(spec) {
|
||||
label: label
|
||||
}));
|
||||
|
||||
dialog.add_button(IPA.messages.buttons.add, function() {
|
||||
var value = ipasudoopt.save()[0];
|
||||
dialog.create_button({
|
||||
name: 'add',
|
||||
label: IPA.messages.buttons.add,
|
||||
click: function() {
|
||||
var value = ipasudoopt.save()[0];
|
||||
|
||||
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
||||
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
||||
|
||||
var command = IPA.command({
|
||||
entity: 'sudorule',
|
||||
method: 'add_option',
|
||||
args: [pkey],
|
||||
options: {
|
||||
ipasudoopt: value
|
||||
},
|
||||
on_success: function(data) {
|
||||
that.load(data.result.result);
|
||||
dialog.close();
|
||||
},
|
||||
on_error: function(data) {
|
||||
that.update();
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
var command = IPA.command({
|
||||
entity: 'sudorule',
|
||||
method: 'add_option',
|
||||
args: [pkey],
|
||||
options: {
|
||||
ipasudoopt: value
|
||||
},
|
||||
on_success: function(data) {
|
||||
that.load(data.result.result);
|
||||
dialog.close();
|
||||
},
|
||||
on_error: function(data) {
|
||||
that.update();
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
|
||||
command.execute();
|
||||
command.execute();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.add_button(IPA.messages.buttons.cancel, function() {
|
||||
dialog.close();
|
||||
dialog.create_button({
|
||||
name: 'cancel',
|
||||
label: IPA.messages.buttons.cancel,
|
||||
click: function() {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.open(that.container);
|
||||
|
||||
Reference in New Issue
Block a user