Commit Graph
68 Commits
Author SHA1 Message Date
Brenda Wallace f20bf69d32 feat: Allow saving blank drafts for photo attachments and update validations 2026-10-28 21:50:26 +13:00
Brenda Wallace b6006df384 feat: Implement draft autosave and preview functionality in PostEditor
- Added useDraftAutosave hook to handle automatic saving of post drafts.
- Enhanced PostEditor component to include a preview tab that fetches and displays rendered markdown.
- Updated Post model to manage draft state and associated published_at timestamp.
- Introduced card_photo association to Post for representing a primary image.
- Modified post form to support draft saving and publishing actions.
- Updated navigation to include links to drafts.
- Added tests for draft saving, preview functionality, and card photo validation.
- Created migrations for new database fields related to drafts and card photos.
2026-10-28 21:50:26 +13:00
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30
google-labs-jules[bot]andDaniel O'Connor 8564ec7a7c Add comments to photos (#4130)
* Add comments to photos

Extend the photo show page to support comments by logged in users.

- Make the Comment model polymorphic.
- Update the Photo and Post models to have comments.
- Update the comments controller to handle the polymorphic association.
- Update the photo show page to display comments and a comment form.
- Create a reusable comments partial.

* Add migration

* Fix tests

* Fix tests

* Slightly fix tests

* Fix variables

* Add field

* Refactor slightly

* Refactor slightly

* Refactor slightly

* Refactor

* Photos respond to this as well

* Refactor to polymorphic_url

* Rename

* Wrong relationship

* Refactor and fix tests

* Fix relationships

* Fix rendering

* Fix tests

* Fix model tests

* Fix test

* Fix test

* Fix test

* Fix test

* Fix controller spec

* Fix view tests

