Merge pull request #3464 from consul/cleanup_rails5_dashboard

Cleanup Rails5 dashboard
This commit is contained in:
Raimond Garcia
2019-04-29 21:30:03 +02:00
committed by GitHub
28 changed files with 34 additions and 52 deletions

View File

@@ -7,7 +7,6 @@ gem "acts_as_votable", "~> 0.11.1"
gem "ahoy_matey", "~> 1.6.0"
gem "ancestry", "~> 3.0.2"
gem "autoprefixer-rails", "~> 8.2.0"
gem "best_in_place", "~> 3.0.1"
gem "browser", "~> 2.5.3"
gem "cancancan", "~> 2.3.0"
gem "ckeditor", "~> 4.2.3"
@@ -41,7 +40,6 @@ gem "paperclip", "~> 5.2.1"
gem "paranoia", "~> 2.4.1"
gem "pg", "~> 0.21.0"
gem "pg_search", "~> 2.0.1"
gem "record_tag_helper", "~> 1.0"
gem "redcarpet", "~> 3.4.0"
gem "responders", "~> 2.4.0"
gem "rinku", "~> 2.0.2", require: "rails_rinku"
@@ -74,6 +72,7 @@ group :development, :test do
gem "knapsack_pro", "~> 1.1.0"
gem "launchy", "~> 2.4.3"
gem "letter_opener_web", "~> 1.3.4"
gem "puma", "~> 3.12.1"
gem "spring", "~> 2.0.1"
gem "spring-commands-rspec", "~> 1.0.4"
end

View File

@@ -79,9 +79,6 @@ GEM
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
bcrypt (3.1.12)
best_in_place (3.0.3)
actionpack (>= 3.2)
railties (>= 3.2)
better_html (1.0.13)
actionview (>= 4.0)
activesupport (>= 4.0)
@@ -348,6 +345,7 @@ GEM
arel (>= 6)
powerpack (0.1.2)
public_suffix (3.0.3)
puma (3.12.1)
rack (2.0.6)
rack-accept (0.4.5)
rack (>= 0.4)
@@ -385,8 +383,6 @@ GEM
rake (12.3.2)
recipient_interceptor (0.2.0)
mail
record_tag_helper (1.0.0)
actionview (~> 5.x)
redcarpet (3.4.0)
referer-parser (0.3.0)
request_store (1.4.0)
@@ -535,7 +531,6 @@ DEPENDENCIES
ahoy_matey (~> 1.6.0)
ancestry (~> 3.0.2)
autoprefixer-rails (~> 8.2.0)
best_in_place (~> 3.0.1)
browser (~> 2.5.3)
bullet (~> 5.7.0)
byebug (~> 10.0.0)
@@ -587,11 +582,11 @@ DEPENDENCIES
paranoia (~> 2.4.1)
pg (~> 0.21.0)
pg_search (~> 2.0.1)
puma (~> 3.12.1)
rails (= 5.0.7.2)
rails-assets-leaflet!
rails-assets-markdown-it (~> 8.2.1)!
recipient_interceptor (~> 0.2.0)
record_tag_helper (~> 1.0)
redcarpet (~> 3.4.0)
responders (~> 2.4.0)
rinku (~> 2.0.2)

View File

@@ -17,7 +17,6 @@
//= require jquery-ui/widgets/autocomplete
//= require jquery-ui/widgets/sortable
//= require jquery-fileupload/basic
//= require best_in_place
//= require foundation
//= require turbolinks
//= require ckeditor/loader
@@ -83,7 +82,6 @@
//= require send_newsletter_alert
//= require managers
//= require globalize
//= require best_in_place_initialize
//= require send_admin_notification_alert
//= require settings
@@ -133,7 +131,6 @@ var initialize_modules = function() {
App.SendNewsletterAlert.initialize();
App.Managers.initialize();
App.Globalize.initialize();
App.BestInPlace.initialize();
App.SendAdminNotificationAlert.initialize();
App.Settings.initialize();
};

