Skip to content

Commit e682da0

Browse files
authored
delete rails_admin (#133)
* delete rails_admin * remove kamniari config
1 parent 6cedc28 commit e682da0

29 files changed

+4
-1463
lines changed

Gemfile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ gem 'bourbon', '~> 4.2.2'
2929
gem 'draper'
3030
gem "kt-paperclip", "~> 6.4", ">= 6.4.1"
3131
gem 'aws-sdk-s3'
32-
gem 'rails_admin','~> 2.2.1'
33-
# gem 'rails_admin', git: 'https://github.com/enmand/rails_admin.git'
34-
# rails_admin 1.1.1 has a transitive dependency on haml (~> 4.0). haml 4.0.7 in
35-
# turn has a transitive dependency on tile and does not specify a version range.
36-
# This causes it to pull in tilt 2.6.0 which is incompatible with haml 4.0.7. So
37-
# specifying tilt as a direct dependency with a version range that is compatible
38-
# with haml 4.0.7. We can remove this as soon we get upgrade to a newer version
39-
# of rails_admin that should pull in a newer version of haml, breaking this
40-
# dependency chain.
41-
gem 'tilt', '~> 2.4.0'
42-
4332

4433
gem 'puma', '~> 5.6' # Add Puma as the web server
4534

Gemfile.lock

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ GEM
184184
foundation_emails (2.2.1.0)
185185
globalid (1.1.0)
186186
activesupport (>= 5.0)
187-
haml (5.2.2)
188-
temple (>= 0.8.0)
189-
tilt
190187
htmlentities (4.3.4)
191188
httparty (0.23.1)
192189
csv
@@ -213,22 +210,8 @@ GEM
213210
rails-dom-testing (>= 1, < 3)
214211
railties (>= 4.2.0)
215212
thor (>= 0.14, < 2.0)
216-
jquery-ui-rails (6.0.1)
217-
railties (>= 3.2.16)
218213
json (2.13.2)
219214
jwt (1.2.1)
220-
kaminari (1.2.2)
221-
activesupport (>= 4.1.0)
222-
kaminari-actionview (= 1.2.2)
223-
kaminari-activerecord (= 1.2.2)
224-
kaminari-core (= 1.2.2)
225-
kaminari-actionview (1.2.2)
226-
actionview
227-
kaminari-core (= 1.2.2)
228-
kaminari-activerecord (1.2.2)
229-
activerecord
230-
kaminari-core (= 1.2.2)
231-
kaminari-core (1.2.2)
232215
kt-paperclip (6.4.2)
233216
activemodel (>= 4.2.0)
234217
activesupport (>= 4.2.0)
@@ -268,7 +251,6 @@ GEM
268251
neat (1.7.1)
269252
bourbon (>= 4.0)
270253
sass (>= 3.3)
271-
nested_form (0.3.2)
272254
net-imap (0.4.22)
273255
date
274256
net-protocol
@@ -311,9 +293,6 @@ GEM
311293
rack (2.2.17)
312294
rack-cors (2.0.2)
313295
rack (>= 2.0.0)
314-
rack-pjax (1.1.0)
315-
nokogiri (~> 1.5)
316-
rack (>= 1.1)
317296
rack-test (2.2.0)
318297
rack (>= 1.3)
319298
rails (6.1.7.10)
@@ -338,18 +317,6 @@ GEM
338317
rails-html-sanitizer (1.6.2)
339318
loofah (~> 2.21)
340319
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
341-
rails_admin (2.2.1)
342-
activemodel-serializers-xml (>= 1.0)
343-
builder (~> 3.1)
344-
haml (>= 4.0, < 6)
345-
jquery-rails (>= 3.0, < 5)
346-
jquery-ui-rails (>= 5.0, < 7)
347-
kaminari (>= 0.14, < 2.0)
348-
nested_form (~> 0.3)
349-
rack-pjax (>= 0.7)
350-
rails (>= 5.0, < 7)
351-
remotipart (~> 1.3)
352-
sassc-rails (>= 1.3, < 3)
353320
railties (6.1.7.10)
354321
actionpack (= 6.1.7.10)
355322
activesupport (= 6.1.7.10)
@@ -366,7 +333,6 @@ GEM
366333
regexp_parser (2.11.2)
367334
reline (0.6.2)
368335
io-console (~> 0.5)
369-
remotipart (1.4.4)
370336
request_store (1.7.0)
371337
rack (>= 1.4)
372338
responders (3.1.1)
@@ -437,7 +403,6 @@ GEM
437403
activesupport (>= 4.0)
438404
sprockets (>= 3.0.0)
439405
stringio (3.1.7)
440-
temple (0.10.3)
441406
terrapin (0.6.0)
442407
climate_control (>= 0.0.3, < 1.0)
443408
thor (1.4.0)
@@ -511,7 +476,6 @@ DEPENDENCIES
511476
puma (~> 5.6)
512477
rack-cors
513478
rails (~> 6.1.7)
514-
rails_admin (~> 2.2.1)
515479
rspec-rails
516480
sassc-rails (>= 2.1.2)
517481
search_cop (~> 1.0.6)
@@ -521,7 +485,6 @@ DEPENDENCIES
521485
simplecov
522486
simplecov_json_formatter
523487
sprockets-rails (~> 3.2.2)
524-
tilt (~> 2.4.0)
525488
uglifier
526489
wicked
527490
will_paginate (~> 3.1.7)

app/controllers/admins/base_controller.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/controllers/application_controller.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def authenticate_user!
2424
flash[:notice] = 'We have migrated our data to a new system. '\
2525
'Please click the link below to reset your password.'
2626
end
27-
admin_request? ? rails_admin_path : super
27+
28+
super
2829
end
2930

3031
# IMPERSONATE USER
@@ -37,16 +38,12 @@ def current_user
3738
end
3839
end
3940

40-
def admin_request?
41-
params['controller'].include?('rails_admin') || params['controller'].include?('ckeditor')
42-
end
43-
4441
def after_sign_in_path_for(resource)
45-
resource.class.name == 'User' ? root_path : admins_root_path
42+
root_path
4643
end
4744

4845
def after_sign_out_path_for(resource)
49-
resource == :admin ? rails_admin_path : new_user_session_path
46+
new_user_session_path
5047
end
5148

5249
def current_api_user

app/models/categorizable_item.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,4 @@ class CategorizableItem < ApplicationRecord
55

66
# Attr Accessor
77
attr_accessor :_create
8-
9-
# Rails Admin
10-
rails_admin do
11-
exclude_fields :legacy
12-
end
138
end

app/models/category.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,4 @@ class Category < ApplicationRecord
77
scope :published, -> { where(published: true) }
88
# Validations
99
validates_presence_of :name, uniqueness: true
10-
11-
rails_admin do
12-
exclude_fields :categorizable_items, :legacy
13-
end
1410
end

app/models/form.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ class Form < ApplicationRecord
88
# Nested Attrs
99
accepts_nested_attributes_for :form_fields, allow_destroy: true
1010

11-
# Rails Admin
12-
rails_admin do
13-
exclude_fields :form_builder_id, :reports, :user_forms, form_fields: [:form]
14-
end
15-
1611
def name
1712
owner ? "#{owner.try(:name)} Form" : 'New Form'
1813
end

app/models/form_builder.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ class FormBuilder < ApplicationRecord
55
belongs_to :windows_type
66
accepts_nested_attributes_for :forms
77

8-
rails_admin do
9-
exclude_fields :owner_type, forms: [:owner, :owner_id, :owner_type, :owner]
10-
end
11-
128
scope :workshop_logs, -> { where('name LIKE ?', '%Log%') }
139
scope :monthly, -> { where('name LIKE ?', '%monthly%') }
1410

app/models/form_field.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ class FormField < ApplicationRecord
3030
:date,
3131
]
3232