---------

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-24 21:10:16 +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 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 e2942f17c7 Rubocop corrections 2022-11-08 00:18:35 +10:30
Daniel O'Connor b24b9f82e6 Rubocop - auto corrections 2022-11-06 16:34:36 +10:30
Awesome Code 4cbe6ca244 Auto corrected by following Lint Ruby RSpec/DescribedClass 2020-03-03 22:33:13 +00:00
codefactor-io 4ff95fbac9 [CodeFactor] Apply fixes 2020-01-21 22:26:08 +13:00
Brenda 7257b2ada1 Update with frozen literals 2020-01-10 16:50:52 +13:00
Brenda Wallace 04fd1a343a Rubocop update (#2334)
* Update rubocop config

* Rubocop update - for rubocop 0.77

* [CodeFactor] Apply fixes

* rubocop fixes

* [CodeFactor] Apply fixes to commit 2826c2e
2019-12-16 22:35:33 +13:00
Brenda Wallace 2949abd6bf SEt subject of post in spec, so it matches the tests 2019-06-14 11:47:15 +12:00
Awesome Code ad470ede1d Auto corrected by following Lint Ruby RSpec/AlignRightLetBrace 2019-03-13 17:23:33 +13:00
Awesome Code f90cc792bb Auto corrected by following Lint Ruby RSpec/AlignLeftLetBrace 2019-03-13 11:42:27 +13:00
Awesome Code 689baa85a3 Auto corrected by following Lint Ruby RSpec/ExampleWording 2019-02-11 10:17:54 +13:00
Awesome Code 284bb81bbf Auto corrected by following Lint Ruby RSpecEmptyLine 2019-02-09 03:05:40 +00:00
Brenda Wallace 7b01fcbd4b Align all the hashes 2018-12-30 15:22:29 +13:00
Brenda Wallace 22e456f3af Time stamps need a timezone 2018-12-30 15:06:24 +13:00
Brenda Wallace a00237dfcb Style fixes after rubocop upgrade 2018-04-02 15:48:16 +12:00
Brenda Wallace d9bdc46099 Merge remote-tracking branch 'upstream/dev' into upgrade/rails-5
Conflicts:
	app/assets/javascripts/members.js.erb
2018-01-21 21:20:43 +13:00
Awesome Code 273e4c07d8 Auto corrected by following RSpec/NotToNot 2018-01-13 22:49:49 +00:00
Awesome Code e46f530dc3 Auto corrected by following RSpec/EmptyLineAfterFinalLet 2018-01-09 02:00:40 +00:00
Brenda Wallace 4800f405ea Two more fixes to tests for slug generation 2018-01-06 12:35:05 +13:00
Brenda Wallace 3cc637017d Avoid {} for multiline 2017-12-06 14:29:21 +13:00
Brenda Wallace 6aa689b0d8 Removed some model ordering specs 2017-11-29 20:59:37 +13:00
Logan Gingerich 10a8df47a9 Factorygirl to factorybot - fixes #1413 (#1425)
* FactoryGirl Changed to FactoryBot

file fix

changes based on comments received

Bundle Update on 2017-10-29

style update to align hash literal

added package-lock

* indentation fixes with rubocop

* name added to contributors
2017-11-01 15:03:31 +00:00
Brenda Wallace a6964a8f4e Update specs to join before checking member is destroyed. 2017-05-21 21:59:28 +12:00
Brenda Wallace 121d3d99fe Tests for retrieving data of deleted members 2017-05-21 11:36:07 +12:00
Brenda Wallace 322f28eaa6 bugfix in some spec expectations 2017-03-05 00:36:10 +13:00
Brenda Wallace e184503caa Fix up to match rubocop's MultilineMethodCallBraceLayout recommendation 2017-02-19 16:17:03 +13:00
Brenda Wallace ff50ec65d0 Merge remote-tracking branch 'upstream/dev' into HEAD 2017-01-22 18:26:29 +13:00
Miles Gould abb9acd04a post_spec: fix warnings
Several "unused variable" warnings (due to replacing unused instance
variables with unused locals) and one warning about ambiguous
lack-of-brackets.
2016-12-19 16:40:05 +00:00
Miles Gould 67faa5554c post_spec: replace instance vars with local vars
The @ in front of a variable makes it an instance variable of the
surrounding object. There's no point doing that for variables that are
only used in a single function, so I've made such variables in the file
post_spec.rb into function-local variables. We should do this more
generally: there are a lot of instances of this (anti?)pattern in our
test suite.
2016-12-19 16:36:46 +00:00
Miles Gould 59b86c9b0c Replace << with string-interpolation in post_spec 2016-12-19 16:33:41 +00:00
Miles Gould 7239cf068b Test [member name](member) mention syntax 2016-12-19 16:31:32 +00:00
Miles Gould c23e80b56d Test Post.recently_active 2016-12-19 16:26:17 +00:00
Miles Gould b011fc9bae Test Post.comment_count 2016-12-19 16:17:31 +00:00
Daniel O'Connor fef272e30f Merge remote-tracking branch 'upstream/dev' into likeable 2016-12-09 11:42:32 +10:30
Brenda Wallace 62e7c716dd Removed extra empty blank lines 2016-11-26 12:06:02 +13:00
Brenda Wallace 564731667e Fixed up all remaining hash alignment 2016-11-26 11:17:42 +13:00
Brenda Wallace bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor d3dac756d6 Merge remote-tracking branch 'upstream/dev' into likeable 2016-07-09 21:08:33 +09:30
Daniel O'Connor 0620646c6d Fix failing specs
- Updated assert_select behaviour given this is now based on nokogiri
 - Adjust some specs not to look for a specific asset name, but a behaviour
 - Adjust some specs for HTML5 style attributes instead of xhtml style
 - Fix tests that did not render before
2016-06-10 16:01:30 +09:30
Daniel O'Connor bb25cbe5e2 Merge branch 'dev' of github.com:Growstuff/growstuff into likeable 2016-06-04 21:00:52 +09:30
Daniel O'Connor 4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Savant Krishna 1908f670d9 Tests for feature #505 : Notifying members when mentioned 2015-09-06 14:41:04 +10:00
Miles Gould f29c0ad085 Replace .length calls with .size 2015-07-23 23:21:55 +01:00
Cjay c568498941 Refactor spec/models
- Changed before(:each) into let
- Changed :admin_ability and :cw_ability into :ability
2015-07-09 02:21:10 +08:00