Add automatic invalid form info message

This commit is contained in:
Dennis Eichhorn 2018-06-03 16:48:37 +02:00
parent 727764ec60
commit fa094a1d9f
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,8 @@
jsOMS.Message.Notification.NotificationLevel = Object.freeze({
OK: 'ok',
INFO: 'info',
WARNING: 'warning',
ERROR: 'error'
});
}(window.jsOMS = window.jsOMS || {}));

View File

@ -191,6 +191,10 @@
submitForm (form)
{
if (!form.isValid()) {
this.app.notifyManager.send(
new jsOMS.Message.Notification.NotificationMessage(jsOMS.Message.Notification.NotificationLevel.INFO, 'Info', 'Invalid form input. Please check the form.'), jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION
);
jsOMS.Log.Logger.instance.debug('Form "' + form.getId() + '" has invalid values.');
return;
}