Skip to content

Commit 2fda2d3

Browse files
authored
Merge branch 'main' into 5372AlignmentNudges3
2 parents ebdb98b + 819e933 commit 2fda2d3

32 files changed

+275
-95
lines changed

.devcontainer/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ services:
2828
POSTGRES_USER: postgres
2929
POSTGRES_DB: postgres
3030
POSTGRES_PASSWORD: postgres
31-
# Note that these ports are ignored by the devcontainer.
32-
# Instead, the ports are specified in .devcontainer/devcontainer.json.
33-
# ports:
34-
# - "5432:5432"
31+
ports:
32+
- "5432:5432" # For non-devcontainer local usage
3533
volumes:
3634
postgres-data:

.github/workflows/rspec-system.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
if: ${{ failure() }}
8787
uses: actions/upload-artifact@v4
8888
with:
89-
name: failed-browser-tests
89+
name: failed-browser-tests-${{ matrix.ci_node_index }}
9090
path: |
9191
tmp/screenshots
9292
tmp/capybara

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ group :development, :test do
151151
# Debugger which supports rdbg and Shopify Ruby LSP VSCode extension
152152
gem "debug", ">= 1.0.0"
153153
# RSpec behavioral testing framework for Rails.
154-
gem "rspec-rails", "~> 8.0.0"
154+
gem "rspec-rails", "~> 8.0.2"
155155
# Static analysis / linter.
156156
gem "rubocop"
157157
# Rails add-on for static analysis.
@@ -208,7 +208,7 @@ group :test do
208208
# Show code coverage.
209209
gem 'simplecov'
210210
# Mock HTTP requests and ensure they are not called during tests.
211-
gem "webmock", "~> 3.25"
211+
gem "webmock", "~> 3.26"
212212
# Interface capybara to chrome headless
213213
gem "cuprite"
214214
# Read PDF files for tests

