-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Description
The CropSelector component used in the Harvest form has a "+" on the right side that when clicked allows the user to add a new crop (i.e. taxonomy_term--plant_type) to farmOS. The ability to add a crop makes sense for other operations (e.g. seeding), but it does not make sense in the context of a Harvest (if the crop doesn't exit, a plant of that type could not have been planted and thus cannot be harvested).
Steps to Reproduce
- Visit the Harvest form.
Observed behavior
Notice that the "Crop" input has a green "+" button at its right edge, which when clicked will bring up the form to create a new crop.
Expected behavior
The "Crop" input should not have a "+" button at its right edge.
bugInfo.bash output
git remote -v
-------------
origin https://github.com/FarmData2/FarmData2-School.git (fetch)
origin https://github.com/FarmData2/FarmData2-School.git (push)
upstream https://github.com/FarmData2/FarmData2-School.git (fetch)
upstream https://github.com/FarmData2/FarmData2-School.git (push)
git log -1 | head -3
--------------------
commit c34bf918dde9979472c44ece521bfd725820ac4b
Author: Grant Braught <braught@dickinson.edu>
Date: Tue Dec 2 14:40:41 2025 -0500
cat ~/FarmData2/.fd2dev/db.conf
-------------------------------
v3.7.1
db.sample.tar.gz
docker ps (Images and Names)
----------------------------
farmdata2/farmos3:fd2.1 fd2_farmos_school
farmdata2/fd2dev:fd2.13 fd2_dev_school
farmdata2/postgres:fd2.2 fd2_postgres_school
Additional Information
The "CropSelector" on the Harvest form should be similar to the "FarmData2" -> "Transplanting" form. On the Transplanting form you will notice that there is no "+" on the right. This is because we can't transplant a plant that hasn't been planted and we can only plant a plant for a crop that exists.
Look at the documentation for the CropSelector to see what props it has and how it can be configured to show or not show the "+" for adding a new type of crop. A new component test should be added in CropSelector.content.comp.cy.js to test any changes made to CropSelector.
The E2E tests for the Harvest form can be run with: test.bash --fd2 --live --e2e --glob=modules/farm_fd2/**/harvest/*.e2e.cy.js --gui
The component tests for the CropSelector can be run with: test.bash --comp --glob=components/CropSelector/CropSelector.*.comp.cy.js