View File

@@ -1,3 +0,0 @@
App.BestInPlace =
initialize: ->
$(".best_in_place").best_in_place()

View File

@@ -26,10 +26,10 @@ module MapLocationsHelper
def render_map(map_location, parent_class, editable, remove_marker_label, investments_coordinates=nil)
map_location = MapLocation.new if map_location.nil?
map = content_tag_for :div,
map_location,
class: "map",
data: prepare_map_settings(map_location, editable, parent_class, investments_coordinates)
map = content_tag :div, "",
id: dom_id(map_location),
class: "map_location map",
data: prepare_map_settings(map_location, editable, parent_class, investments_coordinates)
map += map_location_remove_marker(map_location, remove_marker_label) if editable
map
end

View File

@@ -1,4 +1,4 @@
class AdministratorTask < ActiveRecord::Base
class AdministratorTask < ApplicationRecord
belongs_to :source, polymorphic: true
belongs_to :user

View File

@@ -1,4 +1,4 @@
class Dashboard::Action < ActiveRecord::Base
class Dashboard::Action < ApplicationRecord
include Documentable
documentable max_documents_allowed: 3,
max_file_size: 3.megabytes,

View File

@@ -1,4 +1,4 @@
class Dashboard::AdministratorTask < ActiveRecord::Base
class Dashboard::AdministratorTask < ApplicationRecord
belongs_to :source, polymorphic: true
belongs_to :user

View File

@@ -1,4 +1,4 @@
class Dashboard::ExecutedAction < ActiveRecord::Base
class Dashboard::ExecutedAction < ApplicationRecord
belongs_to :proposal
belongs_to :action, class_name: "Dashboard::Action"

View File

@@ -1,4 +1,4 @@
class Link < ActiveRecord::Base
class Link < ApplicationRecord
belongs_to :linkable, polymorphic: true
validates :label, presence: true

View File

@@ -24,15 +24,12 @@
<% end %>
</div>
<%= best_in_place poll,
:results_enabled,
as: :checkbox,
url: proposal_dashboard_poll_url(proposal, poll),
collection: {
false: raw('<input type="checkbox">'),
true: raw('<input type="checkbox" checked>')
} %>
<strong><%= t("dashboard.polls.poll.show_results") %></strong>
<%= form_for poll, remote: true, data: { type: :json },
url: proposal_dashboard_poll_path(proposal, poll) do |f| %>
<%= f.check_box :results_enabled,
label: t("dashboard.polls.poll.show_results"),
class: "js-submit-on-change" %>
<% end %>
<p class="help-text"><%= t("dashboard.polls.poll.show_results_help") %></p>
</div>
</div>

View File

@@ -38,9 +38,6 @@ Rails.application.configure do
}
config.action_mailer.asset_host = "http://consul.test"
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

View File

@@ -1,4 +1,4 @@
class AddPublishedAtToProposal < ActiveRecord::Migration
class AddPublishedAtToProposal < ActiveRecord::Migration[4.2]
def change
add_column :proposals, :published_at, :datetime, null: true
end

View File

@@ -1,4 +1,4 @@
class CreateProposalDashboardActions < ActiveRecord::Migration
class CreateProposalDashboardActions < ActiveRecord::Migration[4.2]
def change
create_table :proposal_dashboard_actions do |t|
t.string :title, limit: 80

View File

@@ -1,4 +1,4 @@
class AddActionTypeToProposalDashboardActions < ActiveRecord::Migration
class AddActionTypeToProposalDashboardActions < ActiveRecord::Migration[4.2]
def change
add_column :proposal_dashboard_actions, :action_type, :integer, null: false, default: 0
end

View File

