Skip to content

Commit 7959806

Browse files
committed
Merge branch 'master' of https://github.com/wahanegi/clever-calculator into PC-50
2 parents 80d9a86 + ba03b13 commit 7959806

38 files changed

Lines changed: 632 additions & 294 deletions

Gemfile

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,49 @@ source "https://rubygems.org"
22

33
ruby "3.4.1"
44

5-
gem "activeadmin", "~> 3.2", ">= 3.2.5" # A framework for creating elegant and customizable admin panels
6-
# gem "bcrypt", "~> 3.1.7" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
7-
gem "bootsnap", require: false # Reduces boot times through caching; required in config/boot.rb
8-
gem "cssbundling-rails" # Bundle and process CSS [https://github.com/rails/cssbundling-rails]
9-
# gem "image_processing", "~> 1.2" # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
10-
gem "devise", "~> 4.9", ">= 4.9.4" # Authentication
11-
gem "jbuilder" # Build JSON APIs with ease [https://github.com/rails/jbuilder]
12-
gem "jsbundling-rails" # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
13-
gem "jsonapi-serializer", "~> 2.2" # Fast, simple and easy to use JSON:API serialization library (also known as fast_jsonapi).
14-
gem "kamal", require: false # Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
15-
gem "pg", "~> 1.1" # Use postgresql as the database for Active Record
16-
gem "puma", ">= 5.0" # Use the Puma web server [https://github.com/puma/puma]
17-
gem "rails", "~> 8.0.1" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
18-
gem 'sass-rails', '~> 6' # Ruby on Rails stylesheet engine for Sass
19-
gem "solid_cable" # Use the database-backed adapters for Action Cable
20-
gem "solid_cache" # Use the database-backed adapters for Rails.cache
21-
gem "solid_queue" # Use the database-backed adapters for Active Job
22-
gem "sprockets-rails" # The asset pipeline for Rails
23-
gem "stimulus-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
24-
gem "thruster", require: false # Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
25-
gem "turbo-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
26-
gem "tzinfo-data", platforms: %i[ windows jruby ] # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
5+
gem "activeadmin", "~> 3.3.0" # A framework for creating elegant and customizable admin panels
6+
# gem "bcrypt", "~> 3.1" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
7+
gem "bootsnap", '~> 1.18.4', require: false # Reduces boot times through caching; required in config/boot.rb
8+
gem "cssbundling-rails", '~> 1.4.3' # Bundle and process CSS [https://github.com/rails/cssbundling-rails]
9+
# gem "image_processing", "~> 1.2" # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
10+
gem "devise", "~> 4.9.4" # Authentication
11+
gem "jbuilder", '~> 2.13.0' # Build JSON APIs with ease [https://github.com/rails/jbuilder]
12+
gem "jsbundling-rails", '~> 1.3.1' # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
13+
gem "jsonapi-serializer", "~> 2.2.0" # Fast, simple and easy to use JSON:API serialization library (also known as fast_jsonapi).
14+
gem "kamal", '~> 2.5.3', require: false # Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
15+
gem "pg", "~> 1.5.9" # Use postgresql as the database for Active Record
16+
gem "puma", "~> 6.6.0" # Use the Puma web server [https://github.com/puma/puma]
17+
gem "rails", "~> 8.0.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
18+
gem 'sass-rails', '~> 6.0.0' # Ruby on Rails stylesheet engine for Sass
19+
gem "solid_cable", '~> 3.0.7' # Use the database-backed adapters for Action Cable
20+
gem "solid_cache", '~> 1.0.7' # Use the database-backed adapters for Rails.cache
21+
gem "solid_queue", '~> 1.1.4' # Use the database-backed adapters for Active Job
22+
gem "sprockets", '= 3.7.5' # Rack-based asset packaging system
23+
gem "sprockets-rails", '~> 3.5.2' # The asset pipeline for Rails
24+
gem "stimulus-rails", '~> 1.3.4' # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25+
gem "thruster", '~> 0.1.12', require: false # Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
26+
gem "turbo-rails", '~> 2.0.13' # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
27+
gem "tzinfo-data", '~> 1.2025.2', platforms: %i[ windows jruby ] # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
2728

