Commit Graph

4363 Commits

Author SHA1 Message Date
google-labs-jules[bot]
f2421bf4c7 Here's the plan to add polymorphic comments and update related functionality:
This change introduces polymorphic comments, allowing you to comment on Photos, Plantings, Harvests, and Activities, in addition to Posts.

Key changes include:

-   **Comment Model:**
    -   Made `Comment.commentable` a polymorphic association.
    -   Added a data migration to move existing post comments to the new structure.
    -   Updated notification creation logic for polymorphic commentables.
-   **CommentsController:**
    -   Refactored to handle various commentable types using a `find_commentable` method.
-   **Ability Model:**
    -   Updated permissions for comment creation, editing (author/admin), and deletion (author/commentable owner/admin).
-   **Routes:**
    -   Added nested comment routes for Photos, Plantings, Harvests, Activities, and Posts using a `commentable` concern with shallow routes.
-   **Views:**
    -   Created generic partials for comment forms (`_form.html.haml`) and display (`_comment.html.haml`, `_comments.html.haml`).
    -   Integrated these partials into the show pages of all commentable types.
    -   Updated `comments/new` and `comments/edit` views to be generic.
    -   Relevant parent controller `show` actions now eager-load comments.
-   **Testing:**
    -   Added extensive model, controller (using shared examples), and feature tests to cover the new polymorphic comment functionality, including permissions and UI interactions for all commentable types.
    -   Updated and created factories as needed.

