Skip to content

Commit 4978c9e

Browse files
authored
Merge branch 'main' into dependabot/bundler/rubocop-rails-2.33.3
2 parents f3c6427 + 54d1f87 commit 4978c9e

File tree

395 files changed

+8722
-1434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

395 files changed

+8722
-1434
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
include:
1313
- ruby: '3.4.4'
14-
rails: '7.1.5.1'
14+
rails: '7.1.5.2'
1515
allowed_failure: false # ✅ required
1616
- ruby: '3.4.4'
1717
rails: '7.2.2.1'
@@ -55,15 +55,15 @@ jobs:
5555
# Run the automatic bundle-install only on 7.1.
5656
# For 7.2 / 8.0 it just sets up Ruby *and* restores a cache layer
5757
# that we’ll reuse in the later manual install.
58-
bundler-cache: ${{ matrix.rails == '7.1.5.1' }}
58+
bundler-cache: ${{ matrix.rails == '7.1.5.2' }}
5959

6060
# One cache bucket per Rails version so they don’t clobber each other.
6161
cache-version: rails-${{ matrix.rails }}
6262

6363
# Updating Rails can legitimately blow up on the experimental tracks,
6464
# so we allow that *step* to error out without failing the job.
6565
- name: Update Rails & install gems
66-
if: matrix.rails != '7.1.5.1'
66+
if: matrix.rails != '7.1.5.2'
6767
id: update
6868
run: |
6969
# turn off deployment mode
@@ -75,20 +75,20 @@ jobs:
7575
continue-on-error: ${{ matrix.allowed_failure }}
7676

7777
- name: Prepare DB schema
78-
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
78+
if: (matrix.rails == '7.1.5.2') || steps.update.outcome == 'success'
7979
run: |
8080
rm -f spec/dummy/tmp/pids/server.pid
8181
bundle exec rake -f spec/dummy/Rakefile db:schema:load
8282
continue-on-error: ${{ matrix.allowed_failure }}
8383

8484
- name: Wait for Elasticsearch
85-
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
85+
if: (matrix.rails == '7.1.5.2') || steps.update.outcome == 'success'
8686
run: |
8787
echo "Waiting for Elasticsearch to be healthy..."
8888
curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" || (echo "Elasticsearch not healthy" && exit 1)
8989
9090
- name: Run RSpec
91-
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
91+
if: (matrix.rails == '7.1.5.2') || steps.update.outcome == 'success'
9292
env:
9393
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
9494
run: |

.rubocop.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ AllCops:
55
- 'spec/dummy/db/schema.rb'
66
- 'vendor/**/*'
77
NewCops: enable
8+
TargetRubyVersion: 3.4
9+
plugins:
10+
- rubocop-rails
11+
- rubocop-rspec
12+
- rubocop-rspec_rails
13+
- rubocop-capybara
14+
- rubocop-factory_bot
815
Style/StringLiterals:
916
Exclude:
1017
- 'db/migrate/*'
18+
19+
Rails:
20+
Enabled: false
21+
Capybara:
22+
Enabled: false
23+
FactoryBot:
24+
Enabled: false

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ gem 'pundit-resources', '~> 1.1.4', github: 'better-together-org/pundit-resource
2727

2828
# Core Rails gem
2929
gem 'rack-protection'
30-
gem 'rails', ENV.fetch('RAILS_VERSION', '7.1.5.1')
30+
gem 'rails', ENV.fetch('RAILS_VERSION', '7.1.5.2')
3131

3232
# Redis for ActionCable and background jobs
3333
gem 'redis', '~> 5.4'

