Skip to content

Commit

Permalink
Merge pull request #5672 from samvera/abel-hyrax_js_fix
Browse files Browse the repository at this point in the history
Fix hyrax js not rendering correctly
  • Loading branch information
abelemlih authored Jun 9, 2022
2 parents 1fe2ba7 + df201e3 commit 95ecddd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
environment:
RAILS_VERSION: << parameters.rails_version >>
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
ENGINE_CART_RAILS_OPTIONS: --database=postgresql --skip-git --skip-bundle --skip-listen --skip-spring --skip-keeps --skip-test --skip-bootsnap
ENGINE_CART_RAILS_OPTIONS: --database=postgresql --skip-git --skip-bundle --skip-listen --skip-spring --skip-keeps --skip-test --skip-bootsnap --skip-javascript
DATABASE_URL: postgresql://[email protected]/circle_test # Hard-coded with data from CircleCI orb, related to https://github.com/samvera-labs/samvera-circleci-orb/issues/42
steps:
- attach_workspace:
Expand Down
40 changes: 0 additions & 40 deletions .engine_cart.yml

This file was deleted.

8 changes: 1 addition & 7 deletions hyrax.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ SUMMARY
spec.add_dependency 'tinymce-rails', '~> 5.10'
spec.add_dependency 'valkyrie', '~> 2', '>= 2.1.1'
spec.add_dependency 'sprockets', '~> 3.7'
spec.add_dependency 'sass-rails', '~> 6.0'

spec.add_development_dependency "capybara", '~> 3.29'
spec.add_development_dependency 'capybara-screenshot', '~> 1.0'
Expand Down Expand Up @@ -111,11 +112,4 @@ SUMMARY
spec.add_development_dependency 'shoulda-matchers', '~> 3.1'
spec.add_development_dependency 'webdrivers', '~> 4.4'
spec.add_development_dependency 'webmock'

########################################################
# Temporarily pinned dependencies. INCLUDE EXPLANATIONS.
#
# Pin sass-rails to 5.x because rails 5.x apps have this same dependency in their generated Gemfiles
# See https://github.com/samvera/hyrax/issues/3919
spec.add_dependency 'sass-rails', '~> 6.0'
end
7 changes: 2 additions & 5 deletions lib/generators/hyrax/assets_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ def inject_css

def inject_js
return if hyrax_javascript_installed?
insert_into_file 'app/assets/javascripts/application.js', after: '//= require_tree .' do
<<-JS.strip_heredoc
//= require hyrax
JS
insert_into_file 'app/assets/javascripts/application.js', after: "//= require blacklight/blacklight\n" do
"//= require hyrax\n" \
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/hyrax/collections_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@
form = doc.xpath('//form').first
expect(form.attr('action')).to eq hyrax.dashboard_collection_path(collection)
i = form.xpath('.//input')[2]
expect(i.attr('value')).to eq("remove")
expect(i.attr('name')).to eq("collection[members]")
expect(i.attr('value')).to eq("Remove From Collection")
expect(i.attr('name')).to eq("commit")
end

it "creates a button with my text" do
Expand Down
10 changes: 9 additions & 1 deletion spec/test_app_templates/lib/generators/test_app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ class TestAppGenerator < Rails::Generators::Base
# so the following path gets us to /path/to/hyrax/spec/test_app_templates/
source_root File.expand_path('../../../../spec/test_app_templates/', __FILE__)

def install_turbolinks
gem 'turbolinks', '~> 5'

Bundler.with_clean_env do
run "bundle install"
end
end

def install_engine
generate 'hyrax:install', '-f'
end
Expand Down Expand Up @@ -198,7 +206,7 @@ def configure_action_cable_to_use_redis
end

def install_universal_viewer
raise '`yarn install` failed!' unless system('./bin/yarn install')
raise '`yarn install` failed!' unless system('yarn install')
end

def create_sample_metadata_configuration
Expand Down

0 comments on commit 95ecddd

Please sign in to comment.