33-
rails_admin do
34-
# exclude_fields :answer_options
35-
end
36-
3733
accepts_nested_attributes_for :form_field_answer_options
3834

3935
default_scope { order(ordering: :desc) }

app/models/monthly_report.rb

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,5 @@
11
class MonthlyReport < Report
22

3-
rails_admin do
4-
configure :created_at do
5-
show
6-
end
7-
configure :updated_at do
8-
show
9-
end
10-
11-
list do
12-
field :id
13-
field :type
14-
field :created_at do
15-
column_width 200
16-
end
17-
field :project do
18-
searchable true
19-
queryable true
20-
searchable [:name]
21-
end
22-
field :date do
23-
label do
24-
"Month"
25-
end
26-
strftime_format "%m"
27-
filterable true
28-
searchable true
29-
queryable true
30-
column_width 110
31-
end
32-
field :windows_type do
33-
filterable false
34-
visible false
35-
end
36-
field :on_going_participants do
37-
column_width 10
38-
end
39-
field :new_participants do
40-
column_width 10
41-
end
42-
field :has_attachment do
43-
filterable true
44-
searchable true
45-
column_width 40
46-
end
47-
configure :on_going_participants do
48-
formatted_value{ bindings[:object].on_going_participants}
49-
end
50-
51-
configure :new_participants do
52-
formatted_value{ bindings[:object].new_participants}
53-
end
54-
55-
configure :type do
56-
formatted_value{ bindings[:object].admin_type}
57-
end
58-
59-
configure :date do
60-
formatted_value{ bindings[:object].month}
61-
end
62-
63-
end
64-
end
65-
663
def on_going_participants
674
if form_builder
685
field = form_builder.form_fields.find_by(question: 'Total # On-going Participants', status: 1)
@@ -81,5 +18,4 @@ def month
8118
date.strftime("%B")
8219
end
8320

84-
8521
end

0 commit comments

Comments
 (0)