Skip to content

Commit 5c03b8d

Browse files
authored
Merge branch 'main' into 5231-cancel-requests-deactivated-partners
2 parents b3de13a + 46a569b commit 5c03b8d

File tree

74 files changed

+578
-325
lines changed

Some content is hidden

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

74 files changed

+578
-325
lines changed

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ gem "turbo-rails"
5151
# Sprinkle a little JS to add interactivity
5252
gem "stimulus-rails"
5353
# Use JS import maps to manage JS without transpiling or bundling.
54-
gem "importmap-rails", "~> 2.1"
54+
gem "importmap-rails", "~> 2.2"
5555

5656
##### VIEWS/CONTROLLERS #####
5757

@@ -61,6 +61,8 @@ gem "filterrific"
6161
gem "jbuilder"
6262
# Pagination of models for use in views.
6363
gem "kaminari"
64+
# Prevents cookie overflow errors when storing large flash messages.
65+
gem 'memflash'
6466
# Web-based authorization framework.
6567
gem "omniauth"
6668
# Required to avoid authentication issues with Rails.
@@ -156,7 +158,7 @@ group :development, :test do
156158
# More concise test ("should") matchers
157159
gem "shoulda-matchers", "~> 6.5"
158160
# Default rules for Rubocop.
159-
gem "standard", "~> 1.40"
161+
gem "standard", "~> 1.50"
160162
gem "standard-rails"
161163
gem "standard-performance"
162164
# Erb linter.

