Skip to content

Commit 1e8b30a

Browse files
authored
Merge branch 'main' into 5372AlignmentNudges3
2 parents 31f79a9 + 328876e commit 1e8b30a

File tree

147 files changed

+3078
-513
lines changed

Some content is hidden

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

147 files changed

+3078
-513
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Installs Ruby 3.2.2. When human-essentials moves to a newer version of ruby,
1+
# Installs Ruby 3.4. When human-essentials moves to a newer version of ruby,
22
# it will be more efficient to change the image.
33
# See https://github.com/devcontainers/images/blob/main/src/ruby/history/
4-
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.2
4+
#
5+
# See devcontainers/features#1431 for why we include the `-bookworm`
6+
# suffix. Once that issue is resolved, we can remove the suffix, which
7+
# will let us follow the debian upgrade to trixie.
8+
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.4-bookworm
59
RUN export DEBIAN_FRONTEND=noninteractive
610
RUN apt-get update && apt-get -y install vim curl gpg postgresql postgresql-contrib
711
RUN cd /tmp

.devcontainer/devcontainer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
"features": {
66
"ghcr.io/devcontainers/features/desktop-lite:1": {}
77
},
8-
"forwardPorts": [3000, 5432, 6080],
8+
"forwardPorts": [5432, 6080],
99
"portsAttributes": {
10-
"3000": {
11-
"label": "Application",
12-
"onAutoForward": "silent"
13-
},
1410
"5432": {
1511
"label": "Database",
1612
"onAutoForward": "silent"
@@ -26,6 +22,8 @@
2622
"vscode": {
2723
"extensions": ["Shopify.ruby-extensions-pack"],
2824
"settings": {
25+
// This doesn't seem to work. Not sure if we actually
26+
// install+configure rvm.
2927
"rubyLsp.rubyVersionManager": {
3028
"identifier": "rvm"
3129
}

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
command: sleep infinity
1717

1818
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
19+
# (Although we're not sure if our port forwarding is actually doing any good)
1920
network_mode: service:postgres
2021

2122
postgres:

.devcontainer/post-create.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
RUBY_VERSION="$(cat .ruby-version | tr -d '\n')"
2-
31
# copy the file only if it doesn't already exist
42
echo "*** Creating initial .env and vscode settings, if needed"
53
cp -n .devcontainer/.env.codespaces .env
64
mkdir -p .vscode && cp -n .devcontainer/launch.json.codespaces .vscode/launch.json
75

8-
# If the project's required ruby version changes from 3.2.2, this command
9-
# will download and compile the correct version, but it will take a long time.
10-
if [ "$RUBY_VERSION" != "3.2.2" ]; then
11-
echo "*** Installing Ruby $RUBY_VERSION (this may take a while)"
12-
rvm install $RUBY_VERSION
13-
rvm use $RUBY_VERSION
14-
echo "Ruby $RUBY_VERSION installed"
15-
fi
16-
176
echo "*** Setting up node"
18-
nvm install node
7+
nvm install node &
198

209
echo "*** Setting up ruby environment"
21-
rbenv init bash
22-
rbenv init zsh
10+
rbenv init bash &
11+
rbenv init fish &
12+
rbenv init zsh &
2313

2414
# echo "*** Forcing platform version of nokogiri"
2515
# gem install nokogiri -v 1.18.1 --platform=ruby -- --use-system-libraries
2616

17+
# If the project's required ruby version (specified in .ruby-version)
18+
# changes from 3.4.3, this command will download and compile the correct
19+
# version, but it will take a long time.
20+
echo "*** Installing rbenv-able Ruby ***"
21+
rbenv install --skip-existing &
22+
23+
wait
24+
2725
echo "*** Running project bin/setup"
2826
bin/setup

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,22 @@ You might also want to try VSCode with [this WSL extension](https://marketplace.
134134
```
135135
</details>
136136

137-
## Codespaces and Dev Container - EXPERIMENTAL 🛠️
137+
## One-click in-the-cloud env via Codespaces and Dev Container - EXPERIMENTAL 🛠️
138138

139-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rubyforgood/human-essentials/tree/main?quickstart=1)
140-
141-
[![Clone and open in VSCode Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Clone%20and%20Open%20in%20VSCode&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/rubyforgood/human-essentials)
139+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rubyforgood/human-essentials/tree/fix-devcontainers?quickstart=1)
142140

143141
1. Create the container:
144142
- To run the container on a Github VM, follow the Codespace link above. You can connect to the Codespace using VSCode or the VSCode web editor.
145143
- Or follow instructions to [create a new Codespace.](https://docs.github.com/en/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository)
146144
- To clone this repo and run the container locally, follow instructions to [install VSCode and Docker](https://code.visualstudio.com/docs/devcontainers/containers). Click the Dev Container link above. Don't forget to add a git remote pointing to your fork once the container is setup and you want to push changes.
147145
2. Wait for the container to start. This will take a few (10-15) minutes since Ruby needs to be installed, the database needs to be created, and the `bin/setup` script needs to run
148-
3. Run `bin/start`. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the human essentials page.
149-
4. Login as a sample user with the default [credentials](#credentials).
146+
3. Run `bin/start`.
147+
4. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the human essentials page.
148+
5. Login as a sample user with the default [credentials](#credentials).
149+
150+
### Further experimental option—local dev container
151+
152+
[![Clone and open in VSCode Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Clone%20and%20Open%20in%20VSCode&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/rubyforgood/human-essentials)
150153

151154
## Troubleshooting 👷🏼‍♀️
152155

Gemfile.lock

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,28 @@ GEM
7676
addressable (2.8.7)
7777
public_suffix (>= 2.0.2, < 7.0)
7878
afm (0.2.2)
79-
annotaterb (4.16.0)
79+
annotaterb (4.19.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.1123.0)
88-
aws-sdk-core (3.226.1)
87+
aws-partitions (1.1168.0)
88+
aws-sdk-core (3.233.0)
8989
aws-eventstream (~> 1, >= 1.3.0)
9090
aws-partitions (~> 1, >= 1.992.0)
9191
aws-sigv4 (~> 1.9)
9292
base64
93+
bigdecimal
9394
jmespath (~> 1, >= 1.6.1)
9495
logger
95-
aws-sdk-kms (1.106.0)
96-
aws-sdk-core (~> 3, >= 3.225.0)
96+
aws-sdk-kms (1.113.0)
97+
aws-sdk-core (~> 3, >= 3.231.0)
9798
aws-sigv4 (~> 1.5)
98-
aws-sdk-s3 (1.191.0)
99-
aws-sdk-core (~> 3, >= 3.225.0)
99+
aws-sdk-s3 (1.199.1)
100+
aws-sdk-core (~> 3, >= 3.231.0)
100101
aws-sdk-kms (~> 1)
101102
aws-sigv4 (~> 1.5)
102103
aws-sigv4 (1.12.1)
@@ -123,7 +124,7 @@ GEM
123124
erubi (~> 1.4)
124125
parser (>= 2.4)
125126
smart_properties
126-
bigdecimal (3.2.2)
127+
bigdecimal (3.2.3)
127128
bindex (0.8.1)
128129
binding_of_caller (1.0.1)
129130
debug_inspector (>= 1.2.0)
@@ -169,9 +170,9 @@ GEM
169170
cuprite (0.17)
170171
capybara (~> 3.0)
171172
ferrum (~> 0.17.0)
172-
database_cleaner-active_record (2.2.0)
173+
database_cleaner-active_record (2.2.2)
173174
activerecord (>= 5.a)
174-
database_cleaner-core (~> 2.0.0)
175+
database_cleaner-core (~> 2.0)
175176
database_cleaner-core (2.0.1)
176177
date (3.4.1)
177178
debug (1.11.0)
@@ -238,9 +239,9 @@ GEM
238239
smart_properties
239240
erubi (1.13.1)
240241
execjs (2.10.0)
241-
factory_bot (6.5.4)
242+
factory_bot (6.5.5)
242243
activesupport (>= 6.1.0)
243-
factory_bot_rails (6.5.0)
244+
factory_bot_rails (6.5.1)
244245
factory_bot (~> 6.5)
245246
railties (>= 6.1.0)
246247
faker (3.5.1)
@@ -340,7 +341,7 @@ GEM
340341
actionview (>= 5.0.0)
341342
activesupport (>= 5.0.0)
342343
jmespath (1.6.2)
343-
json (2.12.2)
344+
json (2.15.1)
344345
jwt (3.1.2)
345346
base64
346347
kaminari (1.2.2)
@@ -355,7 +356,7 @@ GEM
355356
activerecord
356357
kaminari-core (= 1.2.2)
357358
kaminari-core (1.2.2)
358-
knapsack_pro (8.3.3)
359+
knapsack_pro (8.4.0)
359360
rake
360361
language_server-protocol (3.17.0.5)
361362
launchy (3.0.0)
@@ -394,7 +395,6 @@ GEM
394395
memory_profiler (1.1.0)
395396
method_source (1.1.0)
396397
mini_mime (1.1.5)
397-
mini_portile2 (2.8.9)
398398
minitest (5.25.5)
399399
monetize (1.12.0)
400400
money (~> 6.12)
@@ -423,11 +423,8 @@ GEM
423423
timeout
424424
net-smtp (0.5.1)
425425
net-protocol
426-
newrelic_rpm (9.20.0)
426+
newrelic_rpm (9.21.0)
427427
nio4r (2.7.4)
428-
nokogiri (1.18.9)
429-
mini_portile2 (~> 2.8.2)
430-
racc (~> 1.4)
431428
nokogiri (1.18.9-arm64-darwin)
432429
racc (~> 1.4)
433430
nokogiri (1.18.9-x86_64-darwin)
@@ -469,7 +466,7 @@ GEM
469466
activerecord (>= 6.1)
470467
request_store (~> 1.4)
471468
parallel (1.27.0)
472-
parser (3.3.8.0)
469+
parser (3.3.9.0)
473470
ast (~> 2.4.1)
474471
racc
475472
pdf-core (0.9.0)
@@ -496,7 +493,7 @@ GEM
496493
prawn-table (0.2.2)
497494
prawn (>= 1.3.0, < 3.0.0)
498495
prettyprint (0.2.0)
499-
prism (1.4.0)
496+
prism (1.5.2)
500497
pry (0.14.2)
501498
coderay (~> 1.1)
502499
method_source (~> 1.0)
@@ -517,7 +514,7 @@ GEM
517514
date
518515
stringio
519516
public_suffix (6.0.2)
520-
puma (6.6.0)
517+
puma (7.0.4)
521518
nio4r (~> 2.0)
522519
racc (1.8.1)
523520
rack (3.2.1)
@@ -581,7 +578,7 @@ GEM
581578
erb
582579
psych (>= 4.0.0)
583580
recaptcha (5.20.1)
584-
regexp_parser (2.11.2)
581+
regexp_parser (2.11.3)
585582
reline (0.6.2)
586583
io-console (~> 0.5)
587584
request_store (1.7.0)
@@ -613,18 +610,18 @@ GEM
613610
rspec-mocks (~> 3.13)
614611
rspec-support (~> 3.13)
615612
rspec-support (3.13.4)
616-
rubocop (1.75.8)
613+
rubocop (1.80.2)
617614
json (~> 2.3)
618615
language_server-protocol (~> 3.17.0.2)
619616
lint_roller (~> 1.1.0)
620617
parallel (~> 1.10)
621618
parser (>= 3.3.0.2)
622619
rainbow (>= 2.2.2, < 4.0)
623620
regexp_parser (>= 2.9.3, < 3.0)
624-
rubocop-ast (>= 1.44.0, < 2.0)
621+
rubocop-ast (>= 1.46.0, < 2.0)
625622
ruby-progressbar (~> 1.7)
626623
unicode-display_width (>= 2.4.0, < 4.0)
627-
rubocop-ast (1.45.1)
624+
rubocop-ast (1.47.1)
628625
parser (>= 3.3.7.2)
629626
prism (~> 1.4)
630627
rubocop-performance (1.25.0)
@@ -692,10 +689,10 @@ GEM
692689
activesupport (>= 5.2)
693690
sprockets (>= 3.0.0)
694691
stackprof (0.2.27)
695-
standard (1.50.0)
692+
standard (1.51.1)
696693
language_server-protocol (~> 3.17.0.2)
697694
lint_roller (~> 1.0)
698-
rubocop (~> 1.75.5)
695+
rubocop (~> 1.80.2)
699696
standard-custom (~> 1.0.0)
700697
standard-performance (~> 1.8)
701698
standard-custom (1.0.2)
@@ -718,14 +715,14 @@ GEM
718715
tilt (2.2.0)
719716
timeout (0.4.3)
720717
ttfunk (1.7.0)
721-
turbo-rails (2.0.16)
718+
turbo-rails (2.0.17)
722719
actionpack (>= 7.1.0)
723720
railties (>= 7.1.0)
724721
tzinfo (2.0.6)
725722
concurrent-ruby (~> 1.0)
726-
unicode-display_width (3.1.4)
727-
unicode-emoji (~> 4.0, >= 4.0.4)
728-
unicode-emoji (4.0.4)
723+
unicode-display_width (3.2.0)
724+
unicode-emoji (~> 4.1)
725+
unicode-emoji (4.1.0)
729726
uniform_notifier (1.17.0)
730727
uri (1.0.3)
731728
useragent (0.16.11)
@@ -753,7 +750,6 @@ GEM
753750

754751
PLATFORMS
755752
arm64-darwin
756-
ruby
757753
x86_64-darwin
758754
x86_64-linux
759755
x86_64-linux-gnu

app/assets/stylesheets/custom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,7 @@
112112
max-width: 100%;
113113
}
114114
}
115+
116+
.cursor-default {
117+
cursor: default !important;
118+
}

app/controllers/admin/users_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ def add_role
8787
redirect_back(fallback_location: admin_users_path, notice: "Role added!")
8888
end
8989

90+
def resend_invitation
91+
user = User.find(params[:user_id])
92+
user.invite!
93+
redirect_back(fallback_location: admin_users_path, notice: "#{user.name} reinvited!")
94+
end
95+
9096
def remove_role
9197
RemoveRoleService.call(user_id: params[:user_id], role_id: params[:role_id])
9298
redirect_back(fallback_location: admin_users_path, notice: "Role removed!")

app/controllers/audits_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ def index
77
@selected_location = filter_params[:at_location]
88
@audits = current_organization.audits.includes(:line_items, :storage_location).class_filter(filter_params)
99
@storage_locations = StorageLocation.with_audits_for(current_organization).select(:id, :name)
10+
11+
respond_to do |format|
12+
format.html
13+
format.csv do
14+
send_data Audit.generate_csv(@audits), filename: "Audits-#{Time.zone.today}.csv"
15+
end
16+
end
1017
end
1118

1219
def show

0 commit comments

Comments
 (0)