2829
group :development, :test do
29-
gem "brakeman", require: false # Static analysis for security vulnerabilities [https://brakemanscanner.org/]
30-
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
31-
gem "dotenv" # Loads environment variables from '.env'
32-
gem "factory_bot_rails" # Provides fixtures replacement for easier test object creation
33-
gem "faker" # Generates fake data for testing
34-
gem "letter_opener" # Opens sent emails in the browser for easy debugging during development
35-
gem "rack-cors" # Handles Cross-Origin Resource Sharing (CORS) for secure API requests
36-
gem "rspec-rails" # Testing framework for Rails applications, providing tools for writing and running tests
37-
gem "rubocop" # Rubocop Ruby on Rails Style
38-
gem "rubocop-rails", require: false # A Rubocop extension focused on enforcing Rails best practices and coding conventions.
39-
gem "rubocop-rspec_rails", require: false # A Rubocop extension focused code style checking for Rails-related RSpec files.
40-
gem "shoulda-matchers" # Provides simple and clean one-liner tests for Rails models, controllers, and other components.
30+
gem "brakeman", require: false # Static analysis for security vulnerabilities [https://brakemanscanner.org/]
31+
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
32+
gem "dotenv" # Loads environment variables from '.env'
33+
gem "factory_bot_rails" # Provides fixtures replacement for easier test object creation
34+
gem "faker" # Generates fake data for testing
35+
gem "letter_opener" # Opens sent emails in the browser for easy debugging during development
36+
gem "rack-cors" # Handles Cross-Origin Resource Sharing (CORS) for secure API requests
37+
gem "rspec-rails" # Testing framework for Rails applications, providing tools for writing and running tests
38+
gem "rubocop", require: false # A Ruby static code analyzer and formatter, based on the community Ruby style guide.
39+
gem "rubocop-rails", require: false # A Rubocop extension focused on enforcing Rails best practices and coding conventions.
40+
gem "rubocop-rspec_rails", require: false # A Rubocop extension focused code style checking for Rails-related RSpec files.
41+
gem "shoulda-matchers" # Provides simple and clean one-liner tests for Rails models, controllers, and other components.
4142
end
4243

4344
group :development do
44-
gem "web-console" # Use console on exceptions pages [https://github.com/rails/web-console]
45+
gem "web-console" # Use console on exceptions pages [https://github.com/rails/web-console]
46+
end
47+
48+
group :production do
49+
gem "aws-sdk-s3", '~> 1.183.0' # AWS SDK for Ruby
4550
end

