Skip to content

Commit 01a9ebf

Browse files
Merge branch 'main' into 4241-change-agency-type-to-enum
2 parents 4ac097d + f6fa554 commit 01a9ebf

25 files changed

+332
-583
lines changed

Gemfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010
# User management and login workflow.
1111
gem "devise", '>= 4.7.1'
1212
# Postgres database adapter.
13-
gem "pg", "~> 1.5.7"
13+
gem "pg", "~> 1.5.9"
1414
# Web server.
1515
gem "puma"
1616
# Rails web framework.
@@ -24,7 +24,7 @@ gem 'azure-storage-blob'
2424
# Adds soft delete functionality for models.
2525
gem 'discard', '~> 1.3'
2626
# Adds grouping by date/month/etc to queries.
27-
gem "groupdate", "~> 6.4"
27+
gem "groupdate", "~> 6.5"
2828
# Treats attributes like money, which knows about dollars and cents.
2929
gem "money-rails"
3030
# Tracks history / audits models.
@@ -184,6 +184,12 @@ group :development do
184184
gem "rails-erd"
185185
# Allows to create a console in the browser.
186186
gem "web-console"
187+
# Middleware that displays speed badge for every HTML page
188+
gem "rack-mini-profiler"
189+
# Adds memory profiling to rack-mini-profiler
190+
gem "memory_profiler"
191+
# Adds call-stack profiling flamegraphs to rack-mini-profiler
192+
gem "stackprof"
187193
end
188194

189195
group :test do

