DickinsonCollege / FarmData2

FarmData2 provides support for the operation and certification requirements of small organic farming operations.
Other
18 stars 139 forks source link

Tray Seeding Report in Barn Kit Tab #138

Closed braughtg closed 3 years ago

braughtg commented 3 years ago

See Seed -> Tray Seeding -> Report in the original FarmData at https://farmdata.dickinson.edu/guest.php

Data report for tray seeding.  Intuitive?  Provides raw data of crop planted over selected timeframe, plus total seeds planted for crop selected.

Also see #136 for some additional general language that applies to all reports.

Diego2214 commented 3 years ago

Draft Pull Request for Full Epic: https://github.com/DickinsonCollege/FarmData2/pull/157 Kanban Board: https://github.com/josieecook/FarmData2/projects/1

Summary: This semester, we were able to create a Tray Seeding Report subtab that appears under the BarnKit tab on Farm Data 2. We implemented a crop drop-down menu and a start and end date entry option. This allows the user to specify which crops will appear on the report, and between what dates. Upon clicking the “Generate Report” button, a Mock Report appears at the bottom of the webpage. This report displays the start & end dates, along with the crops above the seeding report table. The table loads data from the API regarding the date of seeding, crop, number of seeds, number of trays, number of cells per tray, variety, which user-inputted this data, additional comments, and a functional delete button. The data appears appropriately, though the delete button is still in progress.

Task - Delete Button: As of right now, the delete button is able to delete the selected row from the Mock Report, though it does not remove the data from the API. A popup window appears upon the click of the delete button, which alerts the user that only the Mock Report is being modified and asks for confirmation. The link to the PR for the DeleteButton can be found at: https://github.com/josieecook/FarmData2/tree/Story2-DeleteButton

Task - Add Comments: The “Add Comments” button is currently in progress, as only the button appears on the table, though it does not function correctly. The button is linked to addComments(), which is set to create a popup text input, for the user to submit additional information. Ideally, this function would add the comments into the API, so that the comments would continue to appear in the correct row, even when the report is closed and reopened. We also hoped that only users with correct privileges could comment, though these features were not yet implemented. The link to the PR for AddComments can be found at: https://github.com/josieecook/FarmData2/tree/Story3-AddComments

Task - Crop Dropdown Menu: The crop dropdown menu is a simple dropdown list with all the crops from the farmOS API (type: farm_seeding) in alphabetical order. Selecting one of these crops allows you to see the tray seeding report for that specific crop within a range of dates. At the top of the menu, there is an “All” option that allows one to see all the crop’s tray seeding reports within a range of dates.

Task - Report Table: The table in the tray seeding report is getting the correct and relevant information from farmOS API. We used the original FarmData site (the one that is currently of use on the college farm) and Hoppscotch as a reference to ensure we were grabbing the correct information and displaying it on the table. The only parts of the table that are unfinished are the user and comment columns. Right now the user column only displays “user” and not the specific username of the person who uploaded a report. The comment column is currently left blank. Here is a more in depth look at these issues:

Task - Start and End Date Selection: The start and end dates of the reports can both be specified with date-type user input fields. The start date cannot be set to after the end date and the end date cannot be set to before the start date. The user selects the appropriate dates from drop-down calendars and then when a report is generated it will only include tray seeding logs that took place between those two dates.

Task - API Response Processing: The API response that contains all of the logs for the report is saved as-is into an array rather than being sorted. The specific information needed to be displayed in the table is accessed from that array within the HTML of the table. This will be useful in the future when the delete and edit buttons are added and they can alter the data within the API.

Unfinished:

braughtg commented 3 years ago

Closing as the course is now complete. A new issue will be created for the completion of this feature.