Commit Graph
82 Commits
Author SHA1 Message Date
Brenda Wallace 062bf738b3 Hide the packet text for now, and fix the packet_text migration
The text read from a packet is kept in seeds.packet_text but is not on any form
or page yet: the OCR script will fill it in a follow-up. The column's migration
comment had an apostrophe that broke its string, so it did not run.
2026-10-28 20:35:09 +13:00
Brenda Wallace 1036ad2ecf feat: add packet_text field to seeds and implement OCR reading functionality for seed packets 2026-10-28 20:12:47 +13:00
Brenda Wallace acfaa2a880 feat: add tesseract.js dependency and implement photo association tests
- Added `tesseract.js` as a dependency in `package.json`.
- Created a new spec file for `PhotosHelper` to test `packet_image_urls` method.
- Enhanced `Crop` model tests to ensure packet photos do not interfere with crop photos.
- Introduced validation tests for `Seed` model, covering row spacing and variety constraints.
- Updated API response in `seeds_request_spec.rb` to include variety, batch number, and row spacing.
- Updated `yarn.lock` to reflect new dependencies and versions.
2026-10-28 19:37:09 +13:00
Brenda WallaceandDaniel O'Connor 75595350bc Easier recording of harvests from the front page (#5077)
* Implement AddSeedsPicker component and enhance planting selection UI; update styles and serializers for better seed management

* Enhance PlantingPicker component: add hints and titles for harvest and seed actions; update test to reflect changes in seed saving behavior

* Enhance harvest recording: allow harvesting from crops without plantings; update forms and modals for better user experience

* Refactor code structure for improved readability and maintainability

* Remove AddSeedsPicker component and its associated tests

* Add planting picker functionality for harvesting and seed saving

- Introduced PlantingPickersController to handle JSON responses for member's plantings.
- Updated HomeHelper to include crop ID in planting picker properties.
- Refactored PlantPicker and PlantSomethingModal components to support multiple gardens.
- Created PlantingFlow component to manage planting actions (harvest and save seeds).
- Implemented RecordDialog component to handle server-rendered links for harvesting and seed saving.
- Updated various views to include data attributes for triggering the record dialog.
- Added routes for planting picker and corresponding request specs for testing.
- Adjusted styles in _plantings.scss for better layout and spacing.

* Add job management features including job creation and wishlist functionality

* Remove WishlistJobsController and associated views and tests

* Add suggestion links rendering and fix routes formatting

* Refactor AddJobModal and JobPicker components to simplify props and enhance user experience

* Update seed addition test to check dialog presence and current path

* Apply suggestion from @CloCkWeRX

