Skip to content

Commit 5d4f6e2

Browse files
committed
a Merge branch 'main' into 5223_error_message_on_nonvisible_item_request
2 parents 5cc93fb + 6561406 commit 5d4f6e2

91 files changed

Lines changed: 2551 additions & 323 deletions

File tree

Some content is hidden

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

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: 53 additions & 51 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,15 +333,15 @@ 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)
340340
jbuilder (2.13.0)
341341
actionview (>= 5.0.0)
342342
activesupport (>= 5.0.0)
343343
jmespath (1.6.2)
344-
json (2.12.2)
344+
json (2.15.1)
345345
jwt (3.1.2)
346346
base64
347347
kaminari (1.2.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)
@@ -466,7 +466,7 @@ GEM
466466
activerecord (>= 6.1)
467467
request_store (~> 1.4)
468468
parallel (1.27.0)
469-
parser (3.3.8.0)
469+
parser (3.3.9.0)
470470
ast (~> 2.4.1)
471471
racc
472472
pdf-core (0.9.0)
@@ -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)
@@ -493,7 +493,7 @@ GEM
493493
prawn-table (0.2.2)
494494
prawn (>= 1.3.0, < 3.0.0)
495495
prettyprint (0.2.0)
496-
prism (1.4.0)
496+
prism (1.5.2)
497497
pry (0.14.2)
498498
coderay (~> 1.1)
499499
method_source (~> 1.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,58 +570,59 @@ 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)
581-
regexp_parser (2.11.2)
582-
reline (0.6.2)
580+
tsort
581+
recaptcha (5.21.1)
582+
regexp_parser (2.11.3)
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-
rubocop (1.75.8)
613+
rspec-support (3.13.6)
614+
rubocop (1.80.2)
614615
json (~> 2.3)
615616
language_server-protocol (~> 3.17.0.2)
616617
lint_roller (~> 1.1.0)
617618
parallel (~> 1.10)
618619
parser (>= 3.3.0.2)
619620
rainbow (>= 2.2.2, < 4.0)
620621
regexp_parser (>= 2.9.3, < 3.0)
621-
rubocop-ast (>= 1.44.0, < 2.0)
622+
rubocop-ast (>= 1.46.0, < 2.0)
622623
ruby-progressbar (~> 1.7)
623624
unicode-display_width (>= 2.4.0, < 4.0)
624-
rubocop-ast (1.45.1)
625+
rubocop-ast (1.47.1)
625626
parser (>= 3.3.7.2)
626627
prism (~> 1.4)
627628
rubocop-performance (1.25.0)
@@ -689,10 +690,10 @@ GEM
689690
activesupport (>= 5.2)
690691
sprockets (>= 3.0.0)
691692
stackprof (0.2.27)
692-
standard (1.50.0)
693+
standard (1.51.1)
693694
language_server-protocol (~> 3.17.0.2)
694695
lint_roller (~> 1.0)
695-
rubocop (~> 1.75.5)
696+
rubocop (~> 1.80.2)
696697
standard-custom (~> 1.0.0)
697698
standard-performance (~> 1.8)
698699
standard-custom (1.0.2)
@@ -706,25 +707,26 @@ 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)
720722
railties (>= 7.1.0)
721723
tzinfo (2.0.6)
722724
concurrent-ruby (~> 1.0)
723-
unicode-display_width (3.1.4)
724-
unicode-emoji (~> 4.0, >= 4.0.4)
725-
unicode-emoji (4.0.4)
726-
uniform_notifier (1.17.0)
727-
uri (1.0.3)
725+
unicode-display_width (3.2.0)
726+
unicode-emoji (~> 4.1)
727+
unicode-emoji (4.1.0)
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/distributions_controller.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ def print
2727
end
2828

2929
def destroy
30-
result = DistributionDestroyService.new(params[:id]).call
30+
service = DistributionDestroyService.new(params[:id])
31+
result = service.call
3132

3233
if result.success?
3334
flash[:notice] = "Distribution #{params[:id]} has been reclaimed!"
3435
else
35-
flash[:error] = "Could not destroy distribution #{params[:id]}. Please contact technical support."
36+
flash[:error] = result.error.message
3637
end
3738

3839
redirect_to distributions_path
@@ -185,9 +186,10 @@ def edit
185186
@request = @distribution.request
186187
@items = current_organization.items.active.alphabetized
187188
@partner_list = current_organization.partners.alphabetized
189+
@changes_disallowed = SnapshotEvent.intervening(@distribution).present?
188190
@audit_warning = current_organization.audits
189191
.where(storage_location_id: @distribution.storage_location_id)
190-
.where("updated_at > ?", @distribution.created_at).any?
192+
.where("updated_at > ?", @distribution.created_at).any? && !@changes_disallowed
191193
inventory = View::Inventory.new(@distribution.organization_id)
192194
@storage_locations = current_organization.storage_locations.active.alphabetized.select do |storage_loc|
193195
!inventory.quantity_for(storage_location: storage_loc.id).negative?

0 commit comments

Comments
 (0)