app/assets/javascripts/bastion/components/notification.service.js in bastion-6.1.15 vs app/assets/javascripts/bastion/components/notification.service.js in bastion-6.1.16
- old
+ new
@@ -14,11 +14,18 @@
}
return result;
}
- this.setSuccessMessage = function (message, context) {
- foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'success'});
+ this.setSuccessMessage = function (message, options) {
+ var baseOptions, fullOptions;
+ /* eslint-disable no-unused-expressions */
+ (angular.isUndefined(options)) && (options = {});
+ /* eslint-enable no-unused-expressions */
+ baseOptions = { message: interpolateIfNeeded(message, options.context), type: 'success' };
+ delete options.context;
+ fullOptions = _.extend(baseOptions, options);
+ foreman.toastNotifications.notify(fullOptions);
};
this.setWarningMessage = function (message, context) {
foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'warning'});
};