---------

Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2026-10-26 21:38:12 +10:30
Brenda Wallace c8c32014bb tidying up, as react components 2026-10-16 17:32:09 +13:00
Brenda Wallace fdebe79b7d Refactor seed management features
- Introduced `@other_count` in SeedsController to track in-stock and finished seeds based on the filter applied.
- Enhanced SeedsHelper with new methods: `seed_owner_label`, `seed_stacks`, and `seed_choice_link` for better organization and readability.
- Updated views to utilize new helper methods, improving the display of seed information and filtering options.
- Adjusted the Seed model to include methods for determining if a seed's sow-by date has passed and to return the heirloom type.
- Improved tests for filters and helper methods to ensure accurate functionality and coverage.
2026-10-16 17:32:09 +13:00
Brenda Wallace 49800d574b Refactor seed display logic and styles for improved user experience 2026-10-16 17:32:09 +13:00
Brenda Wallace 3a03a98a40 Refactor SeedsController and related views for improved seed filtering and display
- Introduced a new `filter` method in SeedsController to streamline seed filtering logic based on various parameters.
- Updated the `library_stats` method to calculate statistics for a member's seed library.
- Enhanced the seeds index view with a new toolbar for search and filtering options.
- Created new partials for seed packets and page headers to improve code organization and readability.
- Added support for displaying past sow-by dates and improved the presentation of seed varieties and stacks.
- Refactored existing views to utilize new partials and methods, ensuring a cleaner and more maintainable codebase.
2026-10-16 17:32:09 +13:00
Brenda Wallace dc28cee60e Implement seed sharing features with UI updates, distance calculations, and improved context display 2026-10-16 17:32:09 +13:00
Brenda Wallace 2709ce3e70 Implement seed stack opening feature with UI updates and tests 2026-10-16 17:32:09 +13:00
Brenda Wallace 47945492c2 Implement seed search functionality with results summary and no results handling 2026-10-16 17:32:09 +13:00
Brenda Wallace deda0350e3 Implement grouping and list view for seed shelves with updated styles 2026-10-16 17:32:09 +13:00
Brenda Wallace 2c7a6224b3 Add in stock and finished tabs to seeds index with counts 2026-10-16 17:32:09 +13:00
Brenda Wallace 0029f6e6cb Implement seed shelves feature with grouped packets by parent crop 2026-10-16 17:32:09 +13:00
Brenda Wallace 84e6b1cbbd Add plant_before_year attribute to seeds and update related forms and views 2026-10-12 08:14:51 +13:00
Brenda Wallace 439826a849 Implement sorting of seeds by distance from the current member's location in the index action and update view to reflect sorting status. 2026-10-11 19:19:42 +13:00
Brenda WallaceandClaude Sonnet 5 eb92386f0e Let garden cards save seeds as JSON
GET /plantings/:slug/seeds/new.json gives the form's starting values and
choices; POST /seeds.json returns a link to the new seed, or the
validation errors as 422, without queueing a flash message.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 17:42:26 +12:00
6e7cf1c813 Refactor Seeds to remove Elasticsearch dependency (#4684)
* Refactor Seeds to remove Elasticsearch dependency

This commit refactors the `SeedsController` and `Seed` model to remove
dependency on Elasticsearch and Searchkick.

Key changes:
- Removed `SearchSeeds` concern from the `Seed` model.
- Reimplemented `Seed.homepage_records` using ActiveRecord.
- Refactored `SeedsController#index` to use ActiveRecord for filtering,
  eager loading, and pagination.
- Deleted `app/models/concerns/search_seeds.rb`.
- Updated relevant specs to remove Searchkick-specific tags and setup.

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

* Remove Seed.reindex

* Remove trait

* Fix tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-06-24 21:54:43 +09:30
google-labs-jules[bot]andCloCkWeRX 5ac709ffd1 Fix crash during CSV export of harvests and seeds
When using Searchkick with `load: false`, search results are returned
as HashResponse objects which do not support model associations or
standard Rails URL helpers that expect model instances.

This commit updates HarvestsController and SeedsController to
conditionally load ActiveRecord objects when CSV format is requested,
ensuring that the export templates can access the necessary associations.
Similar logic was also applied to CropsController.

Additionally, a typo in the Crops CSV shaper was fixed.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
2026-05-01 11:30:22 +00:00
Daniel O'Connorandgoogle-labs-jules[bot] 37e9860fdf Update member_slug lookup to 404 when not found (#4584)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-27 14:19:50 +09:30
Daniel O'Connor ed87d23ece Merge pull request #4560 from Growstuff/fix-i18n-locale-texts-16171345716630423189
Fix Rails/I18nLocaleTexts RuboCop errors
2026-04-26 13:36:10 +09:30
google-labs-jules[bot]andDaniel O'Connor 0f4803392d Add seed source to Seed model (#4186)
* Add seed source to Seed model

* Update _form.html.haml

* Add to schema

* Default option

* Default option

* Fix test

---------

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>
2025-09-01 21:47:31 +09:30
Daniel O'Connor 0289786891 Seeds for trade - avoid showing expired seeds on homepage. (#4176)
* Improve date visibility

* Ensure when seeding seeds, it's false

* Typo
2025-08-31 14:39:42 +09:30
google-labs-jules[bot]andDaniel O'Connor d383c8e2e4 Add filtering for tradeable seeds (#4111)
* feat: Add filtering for tradeable seeds

This change introduces a new feature to filter seeds based on their tradeability.

- Adds a link on the homepage to view all tradeable seeds.
- Modifies the seeds controller to support filtering by `tradeable_to`, allowing multiple values to be selected.
- Adds links to the seeds index page to filter by the various `tradeable_to` values.

* Update index.html.haml

---------

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>
2025-08-10 15:44:01 +09:30
Daniel O'Connor 3738d7cc21 Seeds > Photos - Fix tests not running and fix tests (#3621)
* Rename, so it runs in CI

* Fix specs slightly

* Fix tests
2024-02-04 15:05:43 +10:30
Daniel O'Connor 4310a6f717 DEPRECATION WARNING: TimeWithZone#to_s(:number) is deprecated. Please use TimeWithZone#to_fs(:number) instead. 2022-11-07 22:27:45 +10:30
Daniel O'Connor 302483f66d DEPRECATION WARNING: TimeWithZone#to_s(:number) is deprecated. Please use TimeWithZone#to_fs(:number) instead. 2022-11-07 22:26:57 +10:30
Daniel O'Connor b24b9f82e6 Rubocop - auto corrections 2022-11-06 16:34:36 +10:30
Brenda Wallace c6988e2189 Re-instate the plantings quick actions 2020-01-05 21:31:51 +13:00
Brenda Wallace 4a2bb2342c Sorting out cancancan, copied to common parent controller 2019-12-24 11:38:30 +13:00
Brenda Wallace 6f950e685b hand loading back to cancancan 2019-12-24 10:45:02 +13:00
codefactor-io f8916dfecb [CodeFactor] Apply fixes 2019-12-20 04:16:33 +00:00
Brenda Wallace 9d68ab0228 Rubocop fix of controller 2019-12-20 17:13:54 +13:00
codefactor-io d95bc774a2 [CodeFactor] Apply fixes 2019-12-20 03:22:04 +00:00
Brenda Wallace 8789fee365 Seeds into elastic search 2019-12-20 16:20:52 +13:00
Brenda Wallace c0103a3f42 find seeds by slug 2019-12-20 09:21:47 +13:00
Brenda Wallace 5e5cdf6246 Fixing up lookup by slug 2019-12-19 21:49:18 +13:00
Brenda Wallace b214f7ad8d linking existing plantings to their parent seeds 2019-11-01 02:23:14 +00:00
Brenda Wallace b0c8b11246 📝 Inline editing and display tidy ups (#2200)
* Inline editing and display tidy ups
2019-10-08 11:06:53 +13:00
Brenda Wallace 7b87f8e4db Add flash messages to controllers 2019-07-09 09:19:27 +12:00
Brenda Wallace e7b0b6f18e Remove table display on plantings#show, replace with boxes 2019-03-27 21:04:56 +13:00
Brenda Wallace b35d13d5e5 Update seeds_controller.rb 2019-01-18 20:05:41 +13:00
Brenda Wallace 061bd31220 Use owner param in filename 2019-01-06 08:45:42 +13:00
Brenda Wallace 1e6c204df2 Rubcop fix up 2019-01-06 08:45:42 +13:00
Brenda Wallace 1e266a92f6 Members slug used in rotes 2019-01-06 08:45:42 +13:00
Brenda Wallace 387200abf7 Moving garden data under members 2019-01-06 08:45:42 +13:00
Brenda Wallace f9d4e1d6ae Ancestry of food. Seeds -> Planting -> Seeds -> Planting (#1550)
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Removed in-line style
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Moved finishable to a concern
* Seeds.finished_at
* rubocop fixes
* Made seeds sown migration the most recent
* Specs for home page
* Only show current seeds on home page
* Seeds appear for logged in or not
* Buttons to mark seeds finished
* JS for marking seeds finished
* Some actions only appear if seed or planting is active
* Fixed up display of home page
* Fixed typo in admin members#index
* Tidying up actions on all the things
* Harvest description in #index
* Truncate garden description if long
* Updated link label in view spec
* Show planted_from always, becuase it might be a parent seed
* find correct link in spec adding photos to garden
* fixed spec finding link to edit garden
* Better harvest description truncation
* Helping spec find the edit button
* specs for the home page
* Re-instate crops js, but in the correct file now
* Fixed link to garden in actions
* Tweaking mobile view
2018-03-12 08:39:32 +13:00
Brenda Wallace 3aa2f0bd3b Paginate photos on seeds#show (inc feature specs) 2017-12-17 08:55:08 +13:00
Brenda Wallace a6a7f789a3 Rubocop upgrade (and some style fixes) 2017-12-01 21:07:39 +13:00
Brenda Wallace 48f8085e2d Fix seeds order 2017-11-29 20:59:37 +13:00