Closed braughtg closed 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.
The link to the PR for the crop dropdown menu can be found at: https://github.com/josieecook/FarmData2/tree/cropTaskBranch1/farmdata2_modules/fd2_tabs/fd2_barn_kit.
However, the dropdown will make more sense with the most recent stage of the subtab with the functioning table at: https://github.com/josieecook/FarmData2/tree/Epic-TraySeedingReport/farmdata2_modules/fd2_tabs/fd2_barn_kit.
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:
When looking for the user data on Hoppscotch using the link http://localhost//log.json?type=farm_seeding, we were unable to find a place where the specific username for each report and comments corresponding to the report were stored although it should be provided since the original FarmData site has specific users in its user column.
A possible way to combat the username problem would be to use the id of the user (which is provided on the farmOS API for farm seedings at http://localhost//log.json?type=farm_seeding) to make a different API call which returns back the specific user and display it on the table. We are unsure how/where to get the comments.
The link to the PR for the table can be found at: https://github.com/josieecook/FarmData2/tree/S2Task2-Table.
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:
We have not yet fixed the traySeedingLogRequest function so that the API response can include more than 100 objects.
We have been unable to figure out how to differentiate tray seeding reports from the general seeding reports. As of now, what is returned by the API request are logs of all of the seeding reports, likely including both tray and field seedings. FarmOS needs to be read through to find out how to make the request more specific.
The user cannot currently download the report
The user cannot currently edit any of the specific logs within the report
Closing as the course is now complete. A new issue will be created for the completion of this feature.
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.