-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[FIX] Adding error message for wrong dates #21677
Conversation
app/api/server/v1/rooms.js
Outdated
@@ -407,6 +407,10 @@ API.v1.addRoute('rooms.export', { authRequired: true }, { | |||
throw new Meteor.Error('error-invalid-format'); | |||
} | |||
|
|||
if (dateFrom > dateTo) { | |||
throw new Meteor.Error('error-invalid-dates'); |
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.
Can you please add a translation (or descriptive message) to this error? :D
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.
@KevLehman I have added a proper descriptive message for the error. Please review 😁
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.
When I talked about translation, i was referring to add an entry on the i18n
files for the error message (at least in english) 😬
https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-i18n/i18n/en.i18n.json
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.
Oh sorry, I didn't get you @KevLehman. I have made the changes accordingly. Hopefully this time it is right. Please Review 😀
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.
Left a comment with the changes requested 😬
I have made the changes requested @KevLehman |
Hey @shrinish123 , are you still around this PR to fix the conflicts? 👀 (if not, i'll try to fix them on your branch 😬 ) |
Co-authored-by: Kevin Aleman <kaleman960@gmail.com> Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
In the export messages, we can add a from a date later than the to date and it still gives a success message, I added an error check if the from date is greater than the to date.
Proposed changes (including videos or screenshots)
Before :
After:
Issue(s)
Closes #21676
Closes #24956
Steps to test or reproduce
Go to export messages and then select type as HTML, and try to set a from a date later than the to date.
Further comments
The error message I have added is temporary, please suggest what should the correct message be.