Gemfile.lock

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ GEM
115115
autoprefixer-rails (>= 9.1.0)
116116
popper_js (>= 2.11.6, < 3)
117117
sassc-rails (>= 2.0.0)
118-
brakeman (6.2.1)
118+
brakeman (7.0.0)
119119
racc
120120
bugsnag (6.27.1)
121121
concurrent-ruby (~> 1.0)
122122
builder (3.3.0)
123-
bullet (7.2.0)
123+
bullet (8.0.0)
124124
activesupport (>= 3.0.0)
125125
uniform_notifier (~> 1.11)
126126
capybara (3.40.0)
@@ -141,13 +141,13 @@ GEM
141141
activesupport
142142
tzinfo
143143
coderay (1.1.3)
144-
concurrent-ruby (1.3.4)
145-
connection_pool (2.4.1)
144+
concurrent-ruby (1.3.5)
145+
connection_pool (2.5.0)
146146
crack (1.0.0)
147147
bigdecimal
148148
rexml
149149
crass (1.0.6)
150-
csv (3.3.0)
150+
csv (3.3.2)
151151
cuprite (0.15.1)
152152
capybara (~> 3.0)
153153
ferrum (~> 0.15.0)
@@ -272,13 +272,13 @@ GEM
272272
sanitize (< 7)
273273
foreman (0.88.1)
274274
formatador (1.1.0)
275-
geocoder (1.8.3)
275+
geocoder (1.8.5)
276276
base64 (>= 0.1.0)
277277
csv (>= 3.0.0)
278278
globalid (1.2.1)
279279
activesupport (>= 6.1)
280-
groupdate (6.4.0)
281-
activesupport (>= 6.1)
280+
groupdate (6.5.1)
281+
activesupport (>= 7)
282282
guard (2.18.0)
283283
formatador (>= 0.2.4)
284284
listen (>= 2.7, < 4.0)
@@ -300,7 +300,7 @@ GEM
300300
csv
301301
mini_mime (>= 1.0.0)
302302
multi_xml (>= 0.5.2)
303-
i18n (1.14.6)
303+
i18n (1.14.7)
304304
concurrent-ruby (~> 1.0)
305305
icalendar (2.10.3)
306306
ice_cube (~> 0.16)
@@ -338,7 +338,7 @@ GEM
338338
kaminari-core (1.2.2)
339339
knapsack_pro (7.13.1)
340340
rake
341-
language_server-protocol (3.17.0.3)
341+
language_server-protocol (3.17.0.4)
342342
launchy (3.0.0)
343343
addressable (~> 2.8)
344344
childprocess (~> 5.0)
@@ -348,7 +348,7 @@ GEM
348348
listen (3.9.0)
349349
rb-fsevent (~> 0.10, >= 0.10.3)
350350
rb-inotify (~> 0.9, >= 0.9.10)
351-
logger (1.6.4)
351+
logger (1.6.5)
352352
lograge (0.14.0)
353353
actionpack (>= 4)
354354
activesupport (>= 4)
@@ -370,6 +370,7 @@ GEM
370370
net-smtp
371371
marcel (1.0.4)
372372
matrix (0.4.2)
373+
memory_profiler (1.1.0)
373374
method_source (1.1.0)
374375
mini_magick (4.13.2)
375376
mini_mime (1.1.5)
@@ -447,7 +448,7 @@ GEM
447448
activerecord (>= 6.1)
448449
request_store (~> 1.4)
449450
parallel (1.26.3)
450-
parser (3.3.6.0)
451+
parser (3.3.7.0)
451452
ast (~> 2.4.1)
452453
racc
453454
pdf-core (0.10.0)
@@ -457,7 +458,7 @@ GEM
457458
hashery (~> 2.0)
458459
ruby-rc4
459460
ttfunk
460-
pg (1.5.7)
461+
pg (1.5.9)
461462
popper_js (2.11.8)
462463
prawn (2.5.0)
463464
matrix (~> 0.4)
@@ -490,10 +491,12 @@ GEM
490491
date
491492
stringio
492493
public_suffix (6.0.1)
493-
puma (6.5.0)
494+
puma (6.6.0)
494495
nio4r (~> 2.0)
495496
racc (1.8.1)
496497
rack (3.1.8)
498+
rack-mini-profiler (3.3.1)
499+
rack (>= 1.2.0)
497500
rack-protection (4.0.0)
498501
base64 (>= 0.1.0)
499502
rack (>= 3.0.0, < 4)
@@ -548,8 +551,8 @@ GEM
548551
ffi (~> 1.0)
549552
rdoc (6.10.0)
550553
psych (>= 4.0.0)
551-
recaptcha (5.17.0)
552-
regexp_parser (2.9.3)
554+
recaptcha (5.19.0)
555+
regexp_parser (2.10.0)
553556
reline (0.6.0)
554557
io-console (~> 0.5)
555558
request_store (1.7.0)
@@ -581,7 +584,7 @@ GEM
581584
rspec-mocks (~> 3.13)
582585
rspec-support (~> 3.13)
583586
rspec-support (3.13.2)
584-
rubocop (1.69.2)
587+
rubocop (1.70.0)
585588
json (~> 2.3)
586589
language_server-protocol (>= 3.17.0)
587590
parallel (~> 1.10)
@@ -591,9 +594,9 @@ GEM
591594
rubocop-ast (>= 1.36.2, < 2.0)
592595
ruby-progressbar (~> 1.7)
593596
unicode-display_width (>= 2.4.0, < 4.0)
594-
rubocop-ast (1.37.0)
597+
rubocop-ast (1.38.0)
595598
parser (>= 3.3.1.0)
596-
rubocop-performance (1.23.0)
599+
rubocop-performance (1.23.1)
597600
rubocop (>= 1.48.1, < 2.0)
598601
rubocop-ast (>= 1.31.1, < 2.0)
599602
rubocop-rails (2.25.1)
@@ -657,10 +660,11 @@ GEM
657660
actionpack (>= 5.2)
658661
activesupport (>= 5.2)
659662
sprockets (>= 3.0.0)
660-
standard (1.43.0)
663+
stackprof (0.2.27)
664+
standard (1.44.0)
661665
language_server-protocol (~> 3.17.0.2)
662666
lint_roller (~> 1.0)
663-
rubocop (~> 1.69.1)
667+
rubocop (~> 1.70.0)
664668
standard-custom (~> 1.0.0)
665669
standard-performance (~> 1.6)
666670
standard-custom (1.0.2)
@@ -677,7 +681,7 @@ GEM
677681
stringio (3.1.2)
678682
strong_migrations (1.8.0)
679683
activerecord (>= 5.2)
680-
terser (1.2.4)
684+
terser (1.2.5)
681685
execjs (>= 0.3.0, < 3)
682686
thor (1.3.2)
683687
tilt (2.2.0)
@@ -689,7 +693,7 @@ GEM
689693
railties (>= 6.0.0)
690694
tzinfo (2.0.6)
691695
concurrent-ruby (~> 1.0)
692-
unicode-display_width (3.1.2)
696+
unicode-display_width (3.1.4)
693697
unicode-emoji (~> 4.0, >= 4.0.4)
694698
unicode-emoji (4.0.4)
695699
uniform_notifier (1.16.0)
@@ -760,7 +764,7 @@ DEPENDENCIES
760764
flipper-ui
761765
foreman
762766
geocoder
763-
groupdate (~> 6.4)
767+
groupdate (~> 6.5)
764768
guard-rspec
765769
httparty
766770
icalendar
@@ -775,6 +779,7 @@ DEPENDENCIES
775779
lograge
776780
magic_test
777781
matrix
782+
memory_profiler
778783
money-rails
779784
newrelic_rpm
780785
nokogiri (>= 1.10.4)
@@ -784,13 +789,14 @@ DEPENDENCIES
784789
orderly (~> 0.1)
785790
paper_trail
786791
pdf-reader
787-
pg (~> 1.5.7)
792+
pg (~> 1.5.9)
788793
prawn-rails
789794
pry-doc
790795
pry-nav
791796
pry-rails
792797
pry-remote
793798
puma
799+
rack-mini-profiler
794800
rails (= 7.2.2)
795801
rails-controller-testing
796802
rails-erd
@@ -806,6 +812,7 @@ DEPENDENCIES
806812
simplecov
807813
solid_cache (~> 1.0)
808814
sprockets (~> 4.2.1)
815+
stackprof
809816
standard (~> 1.40)
810817
standard-performance
811818
standard-rails

