mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
WebUI: Add support for suppressing warnings
Each command can have specified an array of warning codes which will be suppressed and won't be shown. For specifying this it is necessary to set command property 'supressed_warnings: [codes_of_warning]' Part of: https://pagure.io/freeipa/issue/6618 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
@@ -71,6 +71,12 @@ rpc.command = function(spec) {
|
|||||||
/** @property {Object} options Option map */
|
/** @property {Object} options Option map */
|
||||||
that.options = $.extend({}, spec.options || {});
|
that.options = $.extend({}, spec.options || {});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {Array} suppress_warnings array of message codes which
|
||||||
|
* are suppressed
|
||||||
|
*/
|
||||||
|
that.suppress_warnings = spec.suppress_warnings || [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Success handler
|
* Success handler
|
||||||
* @property {Function}
|
* @property {Function}
|
||||||
@@ -219,6 +225,7 @@ rpc.command = function(spec) {
|
|||||||
|
|
||||||
for (var i=0,l=msgs.length; i<l; i++) {
|
for (var i=0,l=msgs.length; i<l; i++) {
|
||||||
var msg = lang.clone(msgs[i]);
|
var msg = lang.clone(msgs[i]);
|
||||||
|
if (that.suppress_warnings.indexOf(msg.code) > -1) continue;
|
||||||
// escape and reformat message
|
// escape and reformat message
|
||||||
msg.message = util.beautify_message(msg.message);
|
msg.message = util.beautify_message(msg.message);
|
||||||
IPA.notify(msg.message, msg.type);
|
IPA.notify(msg.message, msg.type);
|
||||||
|
|||||||
Reference in New Issue
Block a user