Gemfile.lock

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,25 @@ GEM
8787
arbre (1.7.0)
8888
activesupport (>= 3.0.0)
8989
ruby2_keywords (>= 0.0.2)
90-
ast (2.4.2)
90+
ast (2.4.3)
91+
aws-eventstream (1.3.2)
92+
aws-partitions (1.1081.0)
93+
aws-sdk-core (3.222.1)
94+
aws-eventstream (~> 1, >= 1.3.0)
95+
aws-partitions (~> 1, >= 1.992.0)
96+
aws-sigv4 (~> 1.9)
97+
base64
98+
jmespath (~> 1, >= 1.6.1)
99+
logger
100+
aws-sdk-kms (1.99.0)
101+
aws-sdk-core (~> 3, >= 3.216.0)
102+
aws-sigv4 (~> 1.5)
103+
aws-sdk-s3 (1.183.0)
104+
aws-sdk-core (~> 3, >= 3.216.0)
105+
aws-sdk-kms (~> 1)
106+
aws-sigv4 (~> 1.5)
107+
aws-sigv4 (1.11.0)
108+
aws-eventstream (~> 1, >= 1.0.2)
91109
base64 (0.2.0)
92110
bcrypt (3.1.20)
93111
bcrypt_pbkdf (1.1.1)
@@ -96,7 +114,7 @@ GEM
96114
bindex (0.8.1)
97115
bootsnap (1.18.4)
98116
msgpack (~> 1.2)
99-
brakeman (7.0.0)
117+
brakeman (7.0.2)
100118
racc
101119
builder (3.3.0)
102120
childprocess (5.1.0)
@@ -106,7 +124,7 @@ GEM
106124
crass (1.0.6)
107125
cssbundling-rails (1.4.3)
108126
railties (>= 6.0.0)
109-
csv (3.3.2)
127+
csv (3.3.3)
110128
date (3.4.1)
111129
debug (1.10.0)
112130
irb (~> 1.10)
@@ -117,8 +135,8 @@ GEM
117135
railties (>= 4.1.0)
118136
responders
119137
warden (~> 1.2.3)
120-
diff-lcs (1.6.0)
121-
dotenv (3.1.7)
138+
diff-lcs (1.6.1)
139+
dotenv (3.1.8)
122140
drb (2.2.1)
123141
ed25519 (1.3.0)
124142
erubi (1.13.1)
@@ -153,13 +171,14 @@ GEM
153171
railties (>= 6.0)
154172
responders (>= 2)
155173
io-console (0.8.0)
156-
irb (1.15.1)
174+
irb (1.15.2)
157175
pp (>= 0.6.0)
158176
rdoc (>= 4.0.0)
159177
reline (>= 0.4.2)
160178
jbuilder (2.13.0)
161179
actionview (>= 5.0.0)
162180
activesupport (>= 5.0.0)
181+
jmespath (1.6.2)
163182
jquery-rails (4.6.0)
164183
rails-dom-testing (>= 1, < 3)
165184
railties (>= 4.2.0)
@@ -200,7 +219,7 @@ GEM
200219
letter_opener (1.10.0)
201220
launchy (>= 2.2, < 4)
202221
lint_roller (1.1.0)
203-
logger (1.6.6)
222+
logger (1.7.0)
204223
loofah (2.24.0)
205224
crass (~> 1.0.2)
206225
nokogiri (>= 1.12.0)
@@ -228,22 +247,23 @@ GEM
228247
net-protocol
229248
net-ssh (7.3.0)
230249
nio4r (2.7.4)
231-
nokogiri (1.18.4-arm64-darwin)
250+
nokogiri (1.18.7-arm64-darwin)
232251
racc (~> 1.4)
233-
nokogiri (1.18.4-x86_64-darwin)
252+
nokogiri (1.18.7-x86_64-darwin)
234253
racc (~> 1.4)
235-
nokogiri (1.18.4-x86_64-linux-gnu)
254+
nokogiri (1.18.7-x86_64-linux-gnu)
236255
racc (~> 1.4)
237256
orm_adapter (0.5.0)
238257
ostruct (0.6.1)
239258
parallel (1.26.3)
240-
parser (3.3.7.1)
259+
parser (3.3.7.4)
241260
ast (~> 2.4.1)
242261
racc
243262
pg (1.5.9)
244263
pp (0.6.2)
245264
prettyprint
246265
prettyprint (0.2.0)
266+
prism (1.4.0)
247267
psych (5.2.3)
248268
date
249269
stringio
@@ -297,10 +317,10 @@ GEM
297317
activerecord (>= 6.1.5)
298318
activesupport (>= 6.1.5)
299319
i18n
300-
rdoc (6.12.0)
320+
rdoc (6.13.1)
301321
psych (>= 4.0.0)
302322
regexp_parser (2.10.0)
303-
reline (0.6.0)
323+
reline (0.6.1)
304324
io-console (~> 0.5)
305325
responders (3.1.1)
306326
actionpack (>= 5.2)
@@ -322,24 +342,25 @@ GEM
322342
rspec-mocks (~> 3.13)
323343
rspec-support (~> 3.13)
324344
rspec-support (3.13.2)
325-
rubocop (1.73.2)
345+
rubocop (1.75.2)
326346
json (~> 2.3)
327347
language_server-protocol (~> 3.17.0.2)
328348
lint_roller (~> 1.1.0)
329349
parallel (~> 1.10)
330350
parser (>= 3.3.0.2)
331351
rainbow (>= 2.2.2, < 4.0)
332352
regexp_parser (>= 2.9.3, < 3.0)
333-
rubocop-ast (>= 1.38.0, < 2.0)
353+
rubocop-ast (>= 1.44.0, < 2.0)
334354
ruby-progressbar (~> 1.7)
335355
unicode-display_width (>= 2.4.0, < 4.0)
336-
rubocop-ast (1.39.0)
337-
parser (>= 3.3.1.0)
338-
rubocop-rails (2.30.3)
356+
rubocop-ast (1.44.0)
357+
parser (>= 3.3.7.2)
358+
prism (~> 1.4)
359+
rubocop-rails (2.31.0)
339360
activesupport (>= 4.2.0)
340361
lint_roller (~> 1.1)
341362
rack (>= 1.1)
342-
rubocop (>= 1.72.1, < 2.0)
363+
rubocop (>= 1.75.0, < 2.0)
343364
rubocop-ast (>= 1.38.0, < 2.0)
344365
rubocop-rspec (3.5.0)
345366
lint_roller (~> 1.1)
@@ -396,7 +417,7 @@ GEM
396417
ostruct
397418
stimulus-rails (1.3.4)
398419
railties (>= 6.0.0)
399-
stringio (3.1.5)
420+
stringio (3.1.6)
400421
thor (1.3.2)
401422
thruster (0.1.12-arm64-darwin)
402423
thruster (0.1.12-x86_64-darwin)
@@ -434,38 +455,40 @@ PLATFORMS
434455
x86_64-linux-gnu
435456

