-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify Collection & Admin Set Valkyrization
Addresses: ☄️ EPIC: Valkyrize Hyku scientist-softserv/hykuup_knapsack#35 valkyrize collection and admin set resources scientist-softserv/hykuup_knapsack#94 Moves away from directly using Hyrax::PcdmCollection and Hyrax::AdministrativeSet instead favoring inheriting from those (with CollectionResource and AdminSetResource). This allows for inheriting from Hyrax factories and extending them; thus bringing Hyku’s testing ecosystem closer to Hyrax. Note: There are a few of the new specs that still fail. -
- Loading branch information
Showing
22 changed files
with
232 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class AdminSetResourceForm < Hyrax::Forms::AdministrativeSetForm | ||
include CollectionAccessFiltering | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResourceForm < Hyrax::Forms::PcdmCollectionForm | ||
include Hyrax::FormFields(:basic_metadata) | ||
include Hyrax::FormFields(:collection_resource) | ||
include CollectionAccessFiltering | ||
end |
11 changes: 0 additions & 11 deletions
11
app/forms/hyrax/forms/admin/administrative_set_form_decorator.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class AdminSetResourceIndexer < Hyrax::Indexers::AdministrativeSetIndexer | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResourceIndexer < Hyrax::Indexers::PcdmCollectionIndexer | ||
include Hyrax::Indexer(:basic_metadata) | ||
include Hyrax::Indexer(:collection_resource) | ||
|
||
def to_solr | ||
super.tap do |index_document| | ||
index_document["account_cname_tesim"] = Site.instance&.account&.cname | ||
index_document['account_institution_name_ssim'] = Site.instance.institution_label | ||
end | ||
end | ||
end |
6 changes: 2 additions & 4 deletions
6
...els/hyrax/administrative_set_decorator.rb → app/models/admin_set_resource.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax 5.0 to add AF methods to collection | ||
|
||
Hyrax::AdministrativeSet.class_eval do | ||
class AdminSetResource < Hyrax::AdministrativeSet | ||
include Hyrax::ArResource | ||
include Hyrax::Permissions::Readable | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResource < Hyrax::PcdmCollection | ||
include Hyrax::Schema(:basic_metadata) | ||
include Hyrax::Schema(:collection_resource) | ||
include Hyrax::ArResource | ||
# This module provides the #public?, #private?, #restricted? methods; consider | ||
# contributing this back to Hyrax; but that decision requires further discussion | ||
# on architecture. | ||
# @see https://samvera.slack.com/archives/C0F9JQJDQ/p1705421588370699 Slack discussion thread. | ||
include Hyrax::Permissions::Readable | ||
prepend OrderAlready.for(:creator) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.