app/javascript/application.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ import 'utils/purchases'
3535

3636
import Rails from "@rails/ujs"
3737
Rails.start()
38+
39+
// Initialize Active Storage
40+
import * as ActiveStorage from "@rails/activestorage";
41+
ActiveStorage.start();
42+
3843
// Disable turbo by default to avoid issues with turbolinks
3944
Turbo.session.drive = false
4045

@@ -107,4 +112,3 @@ $(document).ready(function(){
107112
});
108113
picker.setDateRange(startDate, endDate);
109114
});
110-
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { Controller } from "@hotwired/stimulus"
2+
3+
// Connects to data-controller="file-input-label"
4+
//
5+
// Reproduces the native browser behavior of updating a file input label
6+
// to show the selected file's name. This is necessary when using a custom
7+
// file input, such as with Bootstrap, that does not update automatically.
8+
//
9+
// Key Features:
10+
// 1. Handles initial display of a default label text (e.g., "Choose file..." or
11+
// the previously selected file name if present).
12+
// 2. Updates the label dynamically when a new file is selected.
13+
//
14+
// How it works:
15+
// - When a file is selected, the `fileSelected` method updates the text of the
16+
// label to reflect the name of the selected file.
17+
// - On page load, the `connect` method ensures the label is initialized to the
18+
// correct state (default text or file name, if a file was previously selected).
19+
//
20+
// This controller is used in coordination with direct uploads in Active Storage.
21+
// When a validation error occurs, previously selected files persist on the server
22+
// (via direct upload), and the file name can be displayed to the user.
23+
export default class extends Controller {
24+
static targets = ["input", "label"];
25+
static values = {
26+
defaultText: { type: String, default: 'Choose file...' }
27+
}
28+
29+
connect() {
30+
this.updateLabel();
31+
}
32+
33+
updateLabel() {
34+
const input = this.inputTarget;
35+
const label = this.labelTarget;
36+
37+
// Check if the file input has a file selected
38+
if (input.files.length > 0) {
39+
label.textContent = input.files[0].name;
40+
} else {
41+
label.textContent = this.defaultTextValue;
42+
}
43+
}
44+
45+
// Update the label when a file is selected
46+
fileSelected() {
47+
this.updateLabel();
48+
}
49+
}

app/views/partners/_documents.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="card card-info card-outline">
22
<div class="card-header">
3-
<h2 class="card-title">Documents</h2>
3+
<h2 class="card-title fs-3">Documents</h2>
44
</div>
55
<div class="card-body p-0">
66
<div class="tab-content" id="custom-tabs-three-tabContent">

