Skip to content

Commit

Permalink
Make the clipboard dependency an NPM dependency
Browse files Browse the repository at this point in the history
The rails version is out of date with the javascript version and hasn't been updated in 6 years
  • Loading branch information
jcoyne committed Feb 15, 2023
1 parent 5f095bc commit 501f536
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//= require parameterize
//= require bootstrap-tagsinput
//= require jquery.serializejson
//= require clipboard
//= require clipboard/dist/clipboard
//= require leaflet
//= require leaflet-iiif
//= require Leaflet.Editable
Expand Down
1 change: 0 additions & 1 deletion blacklight-spotlight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ these collections.)
s.add_dependency 'breadcrumbs_on_rails', '>= 3.0', '< 5'
s.add_dependency 'cancancan'
s.add_dependency 'carrierwave', '~> 2.2'
s.add_dependency 'clipboard-rails', '~> 1.5'
s.add_dependency 'devise', '~> 4.1'
s.add_dependency 'devise_invitable'
s.add_dependency 'faraday'
Expand Down
3 changes: 3 additions & 0 deletions lib/generators/spotlight/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def add_js_rails6
# but since webpacker exists in the gemfile, we still need to run the
# install before rails will start
run 'bundle exec rails webpacker:install'

say 'Install Clipboard'
run 'yarn add [email protected]'
end

def add_js_rails7
Expand Down
3 changes: 2 additions & 1 deletion lib/spotlight/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require 'activejob-status'
require 'autoprefixer-rails'
require 'blacklight'
require 'clipboard/rails'
require 'faraday'
require 'faraday/follow_redirects'
require 'friendly_id'
Expand Down Expand Up @@ -67,6 +66,8 @@ class Engine < ::Rails::Engine
end

initializer 'spotlight.assets.precompile' do |app|
config.assets.paths << Rails.root.join('node_modules')

app.config.assets.precompile += %w[spotlight/default_thumbnail.jpg spotlight/default_browse_thumbnail.jpg]

Sprockets::ES6.configuration = { 'modules' => 'umd', 'moduleIds' => true }
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"not IE 11"
],
"dependencies": {
"clipboard": "1.7.1"
}
}

0 comments on commit 501f536

Please sign in to comment.