Skip to content

Commit 6b00238

Browse files
committed
Merge branch 'main' into 4395-rework-landing-page-with-bootstrap-2
2 parents 306de0f + f6fa554 commit 6b00238

File tree

86 files changed

+903
-750
lines changed

Some content is hidden

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

86 files changed

+903
-750
lines changed

Gemfile

Lines changed: 10 additions & 4 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.
@@ -155,6 +155,8 @@ group :development, :test do
155155
# Rails add-on for static analysis.
156156
gem 'rubocop-performance'
157157
gem "rubocop-rails", "~> 2.25.1"
158+
# More concise test ("should") matchers
159+
gem "shoulda-matchers", "~> 6.2"
158160
# Default rules for Rubocop.
159161
gem "standard", "~> 1.40"
160162
gem "standard-rails"
@@ -182,6 +184,12 @@ group :development do
182184
gem "rails-erd"
183185
# Allows to create a console in the browser.
184186
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"
185193
end
186194

187195
group :test do
@@ -197,8 +205,6 @@ group :test do
197205
gem "rails-controller-testing"
198206
# Show code coverage.
199207
gem 'simplecov'
200-
# More concise test ("should") matchers
201-
gem 'shoulda-matchers', '~> 6.2'
202208
# Mock HTTP requests and ensure they are not called during tests.
203209
gem "webmock", "~> 3.24"
204210
# Interface capybara to chrome headless

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/assets/stylesheets/AdminLTE.css

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/stylesheets/AdminLTE.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/stylesheets/application.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
@import 'resources/*';
2121

2222
// import other stylesheets after variables
23-
@import 'AdminLTE';
2423
@import 'bootstrap';
24+
@import 'AdminLTE';
2525
@import 'simple_form-bootstrap/simple_form-bootstrap';
2626
@import 'progress_stepper';
2727
@import 'audits';
@@ -188,6 +188,12 @@ select.selectpicker + .dropdown-toggle::after {
188188
background-color: #8282df
189189
}
190190

191+
// Fix select2 tagging search box to be inline with tags.
192+
// This is the default for select2 but adminLTE overwrites it.
193+
.select2-search.select2-search--inline {
194+
display: inline-block;
195+
}
196+
191197
div.low_priority_warning {
192198
margin: 5px;
193199
text-align: center;

app/assets/stylesheets/custom.scss

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import 'base/_variables';
2-
@import 'AdminLTE';
32

43
@mixin for-desktop {
54
@media (min-width: 992px) and (min-height: 769px) {
@@ -53,15 +52,6 @@
5352
}
5453
}
5554

56-
.wrapper-form-feedback {
57-
@extend .dropdown-item;
58-
59-
&:active {
60-
color: inherit;
61-
background-color: #f8f9fa;
62-
}
63-
}
64-
6555
.login-page--user {
6656
background: linear-gradient(135deg, #3023AE, #C86DD7);
6757
background-attachment: fixed;
@@ -108,3 +98,17 @@
10898
width: 3rem;
10999
cursor: not-allowed;
110100
}
101+
102+
// The account request form is placed inside the default devise container which
103+
// is too narrow for the desired form width, so we have to apply a negative
104+
// margin to center it (except on mobile where text would get cut off).
105+
.account-request {
106+
$inner-width: 35rem;
107+
$outer-width: 360px;
108+
width: $inner-width;
109+
margin-left: calc((#{$outer-width} - #{$inner-width}) / 2);
110+
@media (max-width: 620px) {
111+
margin-left: 0;
112+
max-width: 100%;
113+
}
114+
}

app/controllers/adjustments_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def show
3333
def new
3434
@adjustment = current_organization.adjustments.new
3535
@adjustment.line_items.build
36-
@storage_locations = current_organization.storage_locations.active_locations
36+
@storage_locations = current_organization.storage_locations.active
3737
@items = current_organization.items.loose.active.alphabetized
3838
end
3939

@@ -54,7 +54,7 @@ def create
5454
private
5555

5656
def load_form_collections
57-
@storage_locations = current_organization.storage_locations.active_locations
57+
@storage_locations = current_organization.storage_locations.active
5858
@items = current_organization.items.loose.alphabetized
5959
end
6060

app/controllers/audits_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def set_audit
8989
end
9090

9191
def set_storage_locations
92-
@storage_locations = current_organization.storage_locations.active_locations
92+
@storage_locations = current_organization.storage_locations.active
9393
end
9494

9595
def set_items

app/controllers/dashboard_controller.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class DashboardController < ApplicationController
33
respond_to :html, :js
44

55
def index
6-
@org_stats = OrganizationStats.new(current_organization)
6+
@org_stats = OrganizationStats.new(current_organization, inventory)
77
@partners_awaiting_review = current_organization.partners.awaiting_review
88
@outstanding_requests = current_organization
99
.ordered_requests
@@ -12,9 +12,15 @@ def index
1212
.order(:created_at)
1313
.limit(25)
1414

15-
@low_inventory_report = LowInventoryQuery.call(current_organization)
15+
@low_inventory_report = LowInventoryQuery.call(current_organization, inventory)
1616

1717
# passing nil here filters the announcements that didn't come from an organization
1818
@broadcast_announcements = BroadcastAnnouncement.filter_announcements(nil)
1919
end
20+
21+
private
22+
23+
def inventory
24+
@inventory ||= View::Inventory.new(current_organization.id)
25+
end
2026
end

0 commit comments

Comments
 (0)