From 5cbf939911b43a94a3b366d318a92cbdc6b40bf8 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 2 Sep 2021 16:35:36 -0500 Subject: [PATCH 1/3] spec: fix syntax of get requests in archives_controller_spec Those were generating Ruby warnings: > warning: Using the last argument as keyword parameters is deprecated --- spec/controllers/instructeurs/archives_controller_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/controllers/instructeurs/archives_controller_spec.rb b/spec/controllers/instructeurs/archives_controller_spec.rb index c5cb89dae..0eb1ff266 100644 --- a/spec/controllers/instructeurs/archives_controller_spec.rb +++ b/spec/controllers/instructeurs/archives_controller_spec.rb @@ -23,7 +23,7 @@ describe Instructeurs::ArchivesController, type: :controller do end it 'displays archives' do - get :index, { params: { procedure_id: procedure1.id } } + get :index, params: { procedure_id: procedure1.id } expect(assigns(:archives)).to eq([archive1]) end @@ -34,9 +34,7 @@ describe Instructeurs::ArchivesController, type: :controller do let(:date_month) { Date.strptime(month, "%Y-%m") } let(:archive) { create(:archive) } let(:subject) do - post :create, { - params: { procedure_id: procedure1.id, type: 'monthly', month: month } - } + post :create, params: { procedure_id: procedure1.id, type: 'monthly', month: month } end it "performs archive creation job" do From 407f46b7ded46c189b1f81510ad5e35f3d46b603 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 2 Sep 2021 21:37:58 +0000 Subject: [PATCH 2/3] gems: remove smart_listing It was only used in the old design, which we recently removed completely. --- Gemfile | 1 - Gemfile.lock | 13 ----- config/initializers/smart_listing.rb | 75 ---------------------------- config/locales/smart_listing.fr.yml | 15 ------ spec/support/smart_listing.rb | 10 ---- 5 files changed, 114 deletions(-) delete mode 100644 config/initializers/smart_listing.rb delete mode 100644 config/locales/smart_listing.fr.yml delete mode 100644 spec/support/smart_listing.rb diff --git a/Gemfile b/Gemfile index 6bef72e7d..4172eaf30 100644 --- a/Gemfile +++ b/Gemfile @@ -76,7 +76,6 @@ gem 'sentry-rails' gem 'sentry-ruby' gem 'sib-api-v3-sdk' gem 'skylight' -gem 'smart_listing' gem 'spreadsheet_architect' gem 'typhoeus' gem 'warden' diff --git a/Gemfile.lock b/Gemfile.lock index 83b365654..8c9956a13 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -171,13 +171,6 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - coffee-rails (5.0.0) - coffee-script (>= 2.2.0) - railties (>= 5.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) concurrent-ruby (1.1.9) connection_pool (2.2.3) crack (0.4.5) @@ -690,11 +683,6 @@ GEM tilt (~> 2.0) skylight (5.0.1) activesupport (>= 5.2.0) - smart_listing (1.2.3) - coffee-rails - jquery-rails - kaminari (>= 0.17) - rails (>= 3.2) spreadsheet_architect (4.1.0) axlsx_styler (>= 1.0.0, < 2) caxlsx (>= 2.0.2, < 4) @@ -885,7 +873,6 @@ DEPENDENCIES sib-api-v3-sdk simple_xlsx_reader skylight - smart_listing spreadsheet_architect spring spring-commands-rspec diff --git a/config/initializers/smart_listing.rb b/config/initializers/smart_listing.rb deleted file mode 100644 index 81435de26..000000000 --- a/config/initializers/smart_listing.rb +++ /dev/null @@ -1,75 +0,0 @@ -SmartListing.configure do |config| - config.global_options({ - # :param_names => { # param names - # :page => :page, - # :per_page => :per_page, - # :sort => :sort, - # }, - # :array => false, # controls whether smart list should be using arrays or AR collections - # :max_count => nil, # limit number of rows - # :unlimited_per_page => false, # allow infinite page size - # :paginate => true, # allow pagination - # :memorize_per_page => false, # save per page settings in the cookie - :page_sizes => [10, 20, 50, 100] # set available page sizes array - # :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options - }) - - config.constants :classes, { - #:main => "smart-listing", - #:editable => "editable", - #:content => "content", - #:loading => "loading", - #:status => "smart-listing-status", - #:item_actions => "actions", - #:new_item_placeholder => "new-item-placeholder", - #:new_item_action => "new-item-action", - #:new_item_button => "btn", - #:hidden => "hidden", - #:autoselect => "autoselect", - #:callback => "callback", - #:pagination_per_page => "pagination-per-page text-center", - #:pagination_count => "count", - #:inline_editing => "info", - #:no_records => "no-records", - #:limit => "smart-listing-limit", - #:limit_alert => "smart-listing-limit-alert", - #:controls => "smart-listing-controls", - #:controls_reset => "reset", - #:filtering => "filter", - #:filtering_search => "glyphicon-search", - #:filtering_cancel => "glyphicon-remove", - #:filtering_disabled => "disabled", - #:sortable => "sortable", - #:icon_new => "glyphicon glyphicon-plus", - #:icon_edit => "glyphicon glyphicon-pencil", - #:icon_trash => "glyphicon glyphicon-trash", - #:icon_inactive => "glyphicon glyphicon-circle", - #:icon_show => "glyphicon glyphicon-share-alt", - #:icon_sort_none => "glyphicon glyphicon-resize-vertical", - #:icon_sort_up => "glyphicon glyphicon-chevron-up", - #:icon_sort_down => "glyphicon glyphicon-chevron-down", - } - - config.constants :data_attributes, { - # :main => "smart-listing", - # :confirmation => "confirmation", - # :id => "id", - # :href => "href", - # :callback_href => "callback-href", - # :max_count => "max-count", - # :inline_edit_backup => "smart-listing-edit-backup", - # :params => "params", - # :observed => "observed", - # :href => "href", - # :autoshow => "autoshow", - # :popover => "slpopover", - } - - config.constants :selectors, { - # :item_action_destroy => "a.destroy", - # :edit_cancel => "button.cancel", - # :row => "tr", - # :head => "thead", - # :filtering_icon => "i" - } -end diff --git a/config/locales/smart_listing.fr.yml b/config/locales/smart_listing.fr.yml deleted file mode 100644 index d7c99854e..000000000 --- a/config/locales/smart_listing.fr.yml +++ /dev/null @@ -1,15 +0,0 @@ -fr: - smart_listing: - msgs: - destroy_confirmation: Destroy? - no_items: No items - actions: - destroy: Destroy - edit: Edit - show: Show - new: New item - views: - pagination: - per_page: Par page - unlimited: Unlimited - total: Total diff --git a/spec/support/smart_listing.rb b/spec/support/smart_listing.rb deleted file mode 100644 index b41b7b80c..000000000 --- a/spec/support/smart_listing.rb +++ /dev/null @@ -1,10 +0,0 @@ -include SmartListing::Helper -include SmartListing::Helper::ControllerExtensions - -module SmartListing - module Helper - def view_context - 'mock' - end - end -end From 49345e95e02b9dc0f18890d47d127945de4cac2c Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 2 Sep 2021 16:52:46 -0500 Subject: [PATCH 3/3] gems: update zipline This (unreleased) version contains a fix for a pre-Ruby 3.0 kwargs use. It fixes a warning in specs using zip files: > warning: Using the last argument as keyword parameters is deprecated --- Gemfile | 2 +- Gemfile.lock | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 4172eaf30..5e53fd5f8 100644 --- a/Gemfile +++ b/Gemfile @@ -80,7 +80,7 @@ gem 'spreadsheet_architect' gem 'typhoeus' gem 'warden' gem 'webpacker' -gem 'zipline' +gem 'zipline', github: 'fringd/zipline', ref: 'd637bbff2' # Unreleased 1.3.0, with a fix for Ruby 3.0 kwargs gem 'zxcvbn-ruby', require: 'zxcvbn' group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 8c9956a13..f1082ccfe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/fringd/zipline.git + revision: d637bbff262f59718d23a65f50b50163b8ba749f + ref: d637bbff2 + specs: + zipline (1.3.0) + actionpack (>= 3.2.1, < 7.0) + zip_tricks (>= 4.2.1, < 6.0) + GIT remote: https://github.com/mina-deploy/mina.git revision: 84fa84c7f7f94f9518ef9b7099396ab6676b5881 @@ -762,10 +771,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.4.2) - zip_tricks (5.5.0) - zipline (1.3.0) - actionpack (>= 3.2.1, < 7.0) - zip_tricks (>= 4.2.1, < 6.0) + zip_tricks (5.6.0) zxcvbn-ruby (1.2.0) PLATFORMS @@ -884,7 +890,7 @@ DEPENDENCIES webdrivers (~> 4.0) webmock webpacker - zipline + zipline! zxcvbn-ruby BUNDLED WITH