Gemfile.lock

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,28 @@ GEM
7676
addressable (2.8.7)
7777
public_suffix (>= 2.0.2, < 7.0)
7878
afm (0.2.2)
79-
annotaterb (4.19.0)
79+
annotaterb (4.20.0)
8080
activerecord (>= 6.0.0)
8181
activesupport (>= 6.0.0)
8282
ast (2.4.3)
8383
autoprefixer-rails (10.4.13.0)
8484
execjs (~> 2)
8585
awesome_print (1.9.2)
8686
aws-eventstream (1.4.0)
87-
aws-partitions (1.1168.0)
88-
aws-sdk-core (3.233.0)
87+
aws-partitions (1.1187.0)
88+
aws-sdk-core (3.239.1)
8989
aws-eventstream (~> 1, >= 1.3.0)
9090
aws-partitions (~> 1, >= 1.992.0)
9191
aws-sigv4 (~> 1.9)
9292
base64
9393
bigdecimal
9494
jmespath (~> 1, >= 1.6.1)
9595
logger
96-
aws-sdk-kms (1.113.0)
97-
aws-sdk-core (~> 3, >= 3.231.0)
96+
aws-sdk-kms (1.118.0)
97+
aws-sdk-core (~> 3, >= 3.239.1)
9898
aws-sigv4 (~> 1.5)
99-
aws-sdk-s3 (1.199.1)
100-
aws-sdk-core (~> 3, >= 3.231.0)
99+
aws-sdk-s3 (1.205.0)
100+
aws-sdk-core (~> 3, >= 3.234.0)
101101
aws-sdk-kms (~> 1)
102102
aws-sigv4 (~> 1.5)
103103
aws-sigv4 (1.12.1)
@@ -112,7 +112,7 @@ GEM
112112
nokogiri (~> 1, >= 1.10.8)
113113
base64 (0.3.0)
114114
bcrypt (3.1.20)
115-
benchmark (0.4.1)
115+
benchmark (0.5.0)
116116
better_errors (2.10.1)
117117
erubi (>= 1.0.0)
118118
rack (>= 0.9.0)
@@ -124,7 +124,7 @@ GEM
124124
erubi (~> 1.4)
125125
parser (>= 2.4)
126126
smart_properties
127-
bigdecimal (3.2.3)
127+
bigdecimal (3.3.1)
128128
bindex (0.8.1)
129129
binding_of_caller (1.0.1)
130130
debug_inspector (>= 1.2.0)
@@ -139,7 +139,7 @@ GEM
139139
bugsnag (6.28.0)
140140
concurrent-ruby (~> 1.0)
141141
builder (3.3.0)
142-
bullet (8.0.8)
142+
bullet (8.1.0)
143143
activesupport (>= 3.0.0)
144144
uniform_notifier (~> 1.11)
145145
capybara (3.40.0)
@@ -162,7 +162,7 @@ GEM
162162
coderay (1.1.3)
163163
concurrent-ruby (1.3.5)
164164
connection_pool (2.5.4)
165-
crack (1.0.0)
165+
crack (1.0.1)
166166
bigdecimal
167167
rexml
168168
crass (1.0.6)
@@ -174,7 +174,7 @@ GEM
174174
activerecord (>= 5.a)
175175
database_cleaner-core (~> 2.0)
176176
database_cleaner-core (2.0.1)
177-
date (3.4.1)
177+
date (3.5.0)
178178
debug (1.11.0)
179179
irb (~> 1.10)
180180
reline (>= 0.3.8)
@@ -229,7 +229,7 @@ GEM
229229
dry-inflector (~> 1.0)
230230
dry-logic (~> 1.4)
231231
zeitwerk (~> 2.6)
232-
erb (5.0.2)
232+
erb (6.0.0)
233233
erb_lint (0.9.0)
234234
activesupport
235235
better_html (>= 2.0.1)
@@ -316,12 +316,12 @@ GEM
316316
guard (~> 2.1)
317317
guard-compat (~> 1.1)
318318
rspec (>= 2.99.0, < 4.0)
319-
hashdiff (1.2.0)
319+
hashdiff (1.2.1)
320320
hashery (2.1.2)
321321
hashie (5.0.0)
322322
i18n (1.14.7)
323323
concurrent-ruby (~> 1.0)
324-
icalendar (2.11.2)
324+
icalendar (2.12.1)
325325
base64
326326
ice_cube (~> 0.16)
327327
logger
@@ -333,7 +333,7 @@ GEM
333333
activesupport (>= 6.0.0)
334334
railties (>= 6.0.0)
335335
io-console (0.8.1)
336-
irb (1.15.2)
336+
irb (1.15.3)
337337
pp (>= 0.6.0)
338338
rdoc (>= 4.0.0)
339339
reline (>= 0.4.2)
@@ -395,7 +395,7 @@ GEM
395395
memory_profiler (1.1.0)
396396
method_source (1.1.0)
397397
mini_mime (1.1.5)
398-
minitest (5.25.5)
398+
minitest (5.26.2)
399399
monetize (1.12.0)
400400
money (~> 6.12)
401401
money (6.16.0)
@@ -423,13 +423,13 @@ GEM
423423
timeout
424424
net-smtp (0.5.1)
425425
net-protocol
426-
newrelic_rpm (9.21.0)
426+
newrelic_rpm (9.23.0)
427427
nio4r (2.7.4)
428-
nokogiri (1.18.9-arm64-darwin)
428+
nokogiri (1.18.10-arm64-darwin)
429429
racc (~> 1.4)
430-
nokogiri (1.18.9-x86_64-darwin)
430+
nokogiri (1.18.10-x86_64-darwin)
431431
racc (~> 1.4)
432-
nokogiri (1.18.9-x86_64-linux-gnu)
432+
nokogiri (1.18.10-x86_64-linux-gnu)
433433
racc (~> 1.4)
434434
notiffany (0.1.3)
435435
nenv (~> 0.1)
@@ -480,7 +480,7 @@ GEM
480480
pg (1.6.1-x86_64-darwin)
481481
pg (1.6.1-x86_64-linux)
482482
popper_js (2.11.8)
483-
pp (0.6.2)
483+
pp (0.6.3)
484484
prettyprint
485485
prawn (2.4.0)
486486
pdf-core (~> 0.9.0)
@@ -517,7 +517,7 @@ GEM
517517
puma (7.0.4)
518518
nio4r (~> 2.0)
519519
racc (1.8.1)
520-
rack (3.2.1)
520+
rack (3.2.4)
521521
rack-mini-profiler (4.0.1)
522522
rack (>= 1.2.0)
523523
rack-protection (4.1.1)
@@ -570,46 +570,47 @@ GEM
570570
thor (~> 1.0, >= 1.2.2)
571571
zeitwerk (~> 2.6)
572572
rainbow (3.1.1)
573-
rake (13.3.0)
573+
rake (13.3.1)
574574
rb-fsevent (0.11.2)
575575
rb-inotify (0.10.1)
576576
ffi (~> 1.0)
577-
rdoc (6.14.2)
577+
rdoc (6.15.1)
578578
erb
579579
psych (>= 4.0.0)
580-
recaptcha (5.20.1)
580+
tsort
581+
recaptcha (5.21.1)
581582
regexp_parser (2.11.3)
582-
reline (0.6.2)
583+
reline (0.6.3)
583584
io-console (~> 0.5)
584585
request_store (1.7.0)
585586
rack (>= 1.4)
586587
responders (3.1.1)
587588
actionpack (>= 5.2)
588589
railties (>= 5.2)
589-
rexml (3.4.1)
590+
rexml (3.4.4)
590591
rolify (6.0.1)
591592
rouge (4.1.2)
592593
rspec (3.13.0)
593594
rspec-core (~> 3.13.0)
594595
rspec-expectations (~> 3.13.0)
595596
rspec-mocks (~> 3.13.0)
596-
rspec-core (3.13.4)
597+
rspec-core (3.13.6)
597598
rspec-support (~> 3.13.0)
598599
rspec-expectations (3.13.5)
599600
diff-lcs (>= 1.2.0, < 2.0)
600601
rspec-support (~> 3.13.0)
601-
rspec-mocks (3.13.5)
602+
rspec-mocks (3.13.7)
602603
diff-lcs (>= 1.2.0, < 2.0)
603604
rspec-support (~> 3.13.0)
604-
rspec-rails (8.0.0)
605+
rspec-rails (8.0.2)
605606
actionpack (>= 7.2)
606607
activesupport (>= 7.2)
607608
railties (>= 7.2)
608609
rspec-core (~> 3.13)
609610
rspec-expectations (~> 3.13)
610611
rspec-mocks (~> 3.13)
611612
rspec-support (~> 3.13)
612-
rspec-support (3.13.4)
613+
rspec-support (3.13.6)
613614
rubocop (1.80.2)
614615
json (~> 2.3)
615616
language_server-protocol (~> 3.17.0.2)
@@ -706,14 +707,15 @@ GEM
706707
rubocop-rails (~> 2.25.0)
707708
stimulus-rails (1.3.4)
708709
railties (>= 6.0.0)
709-
stringio (3.1.7)
710+
stringio (3.1.8)
710711
strong_migrations (2.5.0)
711712
activerecord (>= 7.1)
712713
terser (1.2.6)
713714
execjs (>= 0.3.0, < 3)
714715
thor (1.4.0)
715716
tilt (2.2.0)
716-
timeout (0.4.3)
717+
timeout (0.4.4)
718+
tsort (0.2.0)
717719
ttfunk (1.7.0)
718720
turbo-rails (2.0.17)
719721
actionpack (>= 7.1.0)
@@ -723,8 +725,8 @@ GEM
723725
unicode-display_width (3.2.0)
724726
unicode-emoji (~> 4.1)
725727
unicode-emoji (4.1.0)
726-
uniform_notifier (1.17.0)
727-
uri (1.0.3)
728+
uniform_notifier (1.18.0)
729+
uri (1.1.1)
728730
useragent (0.16.11)
729731
version_gem (1.1.8)
730732
warden (1.2.9)
@@ -734,7 +736,7 @@ GEM
734736
activemodel (>= 6.0.0)
735737
bindex (>= 0.4.0)
736738
railties (>= 6.0.0)
737-
webmock (3.25.1)
739+
webmock (3.26.1)
738740
addressable (>= 2.8.0)
739741
crack (>= 0.3.2)
740742
hashdiff (>= 0.4.0, < 2.0.0)
@@ -826,7 +828,7 @@ DEPENDENCIES
826828
rails-erd
827829
recaptcha
828830
rolify (~> 6.0)
829-
rspec-rails (~> 8.0.0)
831+
rspec-rails (~> 8.0.2)
830832
rubocop
831833
rubocop-performance
832834
rubocop-rails (~> 2.25.1)
@@ -846,7 +848,7 @@ DEPENDENCIES
846848
ttfunk (~> 1.7.0)
847849
turbo-rails
848850
web-console
849-
webmock (~> 3.25)
851+
webmock (~> 3.26)
850852