This fulfills the issue requirements for adding comments to multiple resource types with appropriate permissions.
2025-05-25 02:03:17 +00:00
Daniel O'Connor
8224fe2aea Update _form.html.haml 2024-10-14 00:14:26 +10:30
Daniel O'Connor
58780ec199 Swap harvest to html5 date field (#3894)
* Update gardens to have a non 0 area

* Spec no longer possible through frontend

* Fix spec

* Swap harvest to html5 date field

* Fix spec
2024-10-14 00:09:30 +10:30
Daniel O'Connor
196ca1ba49 Merge pull request #3896 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml
2024-10-13 23:53:28 +10:30
Daniel O'Connor
443be95915 Merge pull request #3895 from Growstuff/CloCkWeRX-patch-5
Swap to HTML5 date field
2024-10-13 23:49:50 +10:30
Daniel O'Connor
9167c334f9 Merge pull request #3890 from Growstuff/CloCkWeRX-patch-3
Swap activities to datepicker
2024-10-13 23:36:12 +10:30
Daniel O'Connor
66f3a712ea Update _form.html.haml 2024-10-13 23:32:19 +10:30
Daniel O'Connor
26691419dc Merge pull request #3893 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml to mark required
2024-10-13 23:29:58 +10:30
Daniel O'Connor
8459bc2fdf Swap to HTML5 date field 2024-10-13 23:29:17 +10:30
Daniel O'Connor
2fe3c8fc73 Merge pull request #3892 from Growstuff/CloCkWeRX-patch-5
Update _form.html.haml to require a min of 1 seed
2024-10-13 23:22:13 +10:30
Daniel O'Connor
2b72e8f2da Merge pull request #3891 from Growstuff/CloCkWeRX-patch-4
Update _form.html.haml to require a min of 1 when planting
2024-10-13 23:21:11 +10:30
Daniel O'Connor
a2faf945a2 Update _form.html.haml to mark required 2024-10-13 23:08:16 +10:30
Daniel O'Connor
d1871106fa Merge pull request #3889 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml to mark dropdowns required
2024-10-13 23:04:21 +10:30
Daniel O'Connor
9a1b62fe52 Update _form.html.haml 2024-10-13 23:02:36 +10:30
Daniel O'Connor
d61222d4cc Update _form.html.haml 2024-10-13 23:01:10 +10:30
Daniel O'Connor
f8e1d75e83 Swap activities to datepicker 2024-10-13 22:57:26 +10:30
Daniel O'Connor
925bb582d3 Update gardens to have a non 0 area (#3885)
* Update gardens to have a non 0 area

* Spec no longer possible through frontend

* Fix spec
2024-10-13 22:53:51 +10:30
Daniel O'Connor
7acef18bc5 Merge pull request #3888 from Growstuff/required-help
Remove required text UI element
2024-10-13 22:47:21 +10:30
Daniel O'Connor
44857c3de7 Update _form.html.haml 2024-10-13 22:43:51 +10:30
Daniel O'Connor
825b0347af Merge pull request #3887 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml
2024-10-13 22:38:14 +10:30
Daniel O'Connor
001f370283 Merge branch 'dev' into required-help 2024-10-13 22:28:33 +10:30
Daniel O'Connor
a7a5b6ef17 Remove required text UI element 2024-10-13 11:56:56 +00:00
Daniel O'Connor
b3ecfcabf4 Merge pull request #3886 from Growstuff/CloCkWeRX-patch-5
Update seeds to have a min day range
2024-10-13 22:21:13 +10:30
Daniel O'Connor
c05ea9e651 Update _form.html.haml 2024-10-13 22:15:52 +10:30
Daniel O'Connor
d2cf94103a Merge pull request #3884 from Growstuff/CloCkWeRX-patch-3
Update auto_suggest_helper.rb to support required
2024-10-13 22:11:23 +10:30
Daniel O'Connor
6f5a241970 Update _form.html.haml 2024-10-13 21:56:01 +10:30
Daniel O'Connor
73e73e6c14 Update _form.html.haml 2024-10-13 21:54:49 +10:30
Daniel O'Connor
a8cd6ad10e Update auto_suggest_helper.rb to support required 2024-10-13 21:51:04 +10:30
Daniel O'Connor
1132198931 Update _plantings.scss 2024-10-13 21:48:13 +10:30
Daniel O'Connor
2484bd39ed Render where a planting is in card view (#3882)
* Render where a planting is in card view

* Update app/assets/stylesheets/_plantings.scss
2024-10-13 14:25:46 +10:30
Daniel O'Connor
681f3780ad Default a new activity as being done today 2024-10-13 12:41:59 +10:30
Daniel O'Connor
1c97ba1495 Garden collaboration (small part of community gardens) (#3862)
* Add collaboration model

* Permissions and garden show

* List by owner, or where I am a collaborator

* Add index

* Add permissions

* Typo

* Typo

* Add route

* Update schema

* Update schema

* Add CRUD

* Add CRUD

* Add CRUD

* Factory

* Add validations

* Rubocop

* Rubocop

* Rubocop

* Unique index

* Fix

* Make CI more fine grained for faster feedback

* Swap order

* Fix path, fail-fast

* Fix spec

* Remove 'significant drop in coverage' as not everything runs in one giant run

* Fix tests?
2024-09-29 18:28:52 +09:30
Daniel O'Connor
c063a33e8b Garden show and edit: encourage descriptions, add more calls to action (#3846)
* Better edit links

* Prompt for more detail

* Better action links

* Better action links

* Update show.html.haml

* Apply suggestions from code review

* Apply suggestions from code review
2024-09-29 18:28:42 +09:30
Daniel O'Connor
69876813c2 Merge pull request #3845 from Growstuff/only-show-active
Avoid showing plantings which are finished
2024-09-29 17:43:32 +09:30
Daniel O'Connor
79ef7347ad Avoid showing plantings which are finished 2024-09-08 02:26:11 +00:00
Daniel O'Connor
a5c5de414e Update overrides.scss 2024-08-31 19:06:45 +09:30
Daniel O'Connor
c28b2c0c38 Likes: Add capability to Activities, Plantings, Harvests (#3805)
* Ability to like activities

* Ability to like activities

* Add likeable everywhere

* Refactor

* Remove extra newline

* Typo

* Use classes, not IDs

* Explicitly wait for ajax

* Fix tests

* Move likes under owner

* Add separation

* Move harvest likes near actions

* Rearrange harvests

* Render likes under owner

* Make harvest consistent with other views

* Move planting detail into header

* Move detail into header

* Move detail into header

* Revert

* Fix header

* Move likes into jumotrons

* Fix name

* Change all actions to be after likes and a span

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* i18n and accessibility

* Fix name

* Temporarily make ack into a div

* Update app/views/photos/_actions.html.haml
2024-07-24 17:07:56 +09:30
Daniel O'Connor
83f2cf4a3c Require name, handle errors on crop create (#3799)
* 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
2024-07-23 19:44:21 +09:30
Daniel O'Connor
e7a0d0276f Photos > Show crop link (#3803)
* Fix #3802 Show crop link

* Fix #3802 Show crop link

* Fix missing arg

* Fix missing arg

* Translations
2024-07-17 20:06:32 +09:30
Daniel O'Connor
8ba7eef6be Simplify link 2024-07-13 11:56:24 +00:00
Daniel O'Connor
7e2be8efd9 Rubocop Rails 7.1 2024-07-13 06:29:08 +00:00
Daniel O'Connor
81060cccf7 Ruby 3.2: Rubocop - Lint/* and Style/* (#3786)
* Rubocop - Layout/*
* Rubocop - Lint and Style
2024-07-13 15:38:37 +09:30
Daniel O'Connor
4f5c47ba58 Ruby 3.2: Rubocop - Layout/* (#3785)
* Rubocop - Layout/*

* Regenerate
2024-07-13 15:19:09 +09:30
Daniel O'Connor
d542326047 Ruby 3.2: Rubocop - Rails/FilePath (#3783)
* Rails/FilePath
2024-07-13 15:13:56 +09:30
Daniel O'Connor
1176d18918 Ruby 3.2: Rubocop - Fix Lint/symbol conversion (#3781)
* Lint/SymbolConversion: Unnecessary symbol conversion; use error: instead.
2024-07-13 15:11:49 +09:30
Daniel O'Connor
000f4979db Trial Ruby32 (#3418)
* Ruby 3.2/Bundler 2.4

* Fix creation

* Upgrade to js-routes 2. Put all js routes into a global namespace.

* Remove js-routes

* Remove

* Adjust ownership

* Appease codeclimate for the nth time

* Fix deprecation warning by explicitly calling to_fs

* Fix deprecation warning by explicitly calling to_fs

* Fix deprecation warning by explicitly calling to_fs

* Swap to will paginate successor for bootstrap

* Update app/views/members/show.html.haml

* Update app/views/plantings/index.rss.haml

* Update .env

* Update .devcontainer/.env

* Fix spec

* Update spec

* Fix spec

* Pin to 2.4.22

* 3 space indent

* Regenerate

* Update rubocop
2024-07-13 14:45:33 +09:30
Daniel O'Connor
57f1fd34c9 Update garden.rb 2024-07-02 23:08:29 +09:30
Daniel O'Connor
067fb1671b Update predict_planting.rb 2024-07-02 23:07:48 +09:30
Daniel O'Connor
fa6df64221 Update garden.rb 2024-07-02 22:42:35 +09:30
Daniel O'Connor
3d524bb105 Update garden.rb 2024-07-02 17:37:17 +09:30