app/views/partners/_show_header.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="card card-info card-outline">
22
<div class="card-header">
3-
<h2 class="card-title"><%= partner.name %></h2>
3+
<h2 class="card-title fs-3"><%= partner.name %></h2>
44
</div>
55
<div class="card-body p-0">
66
<div class="row">

app/views/partners/_uninvited_header.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="card card-info card-outline">
22
<div class="card-header">
3-
<h2 class="card-title"><%= partner.name %></h2>
3+
<h2 class="card-title fs-3"><%= partner.name %></h2>
44
</div>
55
<div class="card-body p-0">
66
</div>

app/views/partners/profiles/edit/_agency_information.html.erb

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,14 @@
1616
class: "form-control",
1717
wrapper: :input_group %>
1818
<%= profile_form.input :other_agency_type, label: "Other Agency Type", class: "form-control", wrapper: :input_group %>
19-
<div class="form-group row">
20-
<label class="control-label col-md-3">501(c)(3) IRS Determination Letter or other Proof of Agency Status</label>
21-
<% if profile.proof_of_partner_status.attached? %>
22-
<div class="col-md-8">
23-
Attached
24-
file: <%= link_to profile.proof_of_partner_status.blob['filename'], rails_blob_path(profile.proof_of_partner_status), class: "font-weight-bold" %>
25-
<%= profile_form.file_field :proof_of_partner_status, class: "form-control-file form-control" %>
26-
</div>
27-
<% else %>
28-
<div class="col-md-8">
29-
<%= profile_form.file_field :proof_of_partner_status, class: "form-control-file" %>
30-
</div>
31-
<% end %>
32-
</div>
19+
20+
<%= render "shared/custom_file_input",
21+
form_builder: profile_form,
22+
attachment: profile.proof_of_partner_status,
23+
attachment_name: :proof_of_partner_status,
24+
label_for: "partner_profile_proof_of_partner_status",
25+
label_text: "501(c)(3) IRS Determination Letter or other Proof of Agency Status" %>
26+
3327
<%= profile_form.input :agency_mission, label: "Agency Mission", class: "form-control", wrapper: :input_group %>
3428
<%= profile_form.input :address1, label: "Address (line 1)", class: "form-control", wrapper: :input_group %>
3529
<%= profile_form.input :address2, label: "Address (line 2)", class: "form-control", wrapper: :input_group %>

app/views/partners/profiles/edit/_agency_stability.html.erb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@
1010
<%= form.input :founded, label: "Year Founded", class: "form-control", wrapper: :input_group %>
1111
<%= form.input :form_990, label: "Form 990 Filed", as: :radio_buttons, class: "form-control",
1212
wrapper: :input_group, wrapper_html: {class: "form-yesno"}, input_html: {class: "radio-yesno"} %>
13-
<label class="control-label col-md-3">Form 990</label>
14-
<% if profile.proof_of_form_990.attached? %>
15-
<div class="col-md-8">
16-
Attached
17-
file: <%= link_to profile.proof_of_form_990.blob['filename'], rails_blob_path(profile.proof_of_form_990), class: "font-weight-bold" %>
18-
<%= form.file_field :proof_of_form_990, class: "form-control-file form-control" %>
19-
</div>
20-
<% else %>
21-
<div class="col-md-8">
22-
<%= form.file_field :proof_of_form_990, class: "form-control-file" %>
23-
</div>
24-
<% end %>
13+
14+
<%= render "shared/custom_file_input",
15+
form_builder: form,
16+
attachment: profile.proof_of_form_990,
17+
attachment_name: :proof_of_form_990,
18+
label_for: "partner_profile_proof_of_form_990",
19+
label_text: "Form 990" %>
20+
2521
<%= form.input :program_name, label: "Program Name(s)", class: "form-control", wrapper: :input_group %>
2622
<%= form.input :program_description, label: "Program Description(s)", class: "form-control", wrapper: :input_group %>
2723
<%= form.input :program_age, label: "Agency Age", class: "form-control", wrapper: :input_group %>

0 commit comments

Comments
 (0)