Do not display success message on failure in web UI
https://fedorahosted.org/freeipa/ticket/3591
This commit is contained in:
1 parent
5b58348cd3
commit
8d07054e1b
5 files changed
+53
-22
No files matched your search
@@ -1025,10 +1025,22 @@ IPA.association_facet = function (spec, no_init) {
|
||||
other_entity: that.other_entity,
|
||||
values: dialog.get_selected_values(),
|
||||
method: that.add_method,
|
||||
on_success: function() {
|
||||
on_success: function(data) {
|
||||
that.refresh();
|
||||
dialog.close();
|
||||
IPA.notify_success('@i18n:association.added');
|
||||
var succeeded = data.result.completed;
|
||||
|
||||
if (!succeeded) {
|
||||
succeeded = 0;
|
||||
for (var i = 0; i< data.result.results.length; i++) {
|
||||
if (data.result.results[i].completed === 1) {
|
||||
succeeded++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var msg = text.get('@i18n:association.added').replace('${count}', succeeded);
|
||||
IPA.notify_success(msg);
|
||||
},
|
||||
on_error: function() {
|
||||
that.refresh();
|
||||
@@ -1077,9 +1089,22 @@ IPA.association_facet = function (spec, no_init) {
|
||||
other_entity: that.other_entity,
|
||||
values: values,
|
||||
method: that.remove_method,
|
||||
on_success: function() {
|
||||
on_success: function(data) {
|
||||
that.refresh();
|
||||
IPA.notify_success('@i18n:association.removed');
|
||||
|
||||
var succeeded = data.result.completed;
|
||||
|
||||
if (!succeeded) {
|
||||
succeeded = 0;
|
||||
for (var i = 0; i< data.result.results.length; i++) {
|
||||
if (data.result.results[i].completed === 1) {
|
||||
succeeded++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var msg = text.get('@i18n:association.removed').replace('${count}', succeeded);
|
||||
IPA.notify_success(msg);
|
||||
},
|
||||
on_error: function() {
|
||||
that.refresh();
|
||||
|
||||
@@ -337,7 +337,9 @@ IPA.search_deleter_dialog = function(spec) {
|
||||
batch.on_success = function(data, text_status, xhr) {
|
||||
that.facet.refresh();
|
||||
that.facet.on_update.notify([],that.facet);
|
||||
IPA.notify_success('@i18n:search.deleted');
|
||||
var succeeded = batch.commands.length - batch.errors.errors.length;
|
||||
var msg = text.get('@i18n:search.deleted').replace('${count}', succeeded);
|
||||
IPA.notify_success(msg);
|
||||
};
|
||||
|
||||
batch.on_error = function() {
|
||||
|
||||
@@ -881,18 +881,22 @@ IPA.sudo.options_section = function(spec) {
|
||||
on_success: function(data) {
|
||||
//last successful result of batch results contains valid data
|
||||
var result;
|
||||
for(var i = data.result.results.length - 1; i > -1; i--) {
|
||||
result = data.result.results[i].result;
|
||||
if(result) break;
|
||||
var succeeded = 0;
|
||||
|
||||
for (var i = data.result.results.length - 1; i > -1; i--) {
|
||||
var error = data.result.results[i].error;
|
||||
if (!result) result = data.result.results[i].result;
|
||||
if (!error) succeeded++;
|
||||
}
|
||||
|
||||
if(result) {
|
||||
if (result) {
|
||||
that.table.load(result);
|
||||
} else {
|
||||
that.reload();
|
||||
}
|
||||
|
||||
IPA.notify_success('@i18n:objects.sudorule.option_removed');
|
||||
var msg = text.get('@i18n:objects.sudorule.option_removed').replace('${count}', succeeded);
|
||||
IPA.notify_success(msg);
|
||||
},
|
||||
on_error: function(data) {
|
||||
that.reload();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"memberof": "Add ${entity} ${primary_key} into ${other_entity}",
|
||||
"sourcehost": "Add Source ${other_entity} into ${entity} ${primary_key}"
|
||||
},
|
||||
"added": "Items added",
|
||||
"added": "${count} item(s) added",
|
||||
"direct_membership": "Direct Membership",
|
||||
"indirect_membership": "Indirect Membership",
|
||||
"no_entries": "No entries.",
|
||||
@@ -46,7 +46,7 @@
|
||||
"memberof": "Remove ${entity} ${primary_key} from ${other_entity}",
|
||||
"sourcehost": "Remove Source ${other_entity} from ${entity} ${primary_key}"
|
||||
},
|
||||
"removed": "Items removed",
|
||||
"removed": "${count} item(s) removed",
|
||||
"show_results": "Show Results"
|
||||
},
|
||||
"buttons": {
|
||||
@@ -465,7 +465,7 @@
|
||||
"host": "Access this host",
|
||||
"ipaenabledflag": "Rule status",
|
||||
"option_added": "Option added",
|
||||
"option_removed": "Option(s) removed",
|
||||
"option_removed": "${count} option(s) removed",
|
||||
"options": "Options",
|
||||
"runas": "As Whom",
|
||||
"specified_commands": "Specified Commands and Groups",
|
||||
@@ -521,11 +521,11 @@
|
||||
},
|
||||
"search": {
|
||||
"delete_confirm": "Are you sure you want to delete selected entries?",
|
||||
"deleted": "Selected entries were deleted.",
|
||||
"deleted": "${count} item(s) deleted",
|
||||
"disable_confirm": "Are you sure you want to disable selected entries?",
|
||||
"disabled": "${count} items were disabled",
|
||||
"disabled": "${count} item(s) disabled",
|
||||
"enable_confirm": "Are you sure you want to enable selected entries?",
|
||||
"enabled": "${count} items were enabled",
|
||||
"enabled": "${count} item(s) enabled",
|
||||
"partial_delete": "Some entries were not deleted",
|
||||
"quick_links": "Quick Links",
|
||||
"select_all": "Select All",
|
||||
|
||||
@@ -165,7 +165,7 @@ class i18n_messages(Command):
|
||||
"memberdenycmd": _("Add Deny ${other_entity} into ${entity} ${primary_key}"),
|
||||
"memberof": _("Add ${entity} ${primary_key} into ${other_entity}"),
|
||||
},
|
||||
"added": _("Items added"),
|
||||
"added": _("${count} item(s) added"),
|
||||
"direct_membership": _("Direct Membership"),
|
||||
"indirect_membership": _("Indirect Membership"),
|
||||
"no_entries": _("No entries."),
|
||||
@@ -179,7 +179,7 @@ class i18n_messages(Command):
|
||||
"memberdenycmd": _("Remove Deny ${other_entity} from ${entity} ${primary_key}"),
|
||||
"memberof": _("Remove ${entity} ${primary_key} from ${other_entity}"),
|
||||
},
|
||||
"removed": _("Items removed"),
|
||||
"removed": _("${count} item(s) removed"),
|
||||
"show_results": _("Show Results"),
|
||||
},
|
||||
"buttons": {
|
||||
@@ -601,7 +601,7 @@ class i18n_messages(Command):
|
||||
"host": _("Access this host"),
|
||||
"ipaenabledflag": _("Rule status"),
|
||||
"option_added": _("Option added"),
|
||||
"option_removed": _("Option(s) removed"),
|
||||
"option_removed": _("${count} option(s) removed"),
|
||||
"options": _("Options"),
|
||||
"runas": _("As Whom"),
|
||||
"specified_commands": _("Specified Commands and Groups"),
|
||||
@@ -657,11 +657,11 @@ class i18n_messages(Command):
|
||||
},
|
||||
"search": {
|
||||
"delete_confirm": _("Are you sure you want to delete selected entries?"),
|
||||
"deleted": _("Selected entries were deleted."),
|
||||
"deleted": _("${count} item(s) deleted"),
|
||||
"disable_confirm": _("Are you sure you want to disable selected entries?"),
|
||||
"disabled": _("${count} items were disabled"),
|
||||
"disabled": _("${count} item(s) disabled"),
|
||||
"enable_confirm": _("Are you sure you want to enable selected entries?"),
|
||||
"enabled": _("${count} items were enabled"),
|
||||
"enabled": _("${count} item(s) enabled"),
|
||||
"partial_delete": _("Some entries were not deleted"),
|
||||
"quick_links": _("Quick Links"),
|
||||
"select_all": _("Select All"),
|
||||
|
||||
Reference in new issue
Block a user