851853
BUNDLED WITH
852854
2.7.1

app/controllers/requests_controller.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ def show
3737
# pre-filled distribution containing all the requested items.
3838
def start
3939
request = Request.find(params[:id])
40-
request.status_started!
41-
flash[:notice] = "Request started"
42-
redirect_to new_distribution_path(request_id: request.id)
40+
begin
41+
request.status_started!
42+
flash[:notice] = "Request started"
43+
redirect_to new_distribution_path(request_id: request.id)
44+
rescue ActiveRecord::RecordInvalid
45+
flash[:alert] = request.errors.full_messages.to_sentence
46+
redirect_to request_path(request)
47+
end
4348
end
4449

4550
def print_picklist

app/models/organization.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def flipper_id
119119
['Sources of Funding', 'sources_of_funding'],
120120
['Area Served', 'area_served'],
121121
['Population Served', 'population_served'],
122-
['Executive Director', 'executive_director'],
122+
['Contacts', 'contacts'],
123123
['Pickup Person', 'pick_up_person'],
124124
['Agency Distribution Information', 'agency_distribution_information'],
125125
['Attached Documents', 'attached_documents']

app/models/partners/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class Profile < Base
162162
# population_hispanic, population_asian, population_american_indian, population_island,
163163
# population_multi_racial, population_other, zips_served, at_fpl_or_below, above_1_2_times_fpl
164164
# greater_2_times_fpl, poverty_unknown
165-
# executive_director
165+
# contacts
166166
# executive_director_name, executive_director_phone, executive_director_email, primary_contact_name,
167167
# primary_contact_phone, primary_contact_mobile, primary_contact_email
168168
# pick_up_person