436457
DEPENDENCIES
437-
activeadmin (~> 3.2, >= 3.2.5)
438-
bootsnap
458+
activeadmin (~> 3.3.0)
459+
aws-sdk-s3 (~> 1.183.0)
460+
bootsnap (~> 1.18.4)
439461
brakeman
440-
cssbundling-rails
462+
cssbundling-rails (~> 1.4.3)
441463
debug
442-
devise (~> 4.9, >= 4.9.4)
464+
devise (~> 4.9.4)
443465
dotenv
444466
factory_bot_rails
445467
faker
446-
jbuilder
447-
jsbundling-rails
448-
jsonapi-serializer (~> 2.2)
449-
kamal
468+
jbuilder (~> 2.13.0)
469+
jsbundling-rails (~> 1.3.1)
470+
jsonapi-serializer (~> 2.2.0)
471+
kamal (~> 2.5.3)
450472
letter_opener
451-
pg (~> 1.1)
452-
puma (>= 5.0)
473+
pg (~> 1.5.9)
474+
puma (~> 6.6.0)
453475
rack-cors
454-
rails (~> 8.0.1)
476+
rails (~> 8.0.2)
455477
rspec-rails
456478
rubocop
457479
rubocop-rails
458480
rubocop-rspec_rails
459-
sass-rails (~> 6)
481+
sass-rails (~> 6.0.0)
460482
shoulda-matchers
461-
solid_cable
462-
solid_cache
463-
solid_queue
464-
sprockets-rails
465-
stimulus-rails
466-
thruster
467-
turbo-rails
468-
tzinfo-data
483+
solid_cable (~> 3.0.7)
484+
solid_cache (~> 1.0.7)
485+
solid_queue (~> 1.1.4)
486+
sprockets (= 3.7.5)
487+
sprockets-rails (~> 3.5.2)
488+
stimulus-rails (~> 1.3.4)
489+
thruster (~> 0.1.12)
490+
turbo-rails (~> 2.0.13)
491+
tzinfo-data (~> 1.2025.2)
469492
web-console
470493

471494
RUBY VERSION

app/admin/customers.rb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
ActiveAdmin.register Customer do
2-
permit_params :company_name, :first_name, :last_name, :email, :position, :address, :notes
2+
permit_params :company_name, :first_name, :last_name, :email, :position, :address, :notes, :logo
33

44
index do
55
selectable_column
66
id_column
7+
column :logo do |customer|
8+
if customer.logo.attached?
9+
image_tag customer.logo, height: 100
10+
else
11+
'No logo uploaded'
12+
end
13+
end
714
column :company_name
815
column :first_name
916
column :last_name
@@ -13,6 +20,25 @@
1320
actions
1421
end
1522

23+
show do
24+
attributes_table do
25+
row :logo do |customer|
26+
if customer.logo.attached?
27+
image_tag customer.logo, height: 100
28+
else
29+
'No logo uploaded'
30+
end
31+
end
32+
row :company_name
33+
row :first_name
34+
row :last_name
35+
row :email
36+
row :position
37+
row :address
38+
row :notes
39+
end
40+
end
41+
1642
filter :company_name
1743
filter :first_name
1844
filter :last_name
@@ -23,6 +49,7 @@
2349

2450
form do |f|
2551
f.inputs do
52+
f.input :logo, as: :file
2653
f.input :company_name
2754
f.input :first_name
2855
f.input :last_name
17.4 KB
Loading

app/assets/images/icons/logo.svg

Lines changed: 31 additions & 0 deletions
Loading

app/assets/images/icons/logout.svg

Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)