-
-
Notifications
You must be signed in to change notification settings - Fork 754
Add descriptive error messages #1789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+ reuse message from #1762
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better limit_error
message
customize.dist/messages.js
Outdated
@@ -118,6 +118,10 @@ define(req, function(AppConfig, Default, Language) { | |||
|
|||
Messages._languages = map; | |||
Messages._languageUsed = language; | |||
Messages.admin_logoSize_error = "The logo size must be smaller than 200KB"; // XXX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value "200KB" should be passed from the code as a value, with the placeholder "{0}" in the translated string
www/admin/inner.js
Outdated
@@ -884,6 +884,11 @@ define([ | |||
UI.warn(Messages.error); | |||
return; | |||
} | |||
if (files[0].size > 200 * 1024) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a variable here, same one that should be passed to the message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max file size variable added @davidbenque
customize.dist/messages.js
Outdated
|
||
Messages._languages = map; | ||
Messages._languageUsed = language; | ||
Messages.admin_logoSize_error = "The logo size must be smaller than 200KB"; // XXX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Messages._languages = map; | |
Messages._languageUsed = language; | |
Messages.admin_logoSize_error = "The logo size must be smaller than 200KB"; // XXX | |
let maxLogoSize = 200; | |
Messages._languages = map; | |
Messages._languageUsed = language; | |
Messages.admin_logoSize_error = `The logo size must be smaller than ${maxLogoSize}KB`; // XXX |
www/admin/inner.js
Outdated
@@ -884,6 +884,11 @@ define([ | |||
UI.warn(Messages.error); | |||
return; | |||
} | |||
if (files[0].size > 200 * 1024) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (files[0].size > 200 * 1024) { | |
let maxLogoSizeMb = 200 * 1024; | |
if (files[0].size > maxLogoSizeMb) { |
This PR adds descriptive error message in multiple areas: