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

Lf 3773 the user is able to edit the already deleted expense #3293

Conversation

gursimran-singh
Copy link
Collaborator

Description

When two users are logged on to the same farm and one user begins to edit the expense while another user delete/retire the same expense, the first uses is able to save the expense even if it is deleted. It was expected that the user won’t have a possibility to edit the already deleted expense. In this case an error snackbar message should be displayed.

Jira link:https://lite-farm.atlassian.net/browse/LF-3773

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Login with two different users the onto same farm and try to edit the expense. Meanwhile, if another user delete the same expense, then first user will get an error message explaining the situation on saving the expense.

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@gursimran-singh gursimran-singh requested review from a team as code owners July 12, 2024 21:41
@gursimran-singh gursimran-singh requested review from Duncan-Brain and SayakaOno and removed request for a team July 12, 2024 21:41
Copy link
Collaborator

@Duncan-Brain Duncan-Brain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works really well for me and fixes the error well.

I was actually seeing a different scenario than the Jira ticket -- on integration I see both a success and an error message with he database successfully updating.

The get method in the saga after success snackbar was failing and so after the success message runs I would see the error message too.

My only concern is the length of the message being too long for the duration of the snackbar!

packages/webapp/public/locales/en/message.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@Duncan-Brain I tried running pnpm i18n to sort the translation keys alphabetically, but it made a lot of changes (it replaced the space before "?" in fr with \u00a0, and added SPECIES_COUNT_many). I will bring this up in the tech daily on Tuesday to hear your suggestions!

@Duncan-Brain
Copy link
Collaborator

Thanks Gursimran!

@SayakaOno SayakaOno added this pull request to the merge queue Aug 2, 2024
Merged via the queue into integration with commit 6e366df Aug 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants