Skip to content

Commit f2f3684

Browse files
Merge branch 'main' into 4503-super-admin-create-users
2 parents 0904f99 + a20fe8e commit f2f3684

29 files changed

Lines changed: 608 additions & 469 deletions

Gemfile.lock

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
Ascii85 (1.1.1)
4+
Ascii85 (2.0.1)
55
actioncable (8.0.1)
66
actionpack (= 8.0.1)
77
activesupport (= 8.0.1)
@@ -77,7 +77,7 @@ GEM
7777
public_suffix (>= 2.0.2, < 7.0)
7878
afm (0.2.2)
7979
annotaterb (4.14.0)
80-
ast (2.4.2)
80+
ast (2.4.3)
8181
autoprefixer-rails (10.4.13.0)
8282
execjs (~> 2)
8383
awesome_print (1.9.2)
@@ -191,7 +191,7 @@ GEM
191191
railties (>= 4.1.0)
192192
responders
193193
warden (~> 1.2.3)
194-
devise_invitable (2.0.9)
194+
devise_invitable (2.0.10)
195195
actionmailer (>= 5.0)
196196
devise (>= 4.6)
197197
diff-lcs (1.5.1)
@@ -222,7 +222,7 @@ GEM
222222
dry-inflector (~> 1.0)
223223
dry-logic (~> 1.4)
224224
zeitwerk (~> 2.6)
225-
erb_lint (0.7.0)
225+
erb_lint (0.9.0)
226226
activesupport
227227
better_html (>= 2.0.1)
228228
parser (>= 2.7.1.4)
@@ -273,18 +273,18 @@ GEM
273273
ffi (1.17.0-x86_64-darwin)
274274
ffi (1.17.0-x86_64-linux-gnu)
275275
filterrific (5.2.7)
276-
flipper (1.3.2)
276+
flipper (1.3.4)
277277
concurrent-ruby (< 2)
278-
flipper-active_record (1.3.2)
278+
flipper-active_record (1.3.4)
279279
activerecord (>= 4.2, < 9)
280-
flipper (~> 1.3.2)
281-
flipper-ui (1.3.2)
280+
flipper (~> 1.3.4)
281+
flipper-ui (1.3.4)
282282
erubi (>= 1.0.0, < 2.0.0)
283-
flipper (~> 1.3.2)
283+
flipper (~> 1.3.4)
284284
rack (>= 1.4, < 4)
285285
rack-protection (>= 1.5.3, < 5.0.0)
286286
rack-session (>= 1.0.2, < 3.0.0)
287-
sanitize (< 7)
287+
sanitize (< 8)
288288
foreman (0.88.1)
289289
formatador (1.1.0)
290290
geocoder (1.8.5)
@@ -329,7 +329,7 @@ GEM
329329
actionview (>= 5.0.0)
330330
activesupport (>= 5.0.0)
331331
jmespath (1.6.2)
332-
json (2.9.1)
332+
json (2.10.2)
333333
jwt (2.9.1)
334334
base64
335335
kaminari (1.2.2)
@@ -344,7 +344,7 @@ GEM
344344
activerecord
345345
kaminari-core (= 1.2.2)
346346
kaminari-core (1.2.2)
347-
knapsack_pro (7.13.1)
347+
knapsack_pro (8.1.0)
348348
rake
349349
language_server-protocol (3.17.0.4)
350350
launchy (3.0.0)
@@ -356,7 +356,7 @@ GEM
356356
listen (3.9.0)
357357
rb-fsevent (~> 0.10, >= 0.10.3)
358358
rb-inotify (~> 0.9, >= 0.9.10)
359-
logger (1.6.6)
359+
logger (1.7.0)
360360
lograge (0.14.0)
361361
actionpack (>= 4)
362362
activesupport (>= 4)
@@ -382,7 +382,7 @@ GEM
382382
method_source (1.1.0)
383383
mini_mime (1.1.5)
384384
mini_portile2 (2.8.8)
385-
minitest (5.25.4)
385+
minitest (5.25.5)
386386
monetize (1.12.0)
387387
money (~> 6.12)
388388
money (6.16.0)
@@ -412,14 +412,14 @@ GEM
412412
net-protocol
413413
newrelic_rpm (9.16.0)
414414
nio4r (2.7.4)
415-
nokogiri (1.18.3)
415+
nokogiri (1.18.7)
416416
mini_portile2 (~> 2.8.2)
417417
racc (~> 1.4)
418-
nokogiri (1.18.3-arm64-darwin)
418+
nokogiri (1.18.7-arm64-darwin)
419419
racc (~> 1.4)
420-
nokogiri (1.18.3-x86_64-darwin)
420+
nokogiri (1.18.7-x86_64-darwin)
421421
racc (~> 1.4)
422-
nokogiri (1.18.3-x86_64-linux-gnu)
422+
nokogiri (1.18.7-x86_64-linux-gnu)
423423
racc (~> 1.4)
424424
notiffany (0.1.3)
425425
nenv (~> 0.1)
@@ -455,12 +455,12 @@ GEM
455455
activerecord (>= 6.1)
456456
request_store (~> 1.4)
457457
parallel (1.26.3)
458-
parser (3.3.7.0)
458+
parser (3.3.7.4)
459459
ast (~> 2.4.1)
460460
racc
461461
pdf-core (0.10.0)
462-
pdf-reader (2.12.0)
463-
Ascii85 (~> 1.0)
462+
pdf-reader (2.14.1)
463+
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
464464
afm (~> 0.2.1)
465465
hashery (~> 2.0)
466466
ruby-rc4
@@ -481,6 +481,7 @@ GEM
481481
prawn-table (0.2.2)
482482
prawn (>= 1.3.0, < 3.0.0)
483483
prettyprint (0.2.0)
484+
prism (1.4.0)
484485
pry (0.14.2)
485486
coderay (~> 1.1)
486487
method_source (~> 1.0)
@@ -504,7 +505,7 @@ GEM
504505
puma (6.6.0)
505506
nio4r (~> 2.0)
506507
racc (1.8.1)
507-
rack (3.1.10)
508+
rack (3.1.12)
508509
rack-mini-profiler (3.3.1)
509510
rack (>= 1.2.0)
510511
rack-protection (4.0.0)
@@ -560,7 +561,7 @@ GEM
560561
rb-fsevent (0.11.2)
561562
rb-inotify (0.10.1)
562563
ffi (~> 1.0)
563-
rdoc (6.12.0)
564+
rdoc (6.13.1)
564565
psych (>= 4.0.0)
565566
recaptcha (5.19.0)
566567
regexp_parser (2.10.0)
@@ -605,8 +606,9 @@ GEM
605606
rubocop-ast (>= 1.36.2, < 2.0)
606607
ruby-progressbar (~> 1.7)
607608
unicode-display_width (>= 2.4.0, < 4.0)
608-
rubocop-ast (1.38.0)
609-
parser (>= 3.3.1.0)
609+
rubocop-ast (1.43.0)
610+
parser (>= 3.3.7.2)
611+
prism (~> 1.4)
610612
rubocop-performance (1.23.1)
611613
rubocop (>= 1.48.1, < 2.0)
612614
rubocop-ast (>= 1.31.1, < 2.0)
@@ -620,9 +622,9 @@ GEM
620622
ruby-progressbar (1.13.0)
621623
ruby-rc4 (0.1.5)
622624
ruby2_keywords (0.0.5)
623-
sanitize (6.1.3)
625+
sanitize (7.0.0)
624626
crass (~> 1.0.2)
625-
nokogiri (>= 1.12.0)
627+
nokogiri (>= 1.16.8)
626628
sass-rails (6.0.0)
627629
sassc-rails (~> 2.1, >= 2.1.1)
628630
sassc (2.4.0)
@@ -657,7 +659,7 @@ GEM
657659
snaky_hash (2.0.1)
658660
hashie
659661
version_gem (~> 1.1, >= 1.1.1)
660-
solid_cache (1.0.6)
662+
solid_cache (1.0.7)
661663
activejob (>= 7.2)
662664
activerecord (>= 7.2)
663665
railties (>= 7.2)
@@ -686,8 +688,8 @@ GEM
686688
rubocop-rails (~> 2.25.0)
687689
stimulus-rails (1.3.4)
688690
railties (>= 6.0.0)
689-
stringio (3.1.2)
690-
strong_migrations (2.2.0)
691+
stringio (3.1.6)
692+
strong_migrations (2.2.1)
691693
activerecord (>= 7)
692694
terser (1.2.5)
693695
execjs (>= 0.3.0, < 3)
@@ -696,9 +698,9 @@ GEM
696698
timeout (0.4.3)
697699
ttfunk (1.8.0)
698700
bigdecimal (~> 3.1)
699-
turbo-rails (2.0.10)
700-
actionpack (>= 6.0.0)
701-
railties (>= 6.0.0)
701+
turbo-rails (2.0.13)
702+
actionpack (>= 7.1.0)
703+
railties (>= 7.1.0)
702704
tzinfo (2.0.6)
703705
concurrent-ruby (~> 1.0)
704706
unicode-display_width (3.1.4)

app/controllers/partner_users_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def create
2424
@users = @partner.users
2525
render :index
2626
end
27+
rescue => e
28+
flash[:error] = e.message
29+
redirect_to partner_users_path(@partner)
2730
end
2831

2932
def destroy

app/helpers/items_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ def selected_item_request_units(item)
1919
item_request_unit_names = item.persisted? ? item.request_units.pluck(:name) : []
2020
current_organization.request_units.select { |unit| item_request_unit_names.include?(unit.name) }.pluck(:id)
2121
end
22+
23+
def quantity_below_minimum?(row_item)
24+
row_item[:quantity] < row_item[:item_on_hand_minimum_quantity]
25+
end
2226
end

app/views/items/_item_row_inventory.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<tr data-widget="expandable-table" aria-expanded="false">
33
<td><i class="fa" /></td>
44
<td><%= link_to(row_item[:item_name], item_url(row_item[:item_id])) %></td>
5-
<td class="numeric"><%= row_item[:quantity] %></td>
5+
<td class="numeric <%= "text-danger font-weight-bold" if quantity_below_minimum?(row_item) %>" data-column="total"><%= row_item[:quantity] %></td>
66
<td class="numeric"><%= row_item[:item_on_hand_minimum_quantity] %></td>
77
<td class="numeric"><%= row_item[:item_on_hand_recommended_quantity] %></td>
88
</tr>

app/views/items/_item_row_quantity_and_storages.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<% end %>
88
<td class="numeric"><%= row_item[:item_on_hand_minimum_quantity] %></td>
99
<td class="numeric"><%= row_item[:item_on_hand_recommended_quantity] %></td>
10-
<td class="numeric"><%= row_item[:quantity] %></td>
10+
<td class="numeric <%= "text-danger font-weight-bold" if quantity_below_minimum?(row_item) %>" data-column="total"><%= row_item[:quantity] %></td>
1111
</tr>

0 commit comments

Comments
 (0)