Skip to content

Commit

Permalink
Remove old user fields, plus other cleanup (pupilfirst#339)
Browse files Browse the repository at this point in the history
I ended up cleaning up a lot more old code than was strictly necessary, but this probably takes care of fair chunk of the `cleanup` issues that are pending.
  • Loading branch information
harigopal authored May 27, 2020
1 parent 667d07b commit a9a4b9f
Show file tree
Hide file tree
Showing 165 changed files with 61 additions and 6,259 deletions.
12 changes: 0 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,11 @@ gem 'kramdown', '~> 2.1' # kramdown is a fast, pure Ruby Markdown superset conve
gem 'motion-markdown-it', '~> 8.4.1' # Ruby version of Markdown-it (a CommonMark compliant extensible parser).
gem 'motion-markdown-it-plugins', '~> 8.4.2' # Plugins for motion-markdown-it.
gem 'gaffe', '~> 1.2' # Custom error pages. https://github.com/mirego/gaffe

gem 'google_calendar', '= 0.6.4', github: 'northworld/google_calendar' # Thin wrapper over Google Calendar API.

# This is a dependency of google_calendar. Lock the version to 0.4.0 to prevent introduction of sqlite3 into production dependencies.
gem 'TimezoneParser', '= 0.4.0'

gem 'videojs_rails', '~> 4.12' # Video JS for Rails 3.1+ Asset Pipeline. https://github.com/seanbehan/videojs_rails
gem 'react-rails', '~> 2.2' # For automatically transforming JSX and using React in Rails.

gem 'ahoy_matey', '~> 2.0' # Analytics for Rails.
gem 'uuidtools', '~>2.1' # Required by ahoy_matey for ActiveRecord stores.

gem 'acts-as-taggable-on', github: 'spark-solutions/acts-as-taggable-on', branch: 'fix/rails-6-and-failing-specs' # Tag a single model on several contexts. TODO: remove tracking branch when gem is updated for Rails 6 issues
gem 'sendinblue', '~> 2.4' # This is SendinBlue provided API V2 Ruby GEM
gem 'email_inquire', '~> 0.6' # Validate email for format, common typos and one-time email providers
gem 'titleize', '~> 1.4' # better titleizing, modifies Inflector.titleize from default rails
gem 'addressable', '~> 2.5' # Addressable is a replacement for the URI implementation that is part of Ruby's standard library. https://github.com/sporkmonger/addressable
Expand All @@ -73,8 +64,6 @@ gem 'reform-rails', '~> 0.1'
gem 'virtus', '~> 1.0' # Required for reform coercion. Attributes on Steroids for Plain Old Ruby Objects
gem 'dry-validation', '~> 0.10' # There seems to be a dependency bug in reform's coercion code - it required dry-types.
gem 'postmark-rails', '~> 0.19' # Official integration library for using Rails and ActionMailer with the Postmark HTTP API.
# gem 'intercom-rails', '~> 0.4' # The easiest way to install Intercom in a Rails app.
gem 'intercom', '~> 3.5' # Ruby bindings for the Intercom API
gem 'jspdf-rails', '~> 1.0' # HTML5 client-side pdf generation - for certificates
gem 'responders', '~> 3.0' # A set of Rails responders to dry up your application (respond_to / with)
gem 'rollbar', '~> 2.14' # Exception tracking and logging from Ruby to Rollbar https://rollbar.com
Expand All @@ -93,7 +82,6 @@ gem 'pretender', '~> 0.3.4' # Log in as another user in Rails
gem 'file_validators', '~> 2.1' # Adds file validators to ActiveModel.
gem 'pundit', '~> 2.0' # Minimal authorization through OO design and pure Ruby classes.
gem 'rack-cors', '~> 1.0', require: 'rack/cors' # Rack Middleware for handling CORS, required to serve static assets such as fonts
gem 'jwt', '~> 2.1' # Ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT), used by Zoom API
gem 'chartkick', '~> 3.3' # Create beautiful charts with one line of JavaScript.
gem 'graphql', '~> 1.10' # Ruby implementation of GraphQL http://graphql-ruby.org
gem 'rodf', '~> 1.1' # ODF generation library for Ruby. https://github.com/westonganger/rodf
Expand Down
30 changes: 0 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ GIT
addressable
rails

GIT
remote: https://github.com/northworld/google_calendar.git
revision: 1db48c13f8f59e0bcf0b8a8cef469ca100dd2699
specs:
google_calendar (0.6.4)
TimezoneParser (>= 0.3, < 1.1)
json (>= 1.8.3)
signet (~> 0.7)

GIT
remote: https://github.com/spark-solutions/acts-as-taggable-on.git
revision: 1bd0f0d628cb622ade661c56878abc9b20abcad4
Expand Down Expand Up @@ -64,9 +55,6 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
TimezoneParser (0.4.0)
insensitive_hash
tzinfo
actioncable (6.0.3.1)
actionpack (= 6.0.3.1)
nio4r (~> 2.0)
Expand Down Expand Up @@ -379,9 +367,6 @@ GEM
http_router (0.11.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
httparty (0.18.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
humanize (2.4.2)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
Expand All @@ -395,8 +380,6 @@ GEM
railties (>= 5.0, < 6.1)
responders (>= 2, < 4)
iniparse (1.5.0)
insensitive_hash (0.3.3)
intercom (3.9.5)
jaro_winkler (1.5.4)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -717,14 +700,6 @@ GEM
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (2.3.0)
sendinblue (2.4)
httparty
json
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand Down Expand Up @@ -815,7 +790,6 @@ PLATFORMS
ruby

DEPENDENCIES
TimezoneParser (= 0.4.0)
active_storage_validations (~> 0.8)
activeadmin (~> 2.3.1)
activerecord-precounter (~> 0.3)
Expand Down Expand Up @@ -855,17 +829,14 @@ DEPENDENCIES
friendly_id (~> 5.3.0)
fuubar (~> 2.5)
gaffe (~> 1.2)
google_calendar (= 0.6.4)!
graphiql-rails (~> 1.7)
graphql (~> 1.10)
heroku-deflater (~> 0.6)
humanize (~> 2.1)
image_processing (~> 1.2)
intercom (~> 3.5)
jbuilder (~> 2.6)
jquery-rails (~> 4.3)
jspdf-rails (~> 1.0)
jwt (~> 2.1)
kaminari (~> 1.0)
kramdown (~> 2.1)
letter_opener_web (~> 1.3)
Expand Down Expand Up @@ -924,7 +895,6 @@ DEPENDENCIES
scarf (~> 0.2)
seedbank (~> 0.4)
select2-rails (~> 4.0)
sendinblue (~> 2.4)
simplecov (< 0.18)
skylight (~> 4.2)
slim (~> 4.0)
Expand Down
4 changes: 0 additions & 4 deletions app/admin/admin_user.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
ActiveAdmin.register AdminUser do
actions :all, except: %i[new edit update create destroy]

controller do
include DisableIntercom
end

menu parent: 'Dashboard'

filter :email, as: :string
Expand Down
48 changes: 0 additions & 48 deletions app/admin/connect_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
filter :rating_for_team

controller do
include DisableIntercom

def scoped_collection
super.includes :connect_slot
end
Expand All @@ -30,31 +28,6 @@ def scoped_collection
link_to 'Record Feedback', new_admin_startup_feedback_path(startup_feedback: { startup_id: connect_request.startup.id })
end

action_item :confirm_request, only: :show, if: -> { connect_request.requested? } do
link_to 'Confirm Request', confirm_request_admin_connect_request_path(connect_request), method: :patch
end

action_item :cancel_request, only: :show, if: -> { connect_request.confirmed? } do
link_to(
'Cancel Request', cancel_request_admin_connect_request_path(connect_request),
method: :patch, data: { confirm: I18n.t('admin.connect_request.cancel_request.warning') }
)
end

member_action :confirm_request, method: :patch do
connect_request = ConnectRequest.find(params[:id])
ConnectRequests::ConfirmationService.new(connect_request).execute
flash[:success] = 'The connect request has been confirmed and attendees notified!'
redirect_back(fallback_location: admin_connect_requests_path)
end

member_action :cancel_request, method: :patch do
connect_request = ConnectRequest.find(params[:id])
connect_request.update!(status: ConnectRequest::STATUS_CANCELLED)
flash[:success] = 'The connect request has been marked cancelled!'
redirect_back(fallback_location: admin_connect_requests_path)
end

index do
selectable_column

Expand All @@ -80,27 +53,6 @@ def scoped_collection
end
end
end

actions do |connect_request|
span do
link_to 'Record Feedback', new_admin_startup_feedback_path(startup_feedback: { startup_id: connect_request.startup.id }), class: 'member_link'
end

if connect_request.requested?
span do
link_to 'Confirm Request', confirm_request_admin_connect_request_path(connect_request), class: 'member_link', method: :patch
end
end

if connect_request.confirmed?
span do
link_to(
'Cancel Request', cancel_request_admin_connect_request_path(connect_request),
method: :patch, data: { confirm: I18n.t('admin.connect_request.cancel_request.warning') }
)
end
end
end
end

show do
Expand Down
4 changes: 0 additions & 4 deletions app/admin/connect_slot.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
ActiveAdmin.register ConnectSlot do
controller do
include DisableIntercom
end

permit_params :faculty_id, :slot_at

menu parent: 'Faculty'
Expand Down
4 changes: 0 additions & 4 deletions app/admin/course.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
ActiveAdmin.register Course do
controller do
include DisableIntercom
end

menu parent: 'Targets'

filter :name
Expand Down
8 changes: 0 additions & 8 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
ActiveAdmin.register_page 'Dashboard' do
controller do
include DisableIntercom

def index
@core_stats = Admin::CoreStatsService.new.stats
end
Expand All @@ -12,10 +10,4 @@ def index
content do
render 'dashboard'
end

# route to respond to ajax request for intercom conversations
# page_action :intercom_conversations do
# @conversations = IntercomClient.new.latest_conversation_array(5)
# render 'intercom_conversations', layout: false
# end
end
4 changes: 0 additions & 4 deletions app/admin/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

permit_params :primary

controller do
include DisableIntercom
end

menu parent: 'Schools'

filter :fqdn
Expand Down
37 changes: 0 additions & 37 deletions app/admin/faculty.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
ActiveAdmin.register Faculty do
permit_params :name, :title, :key_skills, :linkedin_url, :category, :image, :sort_index, :self_service,
:current_commitment, :notify_for_submission, :about, :commitment, :compensation, :slack_username, :public, :connect_link

actions :index, :show

controller do
include DisableIntercom

def find_resource
scoped_collection.find(params[:id])
end
Expand All @@ -17,8 +12,6 @@ def find_resource
filter :public
filter :user_email, as: :string
filter :title
filter :key_skills
filter :linkedin_url

scope :all

Expand All @@ -40,9 +33,7 @@ def find_resource
row :name
row :title
row :email
row :linkedin_url
row :about
row :key_skills
row :category

row :image do
Expand All @@ -53,7 +44,6 @@ def find_resource

row :sort_index
row :public
row :self_service
row :notify_for_submission
row :slack_username
row :connect_link
Expand All @@ -73,31 +63,4 @@ def find_resource
row :user
end
end

form do |f|
div id: 'admin-faculty__form'

f.semantic_errors(*f.object.errors.keys)

f.inputs 'Faculty Details' do
f.input :category, as: :select, collection: Faculty.valid_categories
f.input :name
f.input :title
f.input :about
f.input :image, as: :file
f.input :key_skills
f.input :linkedin_url
f.input :sort_index
f.input :public
f.input :notify_for_submission
f.input :self_service
f.input :commitment, as: :select, collection: commitment_options, label_method: :first, value_method: :last
f.input :current_commitment
f.input :compensation, as: :select, collection: Faculty.valid_compensation_values
f.input :slack_username
f.input :connect_link
end

f.actions
end
end
4 changes: 0 additions & 4 deletions app/admin/feature.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
ActiveAdmin.register Feature do
controller do
include DisableIntercom
end

menu parent: 'Dashboard'

form do |f|
Expand Down
Loading

0 comments on commit a9a4b9f

Please sign in to comment.