Gemfile.lock

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ GEM
133133
autoprefixer-rails (>= 9.1.0)
134134
popper_js (>= 2.11.6, < 3)
135135
sassc-rails (>= 2.0.0)
136-
brakeman (7.0.2)
136+
brakeman (7.1.0)
137137
racc
138-
bugsnag (6.27.1)
138+
bugsnag (6.28.0)
139139
concurrent-ruby (~> 1.0)
140140
builder (3.3.0)
141141
bullet (8.0.8)
@@ -174,7 +174,7 @@ GEM
174174
database_cleaner-core (~> 2.0.0)
175175
database_cleaner-core (2.0.1)
176176
date (3.4.1)
177-
debug (1.9.2)
177+
debug (1.11.0)
178178
irb (~> 1.10)
179179
reline (>= 0.3.8)
180180
debug_inspector (1.2.0)
@@ -194,7 +194,7 @@ GEM
194194
railties (>= 4.1.0)
195195
responders
196196
warden (~> 1.2.3)
197-
devise_invitable (2.0.10)
197+
devise_invitable (2.0.11)
198198
actionmailer (>= 5.0)
199199
devise (>= 4.6)
200200
diff-lcs (1.6.2)
@@ -228,7 +228,7 @@ GEM
228228
dry-inflector (~> 1.0)
229229
dry-logic (~> 1.4)
230230
zeitwerk (~> 2.6)
231-
erb (5.0.1)
231+
erb (5.0.2)
232232
erb_lint (0.9.0)
233233
activesupport
234234
better_html (>= 2.0.1)
@@ -292,7 +292,8 @@ GEM
292292
rack-protection (>= 1.5.3, < 5.0.0)
293293
rack-session (>= 1.0.2, < 3.0.0)
294294
sanitize (< 8)
295-
foreman (0.88.1)
295+
foreman (0.90.0)
296+
thor (~> 1.4)
296297
formatador (1.1.0)
297298
geocoder (1.8.5)
298299
base64 (>= 0.1.0)
@@ -323,11 +324,11 @@ GEM
323324
ostruct
324325
ice_cube (0.17.0)
325326
ice_nine (0.11.2)
326-
importmap-rails (2.1.0)
327+
importmap-rails (2.2.2)
327328
actionpack (>= 6.0.0)
328329
activesupport (>= 6.0.0)
329330
railties (>= 6.0.0)
330-
io-console (0.8.0)
331+
io-console (0.8.1)
331332
irb (1.15.2)
332333
pp (>= 0.6.0)
333334
rdoc (>= 4.0.0)
@@ -336,7 +337,7 @@ GEM
336337
actionview (>= 5.0.0)
337338
activesupport (>= 5.0.0)
338339
jmespath (1.6.2)
339-
json (2.11.3)
340+
json (2.12.2)
340341
jwt (3.1.2)
341342
base64
342343
kaminari (1.2.2)
@@ -353,7 +354,7 @@ GEM
353354
kaminari-core (1.2.2)
354355
knapsack_pro (8.3.0)
355356
rake
356-
language_server-protocol (3.17.0.4)
357+
language_server-protocol (3.17.0.5)
357358
launchy (3.0.0)
358359
addressable (~> 2.8)
359360
childprocess (~> 5.0)
@@ -385,10 +386,11 @@ GEM
385386
net-smtp
386387
marcel (1.0.4)
387388
matrix (0.4.2)
389+
memflash (2.6.0)
390+
actionpack (>= 7.0)
388391
memory_profiler (1.1.0)
389392
method_source (1.1.0)
390393
mini_mime (1.1.5)
391-
mini_portile2 (2.8.9)
392394
minitest (5.25.5)
393395
monetize (1.12.0)
394396
money (~> 6.12)
@@ -408,7 +410,7 @@ GEM
408410
nenv (0.3.0)
409411
net-http-persistent (4.0.2)
410412
connection_pool (~> 2.2)
411-
net-imap (0.5.8)
413+
net-imap (0.5.9)
412414
date
413415
net-protocol
414416
net-pop (0.1.2)
@@ -417,16 +419,13 @@ GEM
417419
timeout
418420
net-smtp (0.5.1)
419421
net-protocol
420-
newrelic_rpm (9.16.0)
422+
newrelic_rpm (9.20.0)
421423
nio4r (2.7.4)
422-
nokogiri (1.18.8)
423-
mini_portile2 (~> 2.8.2)
424+
nokogiri (1.18.9-arm64-darwin)
424425
racc (~> 1.4)
425-
nokogiri (1.18.8-arm64-darwin)
426+
nokogiri (1.18.9-x86_64-darwin)
426427
racc (~> 1.4)
427-
nokogiri (1.18.8-x86_64-darwin)
428-
racc (~> 1.4)
429-
nokogiri (1.18.8-x86_64-linux-gnu)
428+
nokogiri (1.18.9-x86_64-linux-gnu)
430429
racc (~> 1.4)
431430
notiffany (0.1.3)
432431
nenv (~> 0.1)
@@ -512,8 +511,8 @@ GEM
512511
puma (6.6.0)
513512
nio4r (~> 2.0)
514513
racc (1.8.1)
515-
rack (3.1.16)
516-
rack-mini-profiler (4.0.0)
514+
rack (3.2.0)
515+
rack-mini-profiler (4.0.1)
517516
rack (>= 1.2.0)
518517
rack-protection (4.1.1)
519518
base64 (>= 0.1.0)
@@ -569,12 +568,12 @@ GEM
569568
rb-fsevent (0.11.2)
570569
rb-inotify (0.10.1)
571570
ffi (~> 1.0)
572-
rdoc (6.14.1)
571+
rdoc (6.14.2)
573572
erb
574573
psych (>= 4.0.0)
575-
recaptcha (5.19.0)
574+
recaptcha (5.20.1)
576575
regexp_parser (2.10.0)
577-
reline (0.6.1)
576+
reline (0.6.2)
578577
io-console (~> 0.5)
579578
request_store (1.7.0)
580579
rack (>= 1.4)
@@ -605,7 +604,7 @@ GEM
605604
rspec-mocks (~> 3.13)
606605
rspec-support (~> 3.13)
607606
rspec-support (3.13.4)
608-
rubocop (1.75.4)
607+
rubocop (1.75.8)
609608
json (~> 2.3)
610609
language_server-protocol (~> 3.17.0.2)
611610
lint_roller (~> 1.1.0)
@@ -616,7 +615,7 @@ GEM
616615
rubocop-ast (>= 1.44.0, < 2.0)
617616
ruby-progressbar (~> 1.7)
618617
unicode-display_width (>= 2.4.0, < 4.0)
619-
rubocop-ast (1.44.1)
618+
rubocop-ast (1.45.1)
620619
parser (>= 3.3.7.2)
621620
prism (~> 1.4)
622621
rubocop-performance (1.25.0)
@@ -684,10 +683,10 @@ GEM
684683
activesupport (>= 5.2)
685684
sprockets (>= 3.0.0)
686685
stackprof (0.2.27)
687-
standard (1.49.0)
686+
standard (1.50.0)
688687
language_server-protocol (~> 3.17.0.2)
689688
lint_roller (~> 1.0)
690-
rubocop (~> 1.75.2)
689+
rubocop (~> 1.75.5)
691690
standard-custom (~> 1.0.0)
692691
standard-performance (~> 1.8)
693692
standard-custom (1.0.2)
@@ -706,7 +705,7 @@ GEM
706705
activerecord (>= 7)
707706
terser (1.2.5)
708707
execjs (>= 0.3.0, < 3)
709-
thor (1.3.2)
708+
thor (1.4.0)
710709
tilt (2.2.0)
711710
timeout (0.4.3)
712711
ttfunk (1.7.0)
@@ -745,7 +744,6 @@ GEM
745744

746745
PLATFORMS
747746
arm64-darwin
748-
ruby
749747
x86_64-darwin
750748
x86_64-linux
751749
x86_64-linux-gnu
@@ -786,7 +784,7 @@ DEPENDENCIES
786784
geocoder
787785
guard-rspec
788786
icalendar
789-
importmap-rails (~> 2.1)
787+
importmap-rails (~> 2.2)
790788
jbuilder
791789
jwt
792790
kaminari
@@ -796,6 +794,7 @@ DEPENDENCIES
796794
lograge
797795
magic_test
798796
matrix
797+
memflash
799798
memory_profiler
800799
money-rails
801800
newrelic_rpm
@@ -831,7 +830,7 @@ DEPENDENCIES
831830
solid_cache (~> 1.0)
832831
sprockets (~> 4.2.2)
833832
stackprof
834-
standard (~> 1.40)
833+
standard (~> 1.50)
835834
standard-performance
836835
standard-rails
837836
stimulus-rails
@@ -843,4 +842,4 @@ DEPENDENCIES
843842
webmock (~> 3.25)
844843