@@ -1,4 +1,4 @@
class CreateProposalExecutedDashboardActions < ActiveRecord::Migration
class CreateProposalExecutedDashboardActions < ActiveRecord::Migration[4.2]
def change
create_table :proposal_executed_dashboard_actions do |t|
t.references :proposal, index: true, foreign_key: true

View File

@@ -1,4 +1,4 @@
class CreateAdministratorTasks < ActiveRecord::Migration
class CreateAdministratorTasks < ActiveRecord::Migration[4.2]
def change
create_table :administrator_tasks do |t|
t.references :source, polymorphic: true, index: true

View File

@@ -1,4 +1,4 @@
class AddRelatedToPolls < ActiveRecord::Migration
class AddRelatedToPolls < ActiveRecord::Migration[4.2]
def change
add_reference :polls, :related, index: true, polymorphic: true
end

View File

@@ -1,4 +1,4 @@
class AddShortDescriptionToProposalDashboardActions < ActiveRecord::Migration
class AddShortDescriptionToProposalDashboardActions < ActiveRecord::Migration[4.2]
def change
add_column :proposal_dashboard_actions, :short_description, :string
change_column :proposal_dashboard_actions, :description, :text

View File

@@ -1,4 +1,4 @@
class CreateLinks < ActiveRecord::Migration
class CreateLinks < ActiveRecord::Migration[4.2]
def change
create_table :links do |t|
t.string :label

View File

@@ -1,4 +1,4 @@
class RemoveCommentsFromProposalExecutedDashboardAction < ActiveRecord::Migration
class RemoveCommentsFromProposalExecutedDashboardAction < ActiveRecord::Migration[4.2]
def change
remove_column :proposal_executed_dashboard_actions, :comments, :text
end

View File

@@ -1,4 +1,4 @@
class RenameProposalDashboardActionsToDashboardActions < ActiveRecord::Migration
class RenameProposalDashboardActionsToDashboardActions < ActiveRecord::Migration[4.2]
def change
rename_table :proposal_dashboard_actions, :dashboard_actions
rename_column :proposal_executed_dashboard_actions, :proposal_dashboard_action_id, :dashboard_action_id

View File

@@ -1,4 +1,4 @@
class RenameProposalExecutedDashboardActionsToDashboardExecutedActions < ActiveRecord::Migration
class RenameProposalExecutedDashboardActionsToDashboardExecutedActions < ActiveRecord::Migration[4.2]
def change
rename_table :proposal_executed_dashboard_actions, :dashboard_executed_actions
end

View File

@@ -1,4 +1,4 @@
class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration
class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration[4.2]
def change
rename_index :administrator_tasks, 'index_administrator_tasks_on_source_type_and_source_id', 'index_dashboard_administrator_tasks_on_source'
rename_table :administrator_tasks, :dashboard_administrator_tasks

View File

@@ -1,4 +1,4 @@
class RenameDashboardActionIdToActionId < ActiveRecord::Migration
class RenameDashboardActionIdToActionId < ActiveRecord::Migration[4.2]
def change
rename_column :dashboard_executed_actions, :dashboard_action_id, :action_id
end

View File

@@ -1,4 +1,4 @@
class AddTimestampsToDashboardActions < ActiveRecord::Migration
class AddTimestampsToDashboardActions < ActiveRecord::Migration[4.2]
def change
add_column :dashboard_actions, :created_at, :datetime
add_column :dashboard_actions, :updated_at, :datetime

View File

@@ -1,4 +1,4 @@
class AddPublishedProposalToDashboardActions < ActiveRecord::Migration
class AddPublishedProposalToDashboardActions < ActiveRecord::Migration[4.2]
def change
add_column :dashboard_actions, :published_proposal, :boolean, default: :false
end

View File

@@ -1,4 +1,4 @@
class RemoveOpenInNewTabFromLinks < ActiveRecord::Migration
class RemoveOpenInNewTabFromLinks < ActiveRecord::Migration[4.2]
def change
remove_column :links, :open_in_new_tab, :boolean
end