This change adds a new tab to the data improvement page to show crops that are missing a public food key id.
I was unable to run tests or perform frontend verification due to a known issue with the Ruby environment.
* feat: Add data improvement page to crops controller
This commit introduces a new data improvement page to the crops controller. The page displays tabbed lists of crops with missing data, allowing users to easily identify areas for data quality improvement.
The following data quality categories are included:
- Crops without photos
- Crops without descriptions
- Crops without a youtube video
- Crops without alternate names
- Crops without a scientific name with a wikidata id
- Crops without row spacing
- Crops without sun requirements
- Crops without height
All lists are sorted by planting count in descending order.
* refactor: Optimize data improvement page to load tab data on demand
This commit refactors the data improvement page to load data for each tab on demand, rather than loading all queries at once. This improves the performance of the page by only executing the query for the currently active tab.
The controller action now uses a `case` statement based on a `tab` URL parameter to execute the appropriate query. The view has been updated to pass this parameter when a tab is clicked.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* feat: Add version tracking to Crop model
This commit introduces version tracking for the Crop model using the PaperTrail gem.
Key changes include:
- Integrating `has_paper_trail` into the `Crop` model.
- Adding a "History" section to the crop show page to display a timeline of changes for that specific crop.
- Creating a new admin page for users with the "crop_wrangler" role to view a log of all recent crop edits, creations, and deletions.
- Fixing several N+1 query performance issues by eager-loading associated `Member` records in both the `CropsController` and the new `Admin::CropsController`.
- Refactoring view logic into a shared partial to reduce code duplication.
* Add papertrail
* Admin UI
* Add papertrail DB
* Add papertrail DB
* Rearrange
* Fix permissions
* Fix permissions
* Fix UI
* Fix UI
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
This change migrates the crop description from the `openfarm_data` JSONB field to a new, dedicated `description` text column in the `crops` table.
A data migration is included to move the existing description data to the new column. The `OpenFarmData` concern is updated to remove the now-redundant `description` method.
This commit introduces the following changes:
- Adds an `en_youtube_url` attribute to the `Crop` model to store a URL for an English language YouTube video.
- The `en_youtube_url` is now an editable field in the crop form.
- If a `en_youtube_url` is present for a crop, the video is embedded on the crop's show page.
- A link is added to the "Learn more" section of the crop's show page to search YouTube for "growing [crop name]".
- A helper method is added to extract the video ID from various YouTube URL formats.
- A validation is added to the `Crop` model to ensure that the `en_youtube_url` is a valid YouTube URL.
* I will add the international alternate names for the crops.
* Mark required
* Update factory
* Add placeholder
* Fix seeds
* Add language, though hardcoded to EN in most places
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
* Fix#3278 by ensuring we rebuild names on error
* Require a URL
* Require a name
* 'Only required for wrangers, and only when approving
* Re-add expectation
* Fix todo
* Rubcop
* Rubocop
* Rubocop
* Rename harvests_routing_spec.rb to harvests_controller_routing_spec.rb
Making codeclimate happier
* Rename for CodeFactor: updates_routing_spec.rb to posts_controller_updates_routing_spec.rb
For codefactor
* Rename for CodeFactor: follows_routing_spec.rb to follows_controller_routing_spec.rb
* Rename for CodeFactor: forums_routing_spec.rb to forums_controller_routing_spec.rb
* Rename spec/routing/roles_routing_spec.rb to spec/routing/admin/roles_controller_routing_spec.rb
* Rename authentications_routing_spec.rb to authentications_controller_routing_spec.rb
* Rename for CodeFactor: plantings_routing_spec.rb to plantings_controller_routing_spec.rb
* Rename for CodeFactor: scientific_names_routing_spec.rb to scientific_names_controller_routing_spec.rb
* Rename for CodeFactor: seeds_routing_spec.rb to seeds_controller_routing_spec.rb
* Rename for CodeFactor: comments_routing_spec.rb to comments_controller_routing_spec.rb
* Rename for CodeFactor: garden_types_routing_spec.rb to garden_types_controller_routing_spec.rb
* Rename for CodeFactor: admin_routing_spec.rb to admin_controller_routing_spec.rb
* Rename for CodeFactor: gardens_routing_spec.rb to gardens_controller_routing_spec.rb
* Rename for CodeFactor: photos_routing_spec.rb to photos_controller_routing_spec.rb
* Rename for CodeFactor: plant_parts_routing_spec.rb to plant_parts_controller_routing_spec.rb
* Rename for CodeFactor: crops_routing_spec.rb to crops_controller_routing_spec.rb
* [CodeFactor] Apply fixes
* Rename
* Code factor bot
---------
Co-authored-by: Cesy <cesy.avon@gmail.com>
Co-authored-by: codefactor-io <support@codefactor.io>
* Pull in openfarm icons, photos, info
* Truncating member location
* tidying up harvest display, and reducing duplication in css styles
* Tiny crop chip
* only show crop charts if there is data to show
* Make the styles more Growstuff
* Fixed links to openfarm
* Updating specs to cope with new photo sources
fix broken garden timeline on some pages
* Update homepage blurb
* Import crop companions
* More fluid page
* use thumbnail unless the source is flickr
* Messing with homepage
* Added crop growing_degree_days
* expect full size url on photos helper spec
* formatted dates from seeds#show
* tidy up places#show
* Move progress bar
* Quicker buttons for approve/reject crops
* Remove kaminari gem
* use crop cards on hierarchy page
* more crops on crops#index
* Wrap photo creation in transaction
* Wrap crop companions in a transaction