app/models/request.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Request < ApplicationRecord
3737
validates :distribution_id, uniqueness: true, allow_nil: true
3838
validate :item_requests_uniqueness_by_item_id
3939
validate :not_completely_empty
40+
validate :cannot_change_status_once_fulfilled, on: :update
4041

4142
after_validation :sanitize_items_data
4243

@@ -86,4 +87,10 @@ def not_completely_empty
8687
errors.add(:base, "completely empty request")
8788
end
8889
end
90+
91+
def cannot_change_status_once_fulfilled
92+
if status_changed? && status_was == "fulfilled"
93+
errors.add(:status, "cannot be changed once fulfilled")
94+
end
95+
end
8996
end

app/services/distribution_itemized_breakdown_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def distributions
5959
end
6060

6161
def current_onhand_quantities(inventory)
62-
inventory.all_items.group_by(&:name).to_h { |k, v| [k, v.sum(&:quantity)] }
62+
inventory.all_items.each_with_object(Hash.new(0)) { |i, h| h[i.name] += i.quantity }
6363
end
6464

6565
def current_onhand_minimums(inventory)

app/services/exports/export_partners_csv_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def population_served_col(table)
136136
end
137137

138138
def executive_director_col(table)
139-
if @partials_to_show.include? "executive_director"
139+
if @partials_to_show.include? "contacts"
140140
table["Executive Director Name"] = ->(partner) { partner.profile.executive_director_name }
141141
table["Executive Director Phone"] = ->(partner) { partner.profile.executive_director_phone }
142142
table["Executive Director Email"] = ->(partner) { partner.profile.executive_director_email }

0 commit comments

Comments
 (0)