Gemfile.lock

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -68,51 +68,51 @@ PATH
6868
GEM
6969
remote: https://rubygems.org/
7070
specs:
71-
actioncable (7.1.5.1)
72-
actionpack (= 7.1.5.1)
73-
activesupport (= 7.1.5.1)
71+
actioncable (7.1.5.2)
72+
actionpack (= 7.1.5.2)
73+
activesupport (= 7.1.5.2)
7474
nio4r (~> 2.0)
7575
websocket-driver (>= 0.6.1)
7676
zeitwerk (~> 2.6)
77-
actionmailbox (7.1.5.1)
78-
actionpack (= 7.1.5.1)
79-
activejob (= 7.1.5.1)
80-
activerecord (= 7.1.5.1)
81-
activestorage (= 7.1.5.1)
82-
activesupport (= 7.1.5.1)
77+
actionmailbox (7.1.5.2)
78+
actionpack (= 7.1.5.2)
79+
activejob (= 7.1.5.2)
80+
activerecord (= 7.1.5.2)
81+
activestorage (= 7.1.5.2)
82+
activesupport (= 7.1.5.2)
8383
mail (>= 2.7.1)
8484
net-imap
8585
net-pop
8686
net-smtp
87-
actionmailer (7.1.5.1)
88-
actionpack (= 7.1.5.1)
89-
actionview (= 7.1.5.1)
90-
activejob (= 7.1.5.1)
91-
activesupport (= 7.1.5.1)
87+
actionmailer (7.1.5.2)
88+
actionpack (= 7.1.5.2)
89+
actionview (= 7.1.5.2)
90+
activejob (= 7.1.5.2)
91+
activesupport (= 7.1.5.2)
9292
mail (~> 2.5, >= 2.5.4)
9393
net-imap
9494
net-pop
9595
net-smtp
9696
rails-dom-testing (~> 2.2)
97-
actionpack (7.1.5.1)
98-
actionview (= 7.1.5.1)
99-
activesupport (= 7.1.5.1)
97+
actionpack (7.1.5.2)
98+
actionview (= 7.1.5.2)
99+
activesupport (= 7.1.5.2)
100100
nokogiri (>= 1.8.5)
101101
racc
102102
rack (>= 2.2.4)
103103
rack-session (>= 1.0.1)
104104
rack-test (>= 0.6.3)
105105
rails-dom-testing (~> 2.2)
106106
rails-html-sanitizer (~> 1.6)
107-
actiontext (7.1.5.1)
108-
actionpack (= 7.1.5.1)
109-
activerecord (= 7.1.5.1)
110-
activestorage (= 7.1.5.1)
111-
activesupport (= 7.1.5.1)
107+
actiontext (7.1.5.2)
108+
actionpack (= 7.1.5.2)
109+
activerecord (= 7.1.5.2)
110+
activestorage (= 7.1.5.2)
111+
activesupport (= 7.1.5.2)
112112
globalid (>= 0.6.0)
113113
nokogiri (>= 1.8.5)
114-
actionview (7.1.5.1)
115-
activesupport (= 7.1.5.1)
114+
actionview (7.1.5.2)
115+
activesupport (= 7.1.5.2)
116116
builder (~> 3.1)
117117
erubi (~> 1.11)
118118
rails-dom-testing (~> 2.2)
@@ -125,27 +125,27 @@ GEM
125125
activestorage (>= 6.1.4)
126126
activesupport (>= 6.1.4)
127127
marcel (>= 1.0.3)
128-
activejob (7.1.5.1)
129-
activesupport (= 7.1.5.1)
128+
activejob (7.1.5.2)
129+
activesupport (= 7.1.5.2)
130130
globalid (>= 0.3.6)
131-
activemodel (7.1.5.1)
132-
activesupport (= 7.1.5.1)
133-
activerecord (7.1.5.1)
134-
activemodel (= 7.1.5.1)
135-
activesupport (= 7.1.5.1)
131+
activemodel (7.1.5.2)
132+
activesupport (= 7.1.5.2)
133+
activerecord (7.1.5.2)
134+
activemodel (= 7.1.5.2)
135+
activesupport (= 7.1.5.2)
136136
timeout (>= 0.4.0)
137137
activerecord-import (2.2.0)
138138
activerecord (>= 4.2)
139139
activerecord-postgis-adapter (9.0.2)
140140
activerecord (~> 7.1.0)
141141
rgeo-activerecord (~> 7.0.0)
142-
activestorage (7.1.5.1)
143-
actionpack (= 7.1.5.1)
144-
activejob (= 7.1.5.1)
145-
activerecord (= 7.1.5.1)
146-
activesupport (= 7.1.5.1)
142+
activestorage (7.1.5.2)
143+
actionpack (= 7.1.5.2)
144+
activejob (= 7.1.5.2)
145+
activerecord (= 7.1.5.2)
146+
activesupport (= 7.1.5.2)
147147
marcel (~> 1.0)
148-
activesupport (7.1.5.1)
148+
activesupport (7.1.5.2)
149149
base64
150150
benchmark (>= 0.3)
151151
bigdecimal
@@ -548,20 +548,20 @@ GEM
548548
rack (>= 1.3)
549549
rackup (2.2.1)
550550
rack (>= 3)
551-
rails (7.1.5.1)
552-
actioncable (= 7.1.5.1)
553-
actionmailbox (= 7.1.5.1)
554-
actionmailer (= 7.1.5.1)
555-
actionpack (= 7.1.5.1)
556-
actiontext (= 7.1.5.1)
557-
actionview (= 7.1.5.1)
558-
activejob (= 7.1.5.1)
559-
activemodel (= 7.1.5.1)
560-
activerecord (= 7.1.5.1)
561-
activestorage (= 7.1.5.1)
562-
activesupport (= 7.1.5.1)
551+
rails (7.1.5.2)
552+
actioncable (= 7.1.5.2)
553+
actionmailbox (= 7.1.5.2)
554+
actionmailer (= 7.1.5.2)
555+
actionpack (= 7.1.5.2)
556+
actiontext (= 7.1.5.2)
557+
actionview (= 7.1.5.2)
558+
activejob (= 7.1.5.2)
559+
activemodel (= 7.1.5.2)
560+
activerecord (= 7.1.5.2)
561+
activestorage (= 7.1.5.2)
562+
activesupport (= 7.1.5.2)
563563
bundler (>= 1.15.0)
564-
railties (= 7.1.5.1)
564+
railties (= 7.1.5.2)
565565
rails-dom-testing (2.3.0)
566566
activesupport (>= 5.0.0)
567567
minitest
@@ -572,9 +572,9 @@ GEM
572572
rails-i18n (7.0.10)
573573
i18n (>= 0.7, < 2)
574574
railties (>= 6.0.0, < 8)
575-
railties (7.1.5.1)
576-
actionpack (= 7.1.5.1)
577-
activesupport (= 7.1.5.1)
575+
railties (7.1.5.2)
576+
actionpack (= 7.1.5.2)
577+
activesupport (= 7.1.5.2)
578578
irb
579579
rackup (>= 1.0.0)
580580
rake (>= 12.2)
@@ -845,7 +845,7 @@ DEPENDENCIES
845845
pundit-resources (~> 1.1.4)!
846846
rack-mini-profiler
847847
rack-protection
848-
rails (= 7.1.5.1)
848+
rails (= 7.1.5.2)
849849
rb-readline
850850
rbtrace
851851
redis (~> 5.4)

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ This project embodies our vision of a world where collaboration leads to greater
1010

