Compare commits

..

19 Commits

Author SHA1 Message Date
Daniel O'Connor
6784c6460d Merge pull request #4600 from Growstuff/dev
Release 85
2026-04-28 14:48:45 +09:30
Daniel O'Connor
e748da9a1f Merge pull request #4601 from Growstuff/links-wrong
Fix links further
2026-04-28 13:34:11 +09:30
Daniel O'Connor
4ac0dcb05b Merge branch 'dev' of https://github.com/Growstuff/growstuff into links-wrong 2026-04-28 04:03:44 +00:00
Daniel O'Connor
60390fcc06 Fix links further 2026-04-28 04:03:27 +00:00
Daniel O'Connor
a5ed2b988d Merge pull request #4583 from Growstuff/dev
Release 84
2026-04-27 13:56:58 +09:30
Daniel O'Connor
7ca689fa4a release83 (#4579)
* Ensure "mark as failed" option is available when viewing a crop

This change adds the "mark as failed" action to the crop view in two places:
1. In the "Crop Actions" button group, a new "Mark as failed" button is added if the current member has active plantings of that crop. Clicking it opens a modal to select which planting failed.
2. In the "See who's planted" list, an "Actions" dropdown is added to any plantings owned by the current member, which includes the "Mark as failed" option.

A new partial `app/views/plantings/_failed_modal.html.haml` was created to handle the planting selection modal.
`app/views/crops/_actions.html.haml` and `app/views/crops/_plantings.html.haml` were updated to include these new actions.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Admin - Members - optimise memory usage

* GBIF - optimise memory usage

* Memory usage

* Update .dockerignore to remove .ruby-version

Remove .ruby-version from .dockerignore

* Swap to modern expect style

* Swap to modern expect style

* Rubocop fixes

* Swap to modern expect style

* Merge pull request #4567 from Growstuff/memory-optimisation-3

Members - Nearest To - Memory improvements

* Merge pull request #4564 from Growstuff/memory-optimization-2149092598558110155

Memory usage optimization

* Add fragment cache for crop partials

* Add rake task to cleanup inactive members (#4574)

* Add members:cleanup_inactive rake task

This task identifies and deletes members who have not logged in for over
24 months and have no gardens, plantings, or other activity (posts,
comments, seeds, harvests, etc).

Includes support for DRY_RUN=true to preview deletions.
Added tests in spec/tasks/members_spec.rb.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Refactor activity check to Member#has_activity? and update rake task

- Added `Member#has_activity?` to encapsulate the check for gardens, plantings, and other activity.
- Updated `members:cleanup_inactive` rake task to use `Member#has_activity?`.
- Maintained `DRY_RUN` support and existing tests.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Apply suggestion from @CloCkWeRX

* Apply suggestions from code review

Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

* Merge pull request #4578 from Growstuff/member-inactive-delete

Delete inactive members with no activity in 3 years

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-27 02:22:30 +09:30
Daniel O'Connor
189067c66f Merge pull request #4563 from Growstuff/dev
Release 82
2026-04-26 14:31:31 +09:30
Daniel O'Connor
8d9bcc4559 Merge pull request #4524 from Growstuff/dev
release81
2026-04-23 20:31:28 +09:30
Daniel O'Connor
6e7e752fed Merge pull request #4487 from Growstuff/dev
Release 80
2026-04-11 14:51:48 +09:30
Daniel O'Connor
fe032b6b49 Merge pull request #4378 from Growstuff/dev
Fix minor complaints
2025-12-02 23:00:21 +10:30
Daniel O'Connor
959f914122 Merge pull request #4377 from Growstuff/dev
Update _head.html.haml
2025-12-02 22:51:41 +10:30
Daniel O'Connor
3f8fb799d5 Merge pull request #4376 from Growstuff/dev
More site verification bits
2025-12-02 22:48:29 +10:30
Daniel O'Connor
985ad120c7 Merge pull request #4375 from Growstuff/dev
Deploy various site verification things
2025-12-02 22:42:40 +10:30
Daniel O'Connor
d8e1e09dfb Merge pull request #4372 from Growstuff/fix-sitemap-upload (#4373)
Fix Sitemap Upload to S3

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-12-02 22:23:21 +10:30
Daniel O'Connor
477baec010 Merge pull request #4371 from Growstuff/dev
Deploy various maintenance tasks to prod
2025-12-02 02:27:07 +10:30
Daniel O'Connor
d5db389b23 Merge pull request #4360 from Growstuff/dev
Deploy: Missing PKFID
2025-12-01 22:22:30 +10:30
Daniel O'Connor
b866a2064b Merge pull request #4358 from Growstuff/dev
Hotfix: Reduce to member login_name
2025-12-01 20:34:18 +10:30
Daniel O'Connor
37519de615 Release 78 (#4357)
* Check presence of version members before accessing

* Fix(specs): Initialize @version_members in crops/show view spec

The `crops/show` view spec was failing with a `NoMethodError` because
the `@version_members` instance variable was `nil`. This variable is used
in the `_history` partial, which is rendered by the `show` view.

This commit fixes the spec by initializing `@version_members` to an
empty hash in the `before` block of the spec. This ensures that the
view can render without errors during the test run.

* Remove defunct gitter

* Merge pull request #4352 from Growstuff/add-public-food-key

feat: Add Public Food Key to Crop model

* Bump rubocop-rails from 2.34.1 to 2.34.2

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.34.1 to 2.34.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.34.1...v2.34.2)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-version: 2.34.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Optimize Data Improvement Page (#4356)

* 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>

* Merge pull request #4353 from Growstuff/feat/import-australian-food-data

Add Rake Task to Import Australian Food Data

* Fix styling

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 20:01:31 +10:30
Daniel O'Connor
8ddc717d9b Release 77 (#4345)
* Update crops_helper.rb

* feat: Add contribution links and conditional edit form

This commit introduces a series of changes to encourage user contributions for missing crop data.

On the crop show page, it adds links for logged-in users to:
- Add a description if one is not present.
- Add a YouTube video if one is not present.
- Add more attributes in the predictions section if any are missing.

On the crop edit page, the form now conditionally displays fields. For standard users, it only shows fields for attributes that are currently empty. For privileged users (wranglers), it displays all fields, allowing them to edit existing data.

* feat: Add schema.org markup to crop pages

Adds schema.org markup to the crop pages using the BioChemEntity type. The taxonomicRange attribute is used to list the scientific names of the crop, which will improve SEO.

* feat: Add Wikidata ID to scientific names

This commit introduces the ability to store and display the Wikidata ID for scientific names.

Changes include:
- A database migration to add the `wikidata_id` column to the `scientific_names` table.
- An update to the `scientific_names_controller` to permit the `wikidata_id` parameter.
- An update to the scientific name form to include a field for the Wikidata ID.
- An update to the crop show page to display a link to the Wikidata page for a scientific name.

* Delete db/migrate/20251129185029_add_wikidata_id_to_scientific_names.rb

* Update _schema_org.html.haml

* Move to crops helper

* Add more schema.org

* Specific form links

* Styling

* Render images

* Document future

* Render less on some pages

* Fix rendering

* Add version tracking to crops model (#4343)

* 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>

* Add revert functionality to admin crops page (#4346)

* feat(admin): add revert functionality to crops page

This change adds a "Revert" button to the admin crops page, allowing crop wranglers to revert changes to a previous version.

It introduces a new `Admin::VersionsController` with a `revert` action that uses `paper_trail`'s `reify` method to restore a previous version of a `Crop` object.

The view is updated to include a "Revert" button, which is guarded by a `can?(:wrangle, Crop)` check to ensure only authorized users can see it.

The controller also includes an authorization check to prevent unauthorized users from accessing the revert action directly.

A feature spec is added to test the new functionality, including the authorization logic.

* Consistent UX

* Specs

---------

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>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-11-30 15:05:55 +10:30
4 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
- content_for :breadcrumbs do
- if @owner
%li.breadcrumb-item= link_to 'Activities', activities_path
%li.breadcrumb-item.active= link_to "#{@owner}'s activities", activities_path(@owner)
%li.breadcrumb-item.active= link_to "#{@owner}'s activities", member_activities_path(@owner)
- else
%li.breadcrumb-item.active= link_to 'Activities', activities_path

View File

@@ -4,7 +4,7 @@
- content_for :breadcrumbs do
- if @owner
%li.breadcrumb-item= link_to 'Harvests', harvests_path
%li.breadcrumb-item.active= link_to "#{@owner}'s harvests", harvests_path(@owner)
%li.breadcrumb-item.active= link_to "#{@owner}'s harvests", member_harvests_path(@owner)
- else
%li.breadcrumb-item.active= link_to "Harvests", harvests_path
.row

View File

@@ -4,7 +4,7 @@
- content_for :breadcrumbs do
- if @owner
%li.breadcrumb-item= link_to 'Plantings', plantings_path
%li.breadcrumb-item.active= link_to "#{@owner}'s plantings", plantings_path(@owner)
%li.breadcrumb-item.active= link_to "#{@owner}'s plantings", member_plantings_path(@owner)
- else
%li.breadcrumb-item.active= link_to 'Plantings', plantings_path

View File

@@ -1,7 +1,7 @@
- content_for :breadcrumbs do
- if @owner
%li.breadcrumb-item= link_to 'Seeds', seeds_path
%li.breadcrumb-item.active= link_to "#{@owner}'s seeds", seeds_path(@owner)
%li.breadcrumb-item.active= link_to "#{@owner}'s seeds", member_seeds_path(@owner)
- else
%li.breadcrumb-item.active= link_to 'Seeds', seeds_path