845844
BUNDLED WITH
846-
2.6.9
845+
2.7.0

app/assets/stylesheets/resources/partners.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ div#partner-notes {
4949
padding: 0px 20px;
5050
}
5151

52+
div#info-for-partner {
53+
padding: 0px 20px;
54+
}
55+
5256
div#approve-application-button {
5357
position: fixed;
5458

app/controllers/admin/organizations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def destroy
7171

7272
def organization_params
7373
params.require(:organization)
74-
.permit(:name, :street, :city, :state, :zipcode, :email, :url, :logo, :intake_location, :default_email_text, :account_request_id, :reminder_day, :deadline_day,
74+
.permit(:name, :street, :city, :state, :zipcode, :email, :url, :logo, :intake_location, :default_email_text, :account_request_id, :reminder_day, :deadline_day, :bank_is_set_up,
7575
users_attributes: %i(name email organization_admin), account_request_attributes: %i(ndbn_member_id id))
7676
end
7777

app/controllers/audits_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def edit
2121
end
2222

2323
def finalize
24-
@audit.adjustment = Adjustment.new(organization_id: @audit.organization_id, storage_location_id: @audit.storage_location_id, user_id: current_user.id, comment: 'Created Automatically through the Auditing Process')
25-
@audit.save
26-
2724
AuditEvent.publish(@audit)
2825
@audit.finalized!
2926
redirect_to audit_path(@audit), notice: "Audit is Finalized."

app/controllers/dashboard_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class DashboardController < ApplicationController
33
respond_to :html, :js
44

55
def index
6-
@org_stats = OrganizationStats.new(current_organization, inventory)
6+
@org_is_set_up = current_organization.bank_is_set_up
77
@partners_awaiting_review = current_organization.partners.awaiting_review
88
@outstanding_requests = current_organization
99
.ordered_requests

app/controllers/donations_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ def destroy
127127

128128
def load_form_collections
129129
@storage_locations = current_organization.storage_locations.active.alphabetized
130-
@donation_sites = current_organization.donation_sites.active.alphabetized
131130
@product_drives = current_organization.product_drives.alphabetized
132131
@product_drive_participants = current_organization.product_drive_participants.alphabetized
133132
@manufacturers = current_organization.manufacturers.alphabetized
134133
@items = current_organization.items.active.alphabetized
134+
# Return all active donation sites, or the donation site that was selected for the donation if it's inactive
135+
@donation_sites = current_organization.donation_sites.active.or(DonationSite.where(id: @donation.donation_site_id)).alphabetized
135136
end
136137

137138
def clean_donation_money_raised

app/controllers/organizations_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def update
1919
@organization = current_organization
2020

2121
if OrganizationUpdateService.update(@organization, organization_params)
22-
redirect_to organization_path, notice: "Updated your organization!"
22+
redirect_back(fallback_location: organization_path, notice: "Updated your organization!")
2323
else
2424
flash.now[:error] = @organization.errors.full_messages.join("\n")
2525
render :edit
@@ -102,6 +102,7 @@ def organization_params
102102
:ytd_on_distribution_printout, :one_step_partner_invite,
103103
:hide_value_columns_on_receipt, :hide_package_column_on_receipt,
104104
:signature_for_distribution_pdf, :receive_email_on_requests,
105+
:bank_is_set_up,
105106
:include_in_kind_values_in_exported_files,
106107
partner_form_fields: [],
107108
request_unit_names: []

app/controllers/partners_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def validate_user_role
182182

183183
def partner_params
184184
params.require(:partner).permit(:name, :email, :send_reminders, :quota,
185-
:notes, :partner_group_id, :default_storage_location_id, documents: [])
185+
:notes, :partner_group_id, :default_storage_location_id, :info_for_partner, documents: [])
186186
end
187187

188188
helper_method \

app/controllers/product_drives_controller.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,18 @@ def update
8888
end
8989

9090
def destroy
91-
current_organization.product_drives.find(params[:id]).destroy
91+
product_drive = current_organization.product_drives.find(params[:id])
92+
success = product_drive.destroy
93+
9294
respond_to do |format|
93-
format.html { redirect_to product_drives_url, notice: 'Product drive was successfully destroyed.' }
94-
format.json { head :no_content }
95+
if success
96+
format.html { redirect_to product_drives_url, notice: 'Product drive was successfully destroyed.' }
97+
format.json { head :no_content }
98+
else
99+
error_message = product_drive.errors.full_messages.to_sentence
100+
format.html { redirect_to product_drive_path(product_drive), error: error_message }
101+
format.json { render json: {error: error_message}, status: :unprocessable_entity }
102+
end
95103
end
96104
end
97105

0 commit comments

Comments
 (0)