1111
This project is the core community building portion of the Better Together platform.
1212

13+
## Joatu Requests and Offers
14+
15+
The Joatu module enables community members to post service **requests** and **offers** and to create agreements between them.
16+
17+
### Endpoints
18+
19+
- `POST /:locale/joatu/requests` — create a request
20+
- `POST /:locale/joatu/offers` — create an offer
21+
- `POST /:locale/joatu/agreements` — create an agreement between an offer and a request
22+
- `POST /:locale/joatu/agreements/:id/reject` — reject an agreement
23+
24+
Each endpoint expects parameters nested under the matching resource name. For example:
25+
26+
```bash
27+
curl -X POST /en/joatu/requests \\
28+
-d 'request[name]=Repair help' \\
29+
-d 'request[description]=Need bike fixes' \\
30+
-d 'request[creator_id]=<person_uuid>'
31+
```
32+
1333
## Dependencies
1434

1535
In addition to other dependencies, the Better Together Community Engine relies on Action Text and Action Storage, which are part of the Rails framework. These dependencies are essential for handling rich text content and file storage within the platform.

app/assets/stylesheets/better_together/application.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
}
7373

7474
#flash_messages {
75-
position: absolute;
75+
position: fixed;
7676
width: 100vw;
7777
top: 6vh;
7878
z-index: 1001;

