Skip to content

Commit aa66d38

Browse files
authored
Merge branch 'main' into 4517-inactive-items-in-distribution-reports
2 parents 96646b9 + 0ee1fc3 commit aa66d38

45 files changed

Lines changed: 1929 additions & 119 deletions

Some content is hidden

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

.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/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

app/controllers/vendors_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def edit
4747

4848
def show
4949
@vendor = current_organization.vendors.includes(:purchases).find(params[:id])
50+
@purchases = @vendor.purchases.order(issued_at: :desc)
5051
end
5152

5253
def update

app/events/kit_allocate_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def self.event_line_items(kit, storage_location, quantity)
2020
end
2121

2222
def self.publish(kit, storage_location, quantity)
23-
create(
23+
create!(
2424
eventable: kit,
2525
group_id: "kit-allocate-#{kit.id}-#{SecureRandom.hex}",
2626
organization_id: kit.organization_id,

app/javascript/application.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import "startup"
88
import "jquery-ui"
99
import 'admin-lte'
1010
import 'filterrific'
11-
import { Turbo } from "@hotwired/turbo-rails"
11+
import("@hotwired/turbo-rails").then(({ Turbo }) => {
12+
// Disable turbo by default to avoid issues with turbolinks
13+
Turbo.session.drive = false
14+
})
15+
1216
import "trix"
1317
import "@rails/actiontext"
1418
import "bootstrap-select"
@@ -39,9 +43,6 @@ Rails.start()
3943
import * as ActiveStorage from "@rails/activestorage";
4044
ActiveStorage.start();
4145

42-
// Disable turbo by default to avoid issues with turbolinks
43-
Turbo.session.drive = false
44-
4546
// Global toastr options
4647
window.toastr = toastr;
4748
toastr.options = {

app/javascript/controllers/deadline_day_controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ export default class extends Controller {
4444
let today = new Date();
4545
let untilDate = new Date( today );
4646
untilDate.setMonth( untilDate.getMonth() + monthlyInterval + 1 )
47-
47+
4848
if (this.byDayOfMonthTarget.checked && this.dayOfMonthTarget.value) {
4949
const rule = new RRule({
5050
dtstart: new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 12)),
5151
freq: RRule.MONTHLY,
5252
interval: monthlyInterval,
5353
bymonthday: parseInt(this.dayOfMonthTarget.value),
54+
byhour: 11, // Force RRule to calculate an occurrance after today
5455
until: untilDate
5556
})
5657
reminder_date = this.getFirstOccurrenceAfterToday( rule.all(), today )
@@ -61,6 +62,7 @@ export default class extends Controller {
6162
freq: RRule.MONTHLY,
6263
interval: monthlyInterval,
6364
byweekday: WEEKDAY_NUM_TO_OBJ[ parseInt(this.dayOfWeekTarget.value) ].nth( parseInt(this.everyNthDayTarget.value) ),
65+
byhour: 11, // Force RRule to calculate an occurrance after today
6466
wkst: RRule.SU,
6567
until: untilDate
6668
})

0 commit comments

Comments
 (0)