Skip to content

Commit

Permalink
Merge pull request #506 from projecthydra-labs/hyrax
Browse files Browse the repository at this point in the history
[WIP] Hyrax!
  • Loading branch information
mjgiarlo committed Dec 3, 2016
2 parents 9d27873 + 5d005c9 commit 737ef19
Show file tree
Hide file tree
Showing 55 changed files with 91 additions and 180 deletions.
8 changes: 6 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ require: rubocop-rspec
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

RSpec/SubjectStub:
Exclude:
- 'spec/models/solr_endpoint_spec.rb'

# Offense count: 10
RSpec/LeadingSubject:
Exclude:
- 'spec/controllers/curation_concerns/generic_works_controller_spec.rb'
- 'spec/controllers/sufia/generic_works_controller_spec.rb'
- 'spec/helpers/admin_stats_helper_spec.rb'
- 'spec/lib/active_job_tenant_spec.rb'
- 'spec/lib/importer/factory/string_literal_processor_spec.rb'
- 'spec/lib/stanford/importer/mods_parser_spec.rb'
- 'spec/presenters/curation_concerns/generic_work_show_presenter_spec.rb'
- 'spec/presenters/sufia/generic_work_show_presenter_spec.rb'
- 'spec/services/create_account_spec.rb'
- 'spec/services/iiif_thumbnail_path_service_spec.rb'
- 'spec/services/solr_config_uploader_spec.rb'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end

gem 'blacklight', '~> 6.7'

gem 'sufia', git: 'https://github.com/projecthydra/sufia.git'
gem 'sufia', git: 'https://github.com/projecthydra/sufia.git', branch: 'cc_subtree'
gem 'rsolr', '~> 1.1.2'

gem 'devise'
Expand Down
62 changes: 21 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,51 @@ GIT

GIT
remote: https://github.com/projecthydra/sufia.git
revision: fe71a588caf3233ac303e8ab4bebf450e20934b9
revision: eb5e3d416a4a9da2ea2f06498683a095d6c5c7cd
branch: cc_subtree
specs:
sufia (7.2.0)
sufia (8.0.0.alpha)
active_attr (~> 0.9.0)
active_fedora-noid (~> 2.0)
almond-rails (~> 0.0.1)
awesome_nested_set (~> 3.1)
blacklight (~> 6.6)
blacklight-gallery (~> 0.1)
browse-everything (>= 0.10.3)
breadcrumbs_on_rails (~> 3.0)
browse-everything (>= 0.10.5)
carrierwave (~> 0.9)
curation_concerns (~> 1.7.0.beta1)
clipboard-rails (~> 1.5)
daemons (~> 1.1)
dry-equalizer (~> 0.2)
dry-struct (~> 0.1)
dry-validation (~> 0.9)
flipflop (~> 2.2)
flot-rails (~> 0.0.6)
font-awesome-rails (~> 4.2)
hydra-batch-edit (~> 2.0)
hydra-head (>= 10.1)
hydra-editor (~> 3.1)
hydra-head (~> 10.3)
hydra-works (~> 0.15)
jquery-datatables-rails (~> 3.4.0)
jquery-ui-rails (~> 5.0)
json-schema
kaminari_route_prefix (~> 0.0.1)
legato (~> 0.3)
mailboxer (~> 0.12)
nest (~> 2.0)
oauth
oauth2 (~> 1.2)
posix-spawn
power_converter (~> 0.1, >= 0.1.2)
qa (~> 0.8)
rails_autolink (~> 1.1)
railties (~> 5.0)
rdf-rdfxml
redis-namespace (~> 1.5.2)
redlock (~> 0.1.2)
select2-rails (~> 3.5.9)
signet
tinymce-rails (~> 4.1)
tinymce-rails-imageupload (~> 4.0.16.beta)
tinymce-rails-imageupload (~> 4.0.17.beta)
yaml_db (~> 0.2)