app/assets/stylesheets/better_together/forms.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
font-weight: bold;
66
}
77

8+
.form-label {
9+
font-weight: 500;
10+
}
11+
12+
.agreement-modal-link {
13+
text-decoration: none;
14+
}
15+
816
.bt-mb-3 {
917
margin-bottom: 1rem;
1018
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# frozen_string_literal: true
2+
3+
# app/builders/better_together/agreement_builder.rb
4+
5+
module BetterTogether
6+
# Builder to seed initial agreements
7+
class AgreementBuilder < Builder
8+
class << self
9+
def seed_data
10+
build_privacy_policy
11+
build_terms_of_service
12+
build_code_of_conduct
13+
end
14+
15+
def clear_existing
16+
BetterTogether::AgreementParticipant.delete_all
17+
BetterTogether::AgreementTerm.delete_all
18+
BetterTogether::Agreement.delete_all
19+
end
20+
21+
# rubocop:todo Metrics/AbcSize
22+
def build_privacy_policy # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
23+
agreement = BetterTogether::Agreement.find_or_create_by!(identifier: 'privacy_policy') do |a|
24+
a.protected = true
25+
a.title = 'Privacy Policy'
26+
a.description = 'Summary of how we handle your data.'
27+
a.privacy = 'public'
28+
end
29+
30+
agreement.agreement_terms.find_or_create_by!(identifier: 'privacy_policy_summary') do |term|
31+
term.protected = true
32+
term.position = 1
33+
term.content = 'We respect your privacy and protect your personal information.'
34+
end
35+
36+
# If a Page exists for the privacy policy, link it so the page content
37+
# is shown to users instead of the agreement terms.
38+
page = BetterTogether::Page.find_by(identifier: 'privacy_policy') ||
39+
BetterTogether::Page.find_by(slug: 'privacy-policy')
40+
agreement.update!(page: page) if page.present?
41+
end
42+
# rubocop:enable Metrics/AbcSize
43+
44+
# rubocop:todo Metrics/AbcSize
45+
def build_terms_of_service # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
46+
agreement = BetterTogether::Agreement.find_or_create_by!(identifier: 'terms_of_service') do |a|
47+
a.protected = true
48+
a.title = 'Terms of Service'
49+
a.description = 'Rules you agree to when using the platform.'
50+
a.privacy = 'public'
51+
end
52+
53+
agreement.agreement_terms.find_or_create_by!(identifier: 'terms_of_service_summary') do |term|
54+
term.protected = true
55+
term.position = 1
56+
term.content = 'Use the platform responsibly and respectfully.'
57+
end
58+
59+
# Link a Terms of Service Page if one exists
60+
page = BetterTogether::Page.find_by(identifier: 'terms_of_service') ||
61+
BetterTogether::Page.find_by(slug: 'terms-of-service')
62+
agreement.update!(page: page) if page.present?
63+
end
64+
# rubocop:enable Metrics/AbcSize
65+
66+
# rubocop:todo Metrics/MethodLength
67+
def build_code_of_conduct # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
68+
agreement = BetterTogether::Agreement.find_or_create_by!(identifier: 'code_of_conduct') do |a|
69+
a.protected = true
70+
a.title = 'Code of Conduct'
71+
a.description = 'Community code of conduct and expectations.'
72+
a.privacy = 'public'
73+
end
74+
75+
agreement.agreement_terms.find_or_create_by!(identifier: 'code_of_conduct_summary') do |term|
76+
term.protected = true
77+
term.position = 1
78+
term.content = 'Be respectful, inclusive, and considerate to other community members.'
79+
end
80+
81+
# Link a Code of Conduct Page if one exists
82+
page = BetterTogether::Page.find_by(identifier: 'code_of_conduct') ||
83+
BetterTogether::Page.find_by(slug: 'code-of-conduct')
84+
agreement.update!(page: page) if page.present?
85+
end
86+
# rubocop:enable Metrics/MethodLength
87+
end
88+
end
89+
end

0 commit comments

Comments
 (0)