Skip to content
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

Merged
merged 5 commits into from
Nov 6, 2022
Merged

[FIX] Adding error message for wrong dates #21677

merged 5 commits into from
Nov 6, 2022

Conversation

shrinish123
Copy link
Contributor

@shrinish123 shrinish123 commented Apr 20, 2021

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 :
before

After:

after export

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.

@@ -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');
Copy link
Contributor

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

Copy link
Contributor Author

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 😁

Copy link
Contributor

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

Copy link
Contributor Author

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 😀

Copy link
Contributor

@KevLehman KevLehman left a 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 😬

@shrinish123
Copy link
Contributor Author

Left a comment with the changes requested 😬

I have made the changes requested @KevLehman

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

@ggazzo ggazzo added this to the 5.4.0 milestone Nov 2, 2022
@KevLehman
Copy link
Contributor

Hey @shrinish123 , are you still around this PR to fix the conflicts? 👀

(if not, i'll try to fix them on your branch 😬 )

@ggazzo ggazzo merged commit 1a12542 into RocketChat:develop Nov 6, 2022
MartinSchoeler pushed a commit that referenced this pull request Nov 28, 2022
Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
@ggazzo ggazzo mentioned this pull request Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants