Commit Graph
66 Commits
Author SHA1 Message Date
b77fa5d4c4 Add 'This week' reschedule option for jobs (#5118)
* Add 'This week' reschedule option for jobs

- Add JobList.week_date helper returning the Friday of the current week.
- Add move_week translation key in config/locales/en.yml.
- Render 'This week' option in app/views/jobs/_reschedule.haml when week_date is after tomorrow.
- Add unit specs in spec/services/job_list_spec.rb and view specs in spec/views/jobs/_reschedule.haml_spec.rb.

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

* Remove low value tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
2026-10-27 18:56:13 +10:30
Brenda Wallace e07a3fa04c more suggestions from other users 2026-10-27 13:46:44 +13:00
Brenda Wallace ddd9277696 Refactor CSRF token handling in job ideas and notepad scripts; improve rendering of notepad groups 2026-10-25 13:01:02 +13:00
Brenda Wallace 8e0825b1b0 Add job finished event handling and descriptions
- Implemented event description logic for finished jobs in EventHelper.
- Created a new partial for finished job descriptions.
- Updated TimelineService to include finished jobs in event queries.
- Enhanced specs for event descriptions and timeline service to cover finished jobs.
2026-10-24 17:48:57 +13:00
Brenda Wallace b5a46fe2f2 Enhance job notepad functionality with date management and improved UI for done tasks 2026-10-24 15:53:33 +13:00
Brenda Wallace 168e394150 Expands "Friends and Neighbours" to 300 items 2026-10-24 15:43:19 +13:00
Brenda Wallace d62125e4f5 Add world neighbours feature for job suggestions based on latitude 2026-10-24 15:29:17 +13:00
Brenda Wallace bbb8a142c7 widening the range for suggsting jobs (#5034)
* Add crop_job_step association to Job model and migration

- Introduced a has_many association in CropJobStep for jobs with dependent nullify.
- Added crop_job_step reference to Job model with optional association.
- Created migration to add crop_job_step reference to jobs table with foreign key.
- Updated schema to reflect the new association.
- Added tests for crop_job_step association in Job model.

* Add ApplyCropJobTemplate service and for_crop scope to CropJobTemplate model

* Add job idea dismissal feature and related services

- Introduced JobIdeaDismissal model to manage dismissed job ideas for members.
- Added associations and validations for job idea dismissals in the Member model.
- Created JobIdeas service to generate job ideas based on templates and last year's activities.
- Implemented JobIdeas::LastYear and JobIdeas::Templates classes to fetch relevant job ideas.
- Added migration for job_idea_dismissals table and updated schema.
- Developed tests for job idea dismissal functionality and related services.

* Add PlantedLastYear service and update JobIdeas to include it

* Add action attribute to Job model and update related files

* Refactor JobIdeas service: replace LastYear and PlantedLastYear with PastJobs and PastPlantings; update related specs

* Add community and nearby job ideas sources; implement shown and more methods in JobIdeas service

* Implement job idea dismissal duration and snooze functionality; add hidden_until attribute and related specs

* Add Harvest class to JobIdeas service for managing harvest-related job ideas; implement ideas generation and related specs

* Add JobIdeas feature: implement JobIdeasController, views, and related services for job suggestions; include functionality for adding, hiding, and snoozing job ideas

* Refactor button options in job ideas view for improved readability and maintainability

* Enhance Job Ideas feature: add styling for idea cards, implement filtering options, and update controller logic to manage skipped sources; improve localization for job idea reasons and sections

* Add job ideas count and badge display; implement helper methods and update views for better visibility of job ideas

* Enhance Job Ideas feature: add UI elements for job suggestions, implement schedule display for template jobs, and improve localization; update related specs for new functionality

* Enhance Job Ideas feature: implement overlay for job suggestions, add animations for job transitions, and improve UI components; update controller and helper methods for better handling of job ideas

* Refactor Job Ideas feature: remove badge display and related tests; update UI components for better layout and visibility of job suggestions

* Refactor Jobs view and update specs: improve layout for job groups and enhance test coverage for jobs index with ideas

* Refactor Job Ideas feature: replace dismiss! with hide! method, update job count logic, and enhance UI components for better visibility and layout

* Add job ideas feature: implement ideas banner on homepage, enhance overlay logic, and add tests for job ideas display

* widen the range for suggseting jobs

* Fix comment to accurately describe planted crops timeframe in PastPlantings class
2026-10-23 22:24:12 +10:30
Brenda Wallace b22fa68bdf Refactor Job Ideas feature: replace dismiss! with hide! method, update job count logic, and enhance UI components for better visibility and layout 2026-10-23 21:04:21 +13:00
Brenda Wallace c4ab1bab15 Enhance Job Ideas feature: implement overlay for job suggestions, add animations for job transitions, and improve UI components; update controller and helper methods for better handling of job ideas 2026-10-23 21:04:21 +13:00
Brenda Wallace e14b246dca Enhance Job Ideas feature: add UI elements for job suggestions, implement schedule display for template jobs, and improve localization; update related specs for new functionality 2026-10-23 21:04:21 +13:00
Brenda Wallace 3bdbd6c3a5 Enhance Job Ideas feature: add styling for idea cards, implement filtering options, and update controller logic to manage skipped sources; improve localization for job idea reasons and sections 2026-10-23 21:04:21 +13:00
Brenda Wallace 686b508d34 Add JobIdeas feature: implement JobIdeasController, views, and related services for job suggestions; include functionality for adding, hiding, and snoozing job ideas 2026-10-23 21:04:21 +13:00
Brenda Wallace 19e179229c Add Harvest class to JobIdeas service for managing harvest-related job ideas; implement ideas generation and related specs 2026-10-23 21:04:21 +13:00
Brenda Wallace c6bf51c542 Implement job idea dismissal duration and snooze functionality; add hidden_until attribute and related specs 2026-10-23 21:04:21 +13:00
Brenda Wallace fa1da3712b Add community and nearby job ideas sources; implement shown and more methods in JobIdeas service 2026-10-23 21:04:21 +13:00
Brenda Wallace 83504615d4 Refactor JobIdeas service: replace LastYear and PlantedLastYear with PastJobs and PastPlantings; update related specs 2026-10-23 21:04:21 +13:00
Brenda Wallace 3109109cd7 Add PlantedLastYear service and update JobIdeas to include it 2026-10-23 21:04:21 +13:00
Brenda Wallace a3764739b3 Add job idea dismissal feature and related services
- Introduced JobIdeaDismissal model to manage dismissed job ideas for members.
- Added associations and validations for job idea dismissals in the Member model.
- Created JobIdeas service to generate job ideas based on templates and last year's activities.
- Implemented JobIdeas::LastYear and JobIdeas::Templates classes to fetch relevant job ideas.
- Added migration for job_idea_dismissals table and updated schema.
- Developed tests for job idea dismissal functionality and related services.
2026-10-23 21:04:21 +13:00
Brenda Wallace c5b04b78a3 Add ApplyCropJobTemplate service and for_crop scope to CropJobTemplate model 2026-10-23 21:04:21 +13:00
Brenda Wallace 6332f26c58 Merge pull request #4994 from Growstuff/crop-job-templates-admin
Admin for crop job templates, a tidier crop wrangling page, and crop and template seeds
2026-10-23 13:26:33 +10:30
Brenda Wallace e64e893b4f Merge pull request #5015 from Growstuff/job-photos
Photos on jobs, before and after
2026-10-23 13:20:46 +10:30
Brenda Wallace 23a0e6ea1f Implement garden-specific job notepad: add JobsNotepad service, update controllers and views to support garden context, and enhance tests for new functionality. 2026-10-23 08:38:47 +13:00
Brenda Wallace 5a601d6dec Enhance job handling in neighbours and timeline services: add support for finished jobs, update queries, and improve localization for job-related events. 2026-10-23 08:31:29 +13:00
Brenda Wallace 7f0b6fb989 Enhance job notepad functionality: implement job crossing off with date tracking, update job grouping logic, and improve UI elements for better user experience. 2026-10-23 08:20:48 +13:00
Brenda Wallace 93c7ba08b7 Add overdue and done job groups to notepad and update styles 2026-10-23 08:18:00 +13:00
Brenda Wallace 29e9c71012 Refactor job handling: update due date logic, enhance notepad functionality, and adjust routing 2026-10-22 20:15:57 +13:00
Brenda Wallace 47476324b3 Enhance job notepad functionality with drag-and-drop support and UI updates 2026-10-22 17:24:48 +13:00
Brenda Wallace a0b24381ac Refactor activities to jobs across the application
- Renamed all instances of 'Activity' to 'Job' in views, controllers, and models.
- Updated routes to reflect the change from activities to jobs.
- Modified database schema to rename the activities table to jobs and adjusted related columns.
- Updated locale files to change activity-related translations to jobs.
- Adjusted tests to ensure they reference jobs instead of activities.
- Removed the category field from jobs as they are now a plain list.
- Updated seed data and sample data generation to create jobs instead of activities.
2026-10-22 17:16:25 +13:00
Brenda Wallace 977a984c24 Remove Elasticsearch integration and related code
- Deleted Elasticsearch gems from Gemfile and Gemfile.lock.
- Updated README and TECH documentation to reflect the removal of Elasticsearch.
- Removed Elasticsearch-related code from models, controllers, services, and factories.
- Adjusted tests to eliminate dependencies on Elasticsearch.
- Cleaned up Docker configuration and environment variables related to Elasticsearch.
- Added a TODO file for future gem reviews and potential removals.
2026-10-22 15:37:03 +13:00
Brenda Wallace 77da6fd00c Refactor neighbours styles and enhance entry rendering
- Update styles for neighbours entry list and line items for better layout.
- Introduce grouping logic for neighbour activities in the helper.
- Modify entry rendering to display grouped activities and photos.
- Adjust locale keys for improved sentence structure in activity descriptions.
- Add tests for new grouping functionality and ensure date handling is consistent across time zones.
2026-10-19 20:53:26 +13:00
Brenda Wallace d71b005ccc Add support for planned activities in neighbours and timeline services, update views and tests accordingly 2026-10-19 20:53:26 +13:00
Brenda Wallace a2358b10bf Enhance finished plantings query: include updates for plantings without finish dates and adjust selection criteria for better accuracy in timeline events. 2026-10-19 20:53:26 +13:00
Brenda Wallace fa33d7b911 Add seasonal features to neighbours: implement season markers and headings, enhance activity filtering for 'me' scope, and update styles for better visibility. 2026-10-19 20:53:26 +13:00
Brenda Wallace ecb84e35ba Add support for finished seeds in neighbours and timeline services
- Updated the Neighbours service to include 'seed_finished' in the feed kinds and event models.
- Enhanced the TimelineService to query finished seeds and include them in the timeline.
- Modified the neighbours view to display finished seeds with appropriate translations.
- Added tests to ensure finished seeds are correctly represented in both the neighbours feed and service specs.
2026-10-19 20:53:26 +13:00
Brenda WallaceandClaude Sonnet 5.5 356b83bd33 Add transplants, finished plantings and planned activities to friends and neighbours
Assisted-by: Claude Code:claude-sonnet-5-5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 20:53:26 +13:00
Brenda Wallace b4e5c959e3 Clear Rails cache before running tests and add neighbours controller specs 2026-10-13 17:58:01 +13:00
Brenda Wallace 3b06325e62 Add friends and neighbours feature with member dismissal functionality
- Implement RecentActivity service to track recent planting, harvesting, and trading events.
- Enhance TimelineService to include garden layouts in event queries.
- Update navigation menu to include a link to friends and neighbours.
- Create member card partial for displaying gardener information.
- Add follow button partial for managing follow actions.
- Refactor members index view to use the new member card partial.
- Introduce neighbours feed view with daily updates and entries.
- Implement entry partial for displaying individual neighbour activities.
- Create layout partial for visualizing garden layouts.
- Add posts section to neighbours view for displaying recent posts.
- Implement reach section to show nearby gardeners.
- Add suggestions section for recommending gardeners to follow.
- Create routes for neighbours functionality and member dismissals.
- Add migrations for member dismissals and garden layout timestamps.
- Write feature and request specs for neighbours functionality.
- Include support for creating located members in tests.
2026-10-13 17:08:18 +13:00
Brenda Wallace 29c9cb2ef6 show harvests by count, not weight 2026-10-13 13:08:02 +13:00
Brenda Wallace be38339b02 Refactor member location updates and improve error handling
- Updated MemberLocationsController to use a hash for location updates, ensuring coordinates are not geocoded again.
- Changed response status codes in member_locations_spec to use symbols for better readability.
- Modified PlacesController to use parentheses for defining MEMBER_FIELDS.
- Enhanced SuggestionsController to disable Rails/SkipsModelValidations for update_columns.
- Updated SeasonsHelper to use compact_blank for cleaner output.
- Refactored MemberDashboard service for improved readability and performance.
- Adjusted migration files to use parentheses for index definitions.
- Updated schema.rb to maintain consistency in index definitions.
- Added SampleData class to generate sample data for development.
- Cleaned up sample_data.rake task to utilize the new SampleData class.
- Updated tests in member_dashboard_spec and place_suggester_spec for consistency and readability.
2026-10-12 19:30:21 +13:00
Brenda Wallace c83d542146 Enhance navigation and dashboard features with current section highlighting and last year's planting data 2026-10-12 19:19:43 +13:00
Brenda Wallace ef06bab74f Add crop suggestions feature and dashboard enhancements
- Introduced crop suggestions functionality allowing users to receive tailored crop recommendations based on their location and preferences.
- Implemented the ability for users to dismiss specific crop suggestions, preventing them from receiving recommendations for crops they are not interested in.
- Added a location picker for users to set their gardening location, enhancing the accuracy of crop suggestions.
- Enhanced the dashboard to display relevant statistics, including plantings and harvests, with comparisons to previous years.
- Created new views and partials for displaying statistics, crop suggestions, and user interactions on the dashboard.
- Updated routes to accommodate new features related to crop suggestions and member locations.
- Added migrations for new database tables and columns to support crop dismissal and suggestion preferences.
- Developed tests for the new features, ensuring functionality and user experience are maintained.
2026-10-12 19:12:18 +13:00
Brenda Wallace 3d64118cdf Merge pull request #4837 from Growstuff/feat/fluent-crop-icons
Give crops icons from Fluent Emoji, chosen by crop wranglers
2026-09-22 18:45:45 +09:30
Brenda WallaceandClaude Sonnet 5 23e83b1a5f Add rake tasks to pull crops and a member's data from production (#4803)
* Add rake tasks to pull crops and a member's data from production

crops:pull_from_production copies approved crops, and
members:pull_from_production copies one member's gardens, plantings and
planting photos, from growstuff.org into a local database. Both refuse to
run in a production environment.

They are built to be gentle on a server that has been struggling: one
request at a time with a pause between requests, exponential backoff
(honouring Retry-After) on timeouts, 429s and 5xx, and a hard stop rather
than endless retries. The client also stops if a server keeps sending the
same page, and will not follow a next link to another host.

Gardens and plantings come from the site's own JSON, which carries every
column; the JSON:API only exposes a garden's name, and its related
resource endpoints return the wrong records. Only the crops that a
member's plantings use are fetched. Flickr photos are stored as records
pointing at Flickr's image URLs, as on production, so nothing is
downloaded from Flickr.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add ACTIVE_ONLY option to the member import

ACTIVE_ONLY=true leaves out the site's all=1 flag, so production lists only
the member's active gardens and current (not finished, not failed)
plantings. The server does the filtering, so it also means fewer requests,
and no crops or photos are fetched for plantings that are skipped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 14:06:01 +09:30
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30
Daniel O'Connor 1f0cfa9b6c Add GBIF to our scientific names, so that our crops can associate creative commons photos (#3559)
* Add GBIF cient

* Add lookup

* Add autocomplete for GBIF lookup

* Add extra detail to scientific names

* Autocomplete

* Add routes

* Rmeove mapping

* Add autocomplete

* Update GBIF data on save

* db/schema

* Style

* Extract service

* Add concern

* Add concern

* Save photos

* Initial coverage

* Coverage

* Add coverage

* Shut up, codeclimate

* Shut up, codeclimate

* Unused

* Shut up, codeclimate

* Apply suggestions from code review

* Remove localhost

* Fix rubocop

* Fix rubocop

* Add UI links

* Add rake

* Indent

* Update Gemfile.lock

* Update lib/tasks/gbif.rake

* Update app/views/crops/_scientific_names.html.haml

* Rubocop

* Expand edit photo form

* Fix error

* Add model validations

* Skip photos without backlinks

* Fix tests

* Add photo words

* Allow blank

* Rubocop and handle invalid legacy data

* Apply suggestions from code review

* Update lib/tasks/gbif.rake
2024-01-21 13:22:25 +10:30
Daniel O'Connor d1f754a288 Rubocop 2022-11-08 00:23:38 +10:30
Daniel O'Connor 2db3d1bacc Various corrections 2022-11-08 00:21:23 +10:30
Daniel O'Connor 0aafaba718 Regenerate 2022-11-07 23:36:19 +10:30
Awesome Code 4cbe6ca244 Auto corrected by following Lint Ruby RSpec/DescribedClass 2020-03-03 22:33:13 +00:00