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

Transplanting Report: Editing Transplanting Logs Does not Update them in the Backend #562

Closed
FutzMonitor opened this issue Jul 26, 2022 · 3 comments · Fixed by #615
Closed
Assignees
Labels
bug Something isn't working

Comments

@FutzMonitor
Copy link
Collaborator

FutzMonitor commented Jul 26, 2022

Current Behavior

  1. Visit the Transplanting Sub-tab under the Barnkit module.
  2. Generate a report from 05/04/2020 to 05/04/2020.
  3. Click the edit button and change the date, crop, area, trays, and user then click the save button.
  4. Visit Hoppscotch and using the GET function enter this link in the URL: http://localhost/log/1183
  5. Verify that the data that you changed inside of the Transplanting Report has not changed (date changes timestamp, area changes can be seen inside of movement, crop changes can be see at the bottom with the data crop_tid, and user can be found inside of the log owner array).

image
Changes on the frontend are visible

image
Changes have not actually been made in the backend (trays for example is still 8 despite being 60 in the report)

Desired Behavior

The desired behavior would be that the user can change the date, crop, area, trays, and user and those changes are actually reflected in the backend. Currently the user is allowed to change the value inside of Bed Feet, but it might not be worth allowing them to do this because the backend doesn't have a quantity for this anyway. Additionally, changing Row Feet recalculates Bed Feet anyway. It would be worth testing if the transplanting report, after fixing the backend updates, suffers from similar bugs that the Seeding Report suffers from. This includes:

  1. Changing an area and a quantity causes a 422 status code
  2. Making sure that changing the quantity along with date, crop, area, comments, and user actually updates the frontend appropriately (Seeding Report had an issue where frontend was not being updated correctly when a quantity and another element were changed at the same time)

The Cypress e2e file for this should also be updated with a more rigorous testing suite.

Afterword

Pull request #551 is a good place to look into for people seeking to solve this issue. It confronts the exact same issue except for the Seeding Report.

@braughtg braughtg added the bug Something isn't working label Jul 27, 2022
@FutzMonitor
Copy link
Collaborator Author

FutzMonitor commented Dec 16, 2022

Since all the e2e tests have broken since the vnc update should this issue wait until #578 is completed?

@braughtg
Copy link
Member

Since all the e2e tests have broken since the vnc update should this issue wait until #578 is completed?

I think these two could be done in either order.

@FutzMonitor
Copy link
Collaborator Author

I can tackle this issue.

braughtg pushed a commit that referenced this issue Jan 18, 2023
__Pull Request Description__

Closes #562. This issue makes some changes to the `updateRow` function
located in the Transplanting Report HTML file
[[here](https://github.com/FarmData-2-Dev-Team-2022/FarmData2/blob/fixTransplantingBackend/farmdata2/farmdata2_modules/fd2_barn_kit/transplantingReport/transplantingReport.html)].
These changes are not accompanied by any Cypress e2e testing as that is
a separate issue to be addressed in issue #578. As a result, these
changes have been tested by sight using Hoppscotch.

Additionally, this PR makes a quick fix of the filters for both the
Seeding Report and Transplanting Report where editing once would
permanently disable the filters until the page was refreshed because the
name of the edit cancellation event was changed and the pages were not
updated accordingly to reflect this change.

This PR also brings up the topic of #585 (and #466) of what should be
edit-able. I disabled the ability to edit `bed feet` in the
Transplanting Report because transplanting logs don't have quantity data
for `bed feet` but also enabled the ability to edit `row/bed` because
that does exist in the logs' quantity data. However, should users be
allowed to edit that data? This is beyond the scope of this PR but
wanted to quickly mention this quick thought that occurred to me whilst
making this fix.

---
__Licensing Certification__

FarmData2 is a [Free Cultural
Work](https://freedomdefined.org/Definition) and all accepted
contributions are licensed as described in the LICENSE.md file. This
requires that the contributor holds the rights to do so. By submitting
this pull request __I certify that I satisfy the terms of the [Developer
Certificate of Origin](https://developercertificate.org/)__ for its
contents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants