Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #396 from pulibrary/blacklight6
Browse files Browse the repository at this point in the history
Blacklight 6 upgrade
  • Loading branch information
escowles committed Feb 12, 2016
2 parents 51820a7 + d370a26 commit 9c33939
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gem 'modernizr-rails'

gem 'curation_concerns', github:'projecthydra-labs/curation_concerns', branch: 'master'
gem 'pul_metadata_services', github:'pulibrary/pul_metadata_services', branch: :master
gem 'hydra-role-management', '0.1.0'
gem 'hydra-role-management', '~> 0.2.0'
gem 'rsolr', '~> 1.0.6'
gem 'devise'
gem 'devise-guests', '~> 0.3'
Expand Down
105 changes: 58 additions & 47 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: git://github.com/projecthydra-labs/activefedora-aggregation.git
revision: e481a71c9e17f26e379fae60bf5a1a64550d6cc4
revision: d8643d37479a7d1a2f334275665e4f579a2ad2a0
branch: master
specs:
activefedora-aggregation (0.8.0)
activefedora-aggregation (0.8.1)
active-fedora (~> 9.5)
activesupport
rdf (~> 1.1, >= 1.1.17.1)
Expand All @@ -28,22 +28,23 @@ GIT

GIT
remote: git://github.com/projecthydra-labs/curation_concerns.git
revision: 3c296d2ab94bf23a6b81b97d032efea50daf41b9
revision: 9f28154a662aea4e67fceacea266885012b73d7b
branch: master
specs:
curation_concerns (0.5.0)
blacklight_advanced_search (>= 5.1.4, < 6.0)
curation_concerns (0.6.0)
blacklight (~> 6.0)
blacklight_advanced_search (~> 6.0)
breadcrumbs_on_rails (~> 2.3)
curation_concerns-models (= 0.5.0)
curation_concerns-models (= 0.6.0)
hydra-editor (~> 1.1)
hydra-head (~> 9.0)
hydra-head (~> 9.6)
jquery-ui-rails
rails_autolink
simple_form (~> 3.1)
curation_concerns-models (0.5.0)
curation_concerns-models (0.6.0)
active_attr
active_fedora-noid (~> 1.0)
hydra-collections (~> 6.0.0)
hydra-collections (~> 7.0)
hydra-head (~> 9.3)
hydra-works (~> 0.6)
qa (~> 0.5)
Expand All @@ -53,10 +54,10 @@ GIT

GIT
remote: git://github.com/projecthydra-labs/hydra-pcdm.git
revision: 2d1d3c0dbf9f5d6a94314b78ff6010bc5102c215
revision: 3111db7e9207c4adb17e12f519e3b2ae37a305a3
branch: master
specs:
hydra-pcdm (0.3.1)
hydra-pcdm (0.3.2)
active-fedora (~> 9.6)
activefedora-aggregation (~> 0.6)
mime-types (>= 1)
Expand All @@ -73,7 +74,7 @@ GIT

GIT
remote: git://github.com/projecthydra/active_fedora.git
revision: 0c2aeb186aeab221d93c07bc3c6bdb8e40e76aaf
revision: a7e28a33930c31312a3acccfafc7c6e90f0edb24
branch: master
specs:
active-fedora (9.7.0)
Expand All @@ -89,15 +90,16 @@ GIT

GIT
remote: git://github.com/projecthydra/hydra-collections.git
revision: 49aee399d241844cd06862917fa7cb15e6903746
revision: 660abf70735516e088ffab56ca20a0ec27ecd9c4
branch: master
specs:
hydra-collections (6.0.0)
blacklight (~> 5.10)
hydra-collections (7.0.0)
blacklight (~> 6.0)
deprecation (~> 0.1)
hydra-head (~> 9.1)
hydra-works (~> 0.4)
rdf (~> 1.99)
rdf-vocab (~> 0)

GIT
remote: git://github.com/projecthydra/hydra-derivatives.git
Expand Down Expand Up @@ -158,15 +160,15 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active-triples (0.7.3)
active-triples (0.7.4)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
deprecation (~> 0.1)
linkeddata (~> 1.1)
rdf (~> 1.1)
active_attr (0.8.5)
activemodel (>= 3.0.2, < 5.0)
activesupport (>= 3.0.2, < 5.0)
active_attr (0.9.0)
activemodel (>= 3.0.2, < 5.1)
activesupport (>= 3.0.2, < 5.1)
active_fedora-noid (1.0.3)
active-fedora (~> 9.7)
noid (~> 0.7)
Expand All @@ -180,7 +182,7 @@ GEM
activemodel (= 4.2.4)
activesupport (= 4.2.4)
arel (~> 6.0)
activerecord-import (0.10.0)
activerecord-import (0.11.0)
activerecord (>= 3.0)
activesupport (4.2.4)
i18n (~> 0.7)
Expand All @@ -198,7 +200,7 @@ GEM
addressable (>= 2.3.1)
extlib (>= 0.9.15)
multi_json (>= 1.0.0)
autoprefixer-rails (6.2.3)
autoprefixer-rails (6.3.2)
execjs
json
babel-source (5.8.33)
Expand All @@ -210,26 +212,30 @@ GEM
bcrypt (3.1.10)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
blacklight (5.17.1)
blacklight (6.0.1)
bootstrap-sass (~> 3.2)
deprecation
globalid
kaminari (>= 0.15)
nokogiri (~> 1.6)
rails (>= 3.2.6, < 5)
rails (>= 4.1, < 5)
rsolr (~> 1.0.11)
blacklight_advanced_search (5.2.1)
blacklight (~> 5.15)
twitter-typeahead-rails (~> 0.11)
blacklight-access_controls (0.3.0)
blacklight (~> 6.0)
cancancan (~> 1.8)
blacklight_advanced_search (6.0.0)
blacklight (> 6.0.0.pre, < 7)
parslet
blankslate (3.1.3)
bootstrap-sass (3.3.6)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap_forms (4.0.1)
bootstrap_form (2.3.0)
breadcrumbs_on_rails (2.3.1)
builder (3.2.2)
byebug (5.0.0)
columnize (= 0.9.0)
cancan (1.6.10)
cancancan (1.13.1)
capistrano (3.4.0)
i18n
Expand Down Expand Up @@ -305,7 +311,7 @@ GEM
devise
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.25)
domain_name (0.5.20160128)
unf (>= 0.0.5, < 1.0.0)
dropbox-sdk (1.6.5)
json
Expand Down Expand Up @@ -363,32 +369,33 @@ GEM
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
hydra-access-controls (9.5.0)
hydra-access-controls (9.6.0)
active-fedora (~> 9.0)
activesupport (~> 4.0)
blacklight (~> 5.16)
blacklight (>= 5.16)
blacklight-access_controls (~> 0.1)
cancancan (~> 1.8)
deprecation (~> 0.2)
sass-rails
hydra-core (9.5.0)
hydra-core (9.6.0)
active-fedora (~> 9.1)
hydra-access-controls (= 9.5.0)
hydra-access-controls (= 9.6.0)
jettywrapper (>= 2.0.0)
rails (~> 4.0)
hydra-editor (1.1.1)
hydra-editor (1.2.0)
active-fedora (>= 9.0.0)
cancancan (~> 1.8)
rails (~> 4.1)
simple_form (~> 3.1.0)
hydra-file_characterization (0.3.3)
activesupport (>= 3.0.0)
hydra-head (9.5.0)
hydra-access-controls (= 9.5.0)
hydra-core (= 9.5.0)
hydra-head (9.6.0)
hydra-access-controls (= 9.6.0)
hydra-core (= 9.6.0)
rails (>= 3.2.6)
hydra-role-management (0.1.0)
bootstrap_forms
cancan
hydra-role-management (0.2.2)
blacklight
bootstrap_form
cancancan
i18n (0.7.0)
iiif-presentation (0.0.5)
activesupport (>= 3.2.18)
Expand Down Expand Up @@ -467,7 +474,7 @@ GEM
mimemagic (0.3.1)
mini_magick (4.3.6)
mini_portile (0.6.2)
minitest (5.8.3)
minitest (5.8.4)
modernizr-rails (2.7.1)
mono_logger (1.1.0)
multi_json (1.11.2)
Expand Down Expand Up @@ -561,7 +568,7 @@ GEM
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_autolink (1.1.6)
rails (> 3.1)
Expand All @@ -571,7 +578,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
rake (10.4.2)
rake (10.5.0)
rdf (1.99.1)
link_header (~> 0.0, >= 0.0.8)
rdf-aggregate-repo (1.99.0)
Expand Down Expand Up @@ -680,7 +687,7 @@ GEM
ruby-rc4 (0.1.5)
rubyzip (1.1.7)
safe_yaml (1.0.4)
sass (3.4.20)
sass (3.4.21)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
Expand Down Expand Up @@ -710,8 +717,8 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.6)
rack (~> 1.4)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
skydrive (1.2.0)
Expand Down Expand Up @@ -765,6 +772,10 @@ GEM
hitimes
tins (1.6.0)
ttfunk (1.4.0)
twitter-typeahead-rails (0.11.1)
actionpack (>= 3.1)
jquery-rails
railties (>= 3.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
Expand Down Expand Up @@ -814,7 +825,7 @@ DEPENDENCIES
hydra-collections!
hydra-derivatives!
hydra-pcdm!
hydra-role-management (= 0.1.0)
hydra-role-management (~> 0.2.0)
hydra-works!
iiif-presentation
iso-639
Expand Down
1 change: 0 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class CatalogController < ApplicationController
before_action :admin_state_facet

include CurationConcerns::CatalogController
self.search_params_logic += [:hide_parented_resources, :join_from_parent]
def self.search_config
{
'qf' => %w(title_tesim name_tesim source_metadata_identifier_ssim logical_order_headings_tesim collection_slug_sim full_text_tesim),
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/curation_concerns/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def deny_access(exception)
def presenter
@presenter ||=
begin
_, document_list = search_results(params, CatalogController.search_params_logic + [:find_one])
_, document_list = search_results(params)
curation_concern = document_list.first
raise CanCan::AccessDenied.new(nil, params[:action].to_sym) unless curation_concern
@presenter = show_presenter.new(curation_concern, current_ability)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/curation_concerns/file_sets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def show_presenter
def after_update_response
respond_to do |wants|
wants.html do
dest = parent_id.nil? ? [main_app, @file_set] : main_app.bulk_edit_curation_concerns_scanned_resource_path(parent_id)
dest = parent.nil? ? [main_app, @file_set] : [main_app, :bulk_edit, parent]
redirect_to dest, notice: "The file #{view_context.link_to(@file_set, [main_app, @file_set])} has been updated."
end
wants.json { render :show, status: :ok, location: polymorphic_path([main_app, @file_set]) }
Expand Down
2 changes: 2 additions & 0 deletions app/models/search_builder.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class SearchBuilder < CurationConcerns::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior

self.default_processor_chain += [:hide_parented_resources, :join_from_parent]

def self.show_actions
[:show, :manifest, :structure, :pdf]
end
Expand Down
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def to_s
email
end

def to_param
id
end

def self.from_omniauth(access_token)
User.where(provider: access_token.provider, uid: access_token.uid).first_or_create do |user|
user.uid = access_token.uid
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_site_search.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%= form_tag main_app.catalog_index_path, :method => :get, :class => "search-form form-inline clearfix navbar-form" do %>
<%= form_tag main_app.search_catalog_path, :method => :get, :class => "search-form form-inline clearfix navbar-form" do %>
<div class="input-group">
<legend class="accessible-hidden">Search <%=t('curation_concerns.product_name')%></legend>
<%= label_tag :catalog_search, t('curation_concerns.search.form.q.label'), :class => "accessible-hidden" %>
<%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %>
<%= render_hash_as_hidden_fields(search_state.params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %>
<%= text_field_tag(:q, params[:q], :class => "q search-query form-control", :id => "catalog_search", :placeholder => t('curation_concerns.search.form.q.placeholder'), :size => "30", :tabindex => "1", :type => "search") %>
<span class="input-group-btn">
<button type="submit" class="search-submit btn btn-primary" id="keyword-search-submit" tabindex="2">
Expand Down
15 changes: 14 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
Rails.application.routes.draw do
mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)
mount BrowseEverything::Engine => '/browse'
blacklight_for :catalog

mount Blacklight::Engine => '/'
concern :searchable, Blacklight::Routes::Searchable.new
concern :exportable, Blacklight::Routes::Exportable.new
resource :catalog, only: [:index], controller: 'catalog' do
concerns :searchable
end
resources :bookmarks do
concerns :exportable
collection do
delete 'clear'
end
end

devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }, skip: [:passwords, :registration]
devise_scope :user do
get 'sign_out', to: 'devise/sessions#destroy', as: :destroy_user_session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

RSpec.describe CurationConcerns::FileSetsController do
let(:file_set) { FactoryGirl.build(:file_set) }
let(:parent) { FactoryGirl.create(:scanned_resource) }
let(:user) { FactoryGirl.create(:admin) }
describe "#update" do
before do
Expand All @@ -14,9 +15,9 @@
expect(file_set.reload.viewing_hint).to eq 'non-paged'
end
it "redirects to the containing scanned resource after editing" do
allow_any_instance_of(described_class).to receive(:parent_id).and_return("1")
allow_any_instance_of(described_class).to receive(:parent).and_return(parent)
patch :update, id: file_set.id, file_set: { viewing_hint: 'non-paged' }
expect(response).to redirect_to(Rails.application.class.routes.url_helpers.bulk_edit_curation_concerns_scanned_resource_path('1'))
expect(response).to redirect_to(Rails.application.class.routes.url_helpers.bulk_edit_curation_concerns_scanned_resource_path(parent.id))
end
end
end
Loading

0 comments on commit 9c33939

Please sign in to comment.