GEM
Expand Down Expand Up @@ -207,34 +221,6 @@ GEM
term-ansicolor (~> 1.3.0)
thor (~> 0.19.1)
tins (>= 1.6.0, < 2)
curation_concerns (1.7.0.beta1)
active-fedora (>= 10.3.0.rc1)
active_attr
active_fedora-noid (~> 2.0.0.beta5)
awesome_nested_set (~> 3.0)
blacklight (~> 6.3)
breadcrumbs_on_rails (>= 3.0.1, < 4)
browse-everything (~> 0.10)
clipboard-rails (~> 1.5)
dry-equalizer (~> 0.2)
dry-struct (~> 0.1)
dry-validation (~> 0.9)
flot-rails (~> 0.0.7)
highcharts-rails
hydra-editor (>= 2, < 4)
hydra-head (>= 10.0.0, < 11)
hydra-works (>= 0.14.0)
jquery-ui-rails
kaminari_route_prefix (~> 0.0.1)
power_converter (~> 0.1, >= 0.1.2)
qa (~> 0.5)
rails_autolink
rdf (>= 1.99)
rdf-vocab (>= 0.8)
redlock (~> 0.1.2)
simple_form (~> 3.1)
solrizer (~> 3.4)
sprockets-es6
daemons (1.2.4)
debug_inspector (0.0.2)
deep_merge (1.1.1)
Expand Down Expand Up @@ -353,8 +339,6 @@ GEM
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
highcharts-rails (4.2.5)
railties (>= 3.1)
hiredis (0.6.1)
honeybadger (2.7.1)
htmlentities (4.3.4)
Expand All @@ -372,10 +356,6 @@ GEM
blacklight-access_controls (~> 0.6)
cancancan (~> 1.8)
deprecation (~> 1.0)
hydra-batch-edit (2.1.0)
blacklight
curation_concerns (>= 0.12.0.pre2)
rails
hydra-core (10.3.4)
hydra-access-controls (= 10.3.4)
railties (>= 4.0.0, < 6)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated via
# `rails generate curation_concerns:work GenericWork`
module CurationConcerns
module Sufia
module Actors
class GenericWorkActor < CurationConcerns::Actors::BaseActor
class GenericWorkActor < Sufia::Actors::BaseActor
end
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated via
# `rails generate curation_concerns:work Image`
module CurationConcerns
module Sufia
module Actors
class ImageActor < CurationConcerns::Actors::BaseActor
class ImageActor < Sufia::Actors::BaseActor
end
end
end
1 change: 0 additions & 1 deletion app/assets/javascripts/batch_edit.js

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/stylesheets/batch_edit.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class UsersController < ApplicationController
layout 'admin'

def self.local_prefixes
['users']
['sufia/users']
end

private
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ class ApplicationController < ActionController::Base
include Blacklight::Controller
include Hydra::Controller::ControllerBehavior

# Adds CurationConcerns behaviors to the application controller.
include CurationConcerns::ApplicationControllerBehavior
# Adds Sufia behaviors into the application controller
include Sufia::Controller

include CurationConcerns::ThemedLayoutController
include Sufia::ThemedLayoutController
with_themed_layout '1_column'

helper_method :peek_enabled?, :current_account
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class CatalogController < ApplicationController
include Hydra::Catalog
include Hydra::Controller::ControllerBehavior
include Sufia::Catalog

# These before_filters apply the hydra access controls
before_action :enforce_show_permissions, only: :show
Expand All @@ -28,7 +27,7 @@ def self.modified_field
config.advanced_search[:query_parser] ||= 'dismax'
config.advanced_search[:form_solr_parameters] ||= {}

config.search_builder_class = Sufia::SearchBuilder
config.search_builder_class = Sufia::CatalogSearchBuilder

# Show gallery view
config.view.gallery.partials = [:index_header, :index]
Expand Down
61 changes: 0 additions & 61 deletions app/controllers/curation_concerns/admin_controller.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module CurationConcerns
module Sufia
class FileSetsController < ApplicationController
include CurationConcerns::FileSetsControllerBehavior
include Sufia::FileSetsControllerBehavior
include Sufia::FileSetsControllerBehavior
self.show_presenter = Hyku::FileSetPresenter
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'iiif_manifest'
module CurationConcerns
module Sufia
class GenericWorksController < ApplicationController
include CurationConcerns::CurationConcernController
include Sufia::CurationConcernController
# Adds Sufia behaviors to the controller.
include Sufia::WorksControllerBehavior

self.curation_concern_type = GenericWork
self.show_presenter = CurationConcerns::GenericWorkShowPresenter
self.show_presenter = Sufia::GenericWorkShowPresenter

skip_load_and_authorize_resource only: :manifest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated via
# `rails generate curation_concerns:work Image`

module CurationConcerns
module Sufia
class ImagesController < ApplicationController
include CurationConcerns::CurationConcernController
include Sufia::CurationConcernController
# Adds Sufia behaviors to the controller.
include Sufia::WorksControllerBehavior

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated via
# `rails generate curation_concerns:work GenericWork`
module CurationConcerns
module Sufia
class GenericWorkForm < Sufia::Forms::WorkForm
self.model_class = ::GenericWork
include HydraEditor::Form::Permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated via
# `rails generate curation_concerns:work Image`
module CurationConcerns
module Sufia
class ImageForm < Sufia::Forms::WorkForm
self.model_class = ::Image
self.terms += [:resource_type]
Expand Down
1 change: 0 additions & 1 deletion app/helpers/sufia_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module SufiaHelper
include ::BlacklightHelper
include CurationConcerns::MainAppHelpers
include Sufia::BlacklightOverride
include Sufia::SufiaHelperBehavior

Expand Down
2 changes: 1 addition & 1 deletion app/indexers/file_set_indexer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class FileSetIndexer < CurationConcerns::FileSetIndexer
class FileSetIndexer < Sufia::FileSetIndexer
self.thumbnail_path_service = IIIFThumbnailPathService
end
3 changes: 1 addition & 2 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class Ability
include Hydra::Ability

include CurationConcerns::Ability
include Sufia::Ability

self.ability_logic += [:everyone_can_create_curation_concerns, :superadmin_permissions]
Expand All @@ -12,6 +10,7 @@ def custom_permissions
end

def admin_permissions
return unless admin?
super
can [:manage], [Site, Role, User]

Expand Down
4 changes: 2 additions & 2 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by curation_concerns:models:install
class Collection < ActiveFedora::Base
include ::CurationConcerns::CollectionBehavior
include ::Sufia::CollectionBehavior
# You can replace these metadata if they're not suitable
include CurationConcerns::BasicMetadata
include Sufia::BasicMetadata
end
2 changes: 1 addition & 1 deletion app/models/file_set.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by curation_concerns:models:install
class FileSet < ActiveFedora::Base
include ::CurationConcerns::FileSetBehavior
include ::Sufia::FileSetBehavior
include Sufia::FileSetBehavior
self.indexer = FileSetIndexer
end
4 changes: 2 additions & 2 deletions app/models/generic_work.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class GenericWork < ActiveFedora::Base
include ::CurationConcerns::WorkBehavior
include ::CurationConcerns::BasicMetadata
include ::Sufia::WorkBehavior
include ::Sufia::BasicMetadata
include Sufia::WorkBehavior
validates :title, presence: { message: 'Your work must have a title.' }

Expand Down
4 changes: 2 additions & 2 deletions app/models/image.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated via
# `rails generate curation_concerns:work Image`
class Image < ActiveFedora::Base
include ::CurationConcerns::WorkBehavior
include ::CurationConcerns::BasicMetadata
include ::Sufia::WorkBehavior
include ::Sufia::BasicMetadata
include Sufia::WorkBehavior
self.human_readable_type = 'Image'
# Change this to restrict which works can be added as a child.
Expand Down
2 changes: 1 addition & 1 deletion app/models/search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
class SearchBuilder < Blacklight::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior
include Hydra::AccessControlsEnforcement
include CurationConcerns::SearchFilters
include Sufia::SearchFilters
end

0 comments on commit 737ef19

Please sign in to comment.