hyrax 3.4.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +26 -17
- data/.dassie/.env +1 -1
- data/.dassie/Gemfile +1 -1
- data/.dassie/app/forms/collection_resource_form.rb +8 -0
- data/.dassie/app/indexers/collection_resource_indexer.rb +8 -0
- data/.dassie/app/models/collection_resource.rb +35 -0
- data/.dassie/config/initializers/file_services.rb +4 -0
- data/.dassie/config/initializers/hyrax.rb +2 -1
- data/.dassie/config/metadata/collection_resource.yaml +23 -0
- data/.dassie/db/seeds.rb +2 -0
- data/.dassie/spec/forms/collection_resource_form_spec.rb +13 -0
- data/.dassie/spec/indexers/collection_resource_indexer_spec.rb +14 -0
- data/.dassie/spec/models/collection_resource_spec.rb +13 -0
- data/.regen +1 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_fixme.yml +19 -2
- data/CONTAINERS.md +18 -13
- data/Dockerfile +2 -2
- data/app/actors/hyrax/actors/collections_membership_actor.rb +1 -1
- data/app/actors/hyrax/actors/embargo_actor.rb +11 -4
- data/app/actors/hyrax/actors/lease_actor.rb +11 -4
- data/app/assets/javascripts/hyrax/app.js.erb +1 -1
- data/app/assets/javascripts/hyrax/collections_v2.es6 +13 -0
- data/app/assets/javascripts/hyrax/permissions/control.es6 +8 -1
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +1 -3
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +11 -2
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +11 -2
- data/app/controllers/concerns/hyrax/manages_embargoes.rb +13 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +159 -76
- data/app/controllers/hyrax/downloads_controller.rb +16 -1
- data/app/controllers/hyrax/file_sets_controller.rb +10 -1
- data/app/controllers/hyrax/permissions_controller.rb +1 -1
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +1 -1
- data/app/controllers/hyrax/transfers_controller.rb +0 -2
- data/app/controllers/hyrax/workflow_actions_controller.rb +3 -2
- data/app/forms/hyrax/forms/collection_form.rb +1 -1
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +2 -0
- data/app/forms/hyrax/forms/embargo.rb +13 -0
- data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
- data/app/forms/hyrax/forms/file_set_form.rb +8 -35
- data/app/forms/hyrax/forms/lease.rb +13 -0
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +29 -2
- data/app/forms/hyrax/forms/pcdm_object_form.rb +46 -0
- data/app/forms/hyrax/forms/resource_form.rb +39 -21
- data/app/forms/hyrax/forms/widgets/admin_set_visibility.rb +1 -1
- data/app/forms/hyrax/forms/work_embargo_form.rb +35 -0
- data/app/forms/hyrax/forms/work_lease_form.rb +35 -0
- data/app/helpers/hyrax/embargo_helper.rb +11 -0
- data/app/helpers/hyrax/lease_helper.rb +11 -0
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +1 -1
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -8
- data/app/jobs/characterize_job.rb +5 -1
- data/app/jobs/content_event_job.rb +1 -1
- data/app/jobs/import_url_job.rb +4 -6
- data/app/jobs/valkyrie_ingest_job.rb +15 -77
- data/app/models/admin_set.rb +8 -0
- data/app/models/concerns/hyrax/collection_behavior.rb +3 -2
- data/app/models/concerns/hyrax/collection_nesting.rb +10 -1
- data/app/models/concerns/hyrax/file_set_behavior.rb +1 -0
- data/app/models/concerns/hyrax/user.rb +11 -0
- data/app/models/concerns/hyrax/work_behavior.rb +3 -2
- data/app/models/featured_work_list.rb +0 -1
- data/app/models/hyrax/embargo.rb +1 -1
- data/app/models/hyrax/file_metadata.rb +32 -2
- data/app/models/hyrax/file_set.rb +4 -6
- data/app/models/hyrax/group.rb +19 -0
- data/app/models/hyrax/lease.rb +1 -1
- data/app/models/hyrax/pcdm_collection.rb +0 -1
- data/app/models/job_io_wrapper.rb +1 -1
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/presenters/hyrax/member_presenter_factory.rb +2 -4
- data/app/presenters/hyrax/permission_badge.rb +3 -2
- data/app/presenters/hyrax/version_list_presenter.rb +6 -1
- data/app/presenters/hyrax/work_show_presenter.rb +3 -3
- data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +13 -5
- data/app/services/hyrax/access_control_list.rb +7 -6
- data/app/services/hyrax/adapters/nesting_index_adapter.rb +3 -3
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +3 -5
- data/app/services/hyrax/collections/collection_member_service.rb +3 -5
- data/app/services/hyrax/collections/nested_collection_query_service.rb +1 -1
- data/app/services/hyrax/edit_permissions_service.rb +21 -3
- data/app/services/hyrax/embargo_manager.rb +9 -0
- data/app/services/hyrax/file_set_file_service.rb +55 -0
- data/app/services/hyrax/lease_manager.rb +9 -0
- data/app/services/hyrax/listeners/file_metadata_listener.rb +11 -0
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +14 -18
- data/app/services/hyrax/multiple_membership_checker.rb +2 -0
- data/app/services/hyrax/user_stat_importer.rb +2 -0
- data/app/services/hyrax/valkyrie_persist_derivatives.rb +50 -0
- data/app/services/hyrax/valkyrie_upload.rb +94 -0
- data/app/services/hyrax/versioning_service.rb +77 -9
- data/app/services/hyrax/visibility_propagator.rb +5 -5
- data/app/services/hyrax/work_resource_query_service.rb +45 -0
- data/app/services/hyrax/workflow/workflow_importer.rb +7 -9
- data/app/services/hyrax/workflow/workflow_schema.rb +3 -5
- data/app/strategies/hyrax/strategies/yaml_strategy.rb +4 -6
- data/app/uploaders/hyrax/uploaded_file_uploader.rb +4 -4
- data/app/validators/hyrax/collection_membership_validator.rb +16 -15
- data/app/views/catalog/_index_header_list_default.html.erb +8 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +8 -3
- data/app/views/collections/edit_fields/_based_near.html.erb +7 -7
- data/app/views/hyrax/base/_form_progress.html.erb +1 -1
- data/app/views/hyrax/base/_form_visibility_component.html.erb +5 -1
- data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -2
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +1 -0
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +1 -1
- data/app/views/hyrax/embargoes/edit.html.erb +3 -3
- data/app/views/hyrax/file_sets/_permission.html.erb +1 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +1 -6
- data/app/views/hyrax/file_sets/edit.html.erb +2 -2
- data/app/views/hyrax/leases/edit.html.erb +3 -3
- data/app/views/hyrax/my/works/_tabs.html.erb +6 -1
- data/app/views/hyrax/transfers/new.html.erb +1 -1
- data/chart/hyrax/Chart.yaml +10 -6
- data/chart/hyrax/templates/_helpers.tpl +4 -0
- data/chart/hyrax/templates/cron-embargo.yaml +5 -0
- data/chart/hyrax/templates/cron-lease.yaml +5 -0
- data/chart/hyrax/templates/deployment-worker.yaml +11 -0
- data/chart/hyrax/templates/ingress.yaml +7 -6
- data/chart/hyrax/values.yaml +152 -0
- data/config/features.rb +48 -50
- data/config/initializers/{valkryrie_storage.rb → storage_adapter_initializer.rb} +5 -0
- data/config/locales/hyrax.de.yml +14 -13
- data/config/locales/hyrax.en.yml +3 -0
- data/config/locales/hyrax.es.yml +1 -0
- data/config/locales/hyrax.fr.yml +2 -1
- data/config/locales/hyrax.it.yml +1 -0
- data/config/locales/hyrax.pt-BR.yml +1 -0
- data/config/locales/hyrax.zh.yml +1 -0
- data/config/metadata/file_set_metadata.yaml +130 -0
- data/docker-compose.yml +1 -0
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/documentation/legacyREADME.md +3 -3
- data/hyrax.gemspec +7 -3
- data/lib/generators/hyrax/collection_resource/USAGE +20 -0
- data/lib/generators/hyrax/collection_resource/collection_resource_generator.rb +133 -0
- data/lib/generators/hyrax/collection_resource/templates/collection.rb.erb +34 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_form.rb.erb +7 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_form_spec.rb.erb +13 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_indexer.rb.erb +7 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_indexer_spec.rb.erb +13 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_metadata.yaml +22 -0
- data/lib/generators/hyrax/collection_resource/templates/collection_spec.rb.erb +12 -0
- data/lib/generators/hyrax/install_generator.rb +9 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +1 -1
- data/lib/hyrax/active_fedora_dummy_model.rb +13 -0
- data/lib/hyrax/configuration.rb +21 -2
- data/lib/hyrax/errors.rb +2 -0
- data/lib/hyrax/publisher.rb +4 -0
- data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +6 -0
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +0 -1
- data/lib/hyrax/specs/shared_specs/indexers.rb +5 -0
- data/lib/hyrax/transactions/collection_update.rb +2 -0
- data/lib/hyrax/transactions/container.rb +10 -0
- data/lib/hyrax/transactions/steps/save_collection_banner.rb +59 -0
- data/lib/hyrax/transactions/steps/save_collection_logo.rb +109 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/wings/active_fedora_converter/file_metadata_node.rb +48 -0
- data/lib/wings/active_fedora_converter/instance_builder.rb +68 -0
- data/lib/wings/active_fedora_converter.rb +3 -3
- data/lib/wings/services/custom_queries/find_file_metadata.rb +19 -8
- data/lib/wings/valkyrie/query_service.rb +4 -6
- data/lib/wings/valkyrie/storage.rb +6 -2
- data/template.rb +1 -1
- metadata +99 -13
- data/app/views/catalog/_index_header_list_hyrax_pcdm_collection.html.erb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98e61b637b4f510e877e88c3f2f8020a411b7d83cd0c074e142f666fbda964f1
|
4
|
+
data.tar.gz: 17a8be1a76c9755d5e8b2b1387e907c2d70722809cdb28a62088d913dc584384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445d46c5b5b5ee45ea4262e1809e92356f9536f2f919af929b9d33fafcc13c584ae0ff1c6c2b27cac8ffbcdf35f9be6fd9a726b9bf5c9cafc0632fbd8596a90c
|
7
|
+
data.tar.gz: d5d5ca3a839a02af1fec27d262eb8301a5880a07caba29b9ce383b37a7c7aea098e57f3ddf9c3fbc1582f5a9ffa227e7d0fc3702833a645ae86b7ab94745a2f9
|
data/.circleci/config.yml
CHANGED
@@ -6,7 +6,7 @@ jobs:
|
|
6
6
|
parameters:
|
7
7
|
ruby_version:
|
8
8
|
type: string
|
9
|
-
default: 2.5.
|
9
|
+
default: 2.5.9
|
10
10
|
bundler_version:
|
11
11
|
type: string
|
12
12
|
default: 1.17.3
|
@@ -67,7 +67,7 @@ jobs:
|
|
67
67
|
parameters:
|
68
68
|
ruby_version:
|
69
69
|
type: string
|
70
|
-
default: 2.5.
|
70
|
+
default: 2.5.9
|
71
71
|
bundler_version:
|
72
72
|
type: string
|
73
73
|
default: 1.17.3
|
@@ -86,6 +86,15 @@ jobs:
|
|
86
86
|
steps:
|
87
87
|
- attach_workspace:
|
88
88
|
at: ~/
|
89
|
+
- when:
|
90
|
+
condition:
|
91
|
+
equal: [ '2.5.9', << parameters.ruby_version >> ]
|
92
|
+
steps:
|
93
|
+
- run:
|
94
|
+
name: "Lock browse everything for Ruby 2.5"
|
95
|
+
command: |
|
96
|
+
sed -i.bak "s/browse-everything.*/browse-everything\', \'1.1.2\'/" hyrax.gemspec
|
97
|
+
bundle
|
89
98
|
- samvera/engine_cart_generate:
|
90
99
|
cache_key: v1-internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum ".regen" }}-{{ checksum ".circleci/config.yml" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
|
91
100
|
- samvera/bundle:
|
@@ -101,7 +110,7 @@ jobs:
|
|
101
110
|
parameters:
|
102
111
|
ruby_version:
|
103
112
|
type: string
|
104
|
-
default: 2.5.
|
113
|
+
default: 2.5.9
|
105
114
|
bundler_version:
|
106
115
|
type: string
|
107
116
|
default: 1.17.3
|
@@ -150,43 +159,43 @@ jobs:
|
|
150
159
|
--header 'Content-Type: application/json'
|
151
160
|
workflows:
|
152
161
|
version: 2
|
153
|
-
ruby2-5
|
162
|
+
ruby2-5:
|
154
163
|
jobs:
|
155
164
|
- bundle:
|
156
|
-
ruby_version: "2.5.
|
165
|
+
ruby_version: "2.5.9"
|
157
166
|
rails_version: "5.2.6"
|
158
167
|
- build:
|
159
|
-
ruby_version: "2.5.
|
168
|
+
ruby_version: "2.5.9"
|
160
169
|
rails_version: "5.2.6"
|
161
170
|
requires:
|
162
171
|
- bundle
|
163
172
|
- test:
|
164
|
-
name: "ruby2-5
|
165
|
-
ruby_version: "2.5.
|
173
|
+
name: "ruby2-5"
|
174
|
+
ruby_version: "2.5.9"
|
166
175
|
requires:
|
167
176
|
- build
|
168
|
-
ruby2-6
|
177
|
+
ruby2-6:
|
169
178
|
jobs:
|
170
179
|
- bundle:
|
171
|
-
ruby_version: "2.6.
|
180
|
+
ruby_version: "2.6.7"
|
172
181
|
rails_version: "5.2.6"
|
173
182
|
- build:
|
174
|
-
ruby_version: "2.6.
|
183
|
+
ruby_version: "2.6.7"
|
175
184
|
rails_version: "5.2.6"
|
176
185
|
requires:
|
177
186
|
- bundle
|
178
187
|
- test:
|
179
|
-
name: "ruby2-6
|
180
|
-
ruby_version: "2.6.
|
188
|
+
name: "ruby2-6"
|
189
|
+
ruby_version: "2.6.7"
|
181
190
|
requires:
|
182
191
|
- build
|
183
192
|
- test:
|
184
|
-
name: "ruby2-6-
|
185
|
-
ruby_version: "2.6.
|
193
|
+
name: "ruby2-6-valkyrie"
|
194
|
+
ruby_version: "2.6.7"
|
186
195
|
hyrax_valkyrie: "true"
|
187
196
|
requires:
|
188
197
|
- build
|
189
|
-
ruby2-7
|
198
|
+
ruby2-7:
|
190
199
|
jobs:
|
191
200
|
- bundle:
|
192
201
|
ruby_version: "2.7.4"
|
@@ -199,7 +208,7 @@ workflows:
|
|
199
208
|
requires:
|
200
209
|
- bundle
|
201
210
|
- test:
|
202
|
-
name: "ruby2-7
|
211
|
+
name: "ruby2-7"
|
203
212
|
ruby_version: "2.7.4"
|
204
213
|
bundler_version: "2.1.4"
|
205
214
|
requires:
|
data/.dassie/.env
CHANGED
data/.dassie/Gemfile
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
class CollectionResourceForm < Hyrax::Forms::PcdmCollectionForm
|
6
|
+
include Hyrax::FormFields(:basic_metadata)
|
7
|
+
include Hyrax::FormFields(:collection_resource)
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
class CollectionResourceIndexer < Hyrax::PcdmCollectionIndexer
|
6
|
+
include Hyrax::Indexer(:basic_metadata)
|
7
|
+
include Hyrax::Indexer(:collection_resource)
|
8
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
class CollectionResource < Hyrax::PcdmCollection
|
6
|
+
# @note Do not directly update `basic_metadata.yaml`. It is also used by works.
|
7
|
+
#
|
8
|
+
# To change metadata for collections
|
9
|
+
# * extend by adding fields to `/config/metadata/collection_resource.yaml`
|
10
|
+
# * remove all basic metadata
|
11
|
+
# * if you generated `with_basic_metadata` and now don't want any basic metadata,
|
12
|
+
# comment out or delete the schema include statement for `:basic_metadata`
|
13
|
+
# * update form and indexer classes to also remove the `:basic_metadata` schema include
|
14
|
+
# * remove some basic metadata
|
15
|
+
# * comment out or delete the schema include statement for `:basic_metadata`
|
16
|
+
# * update form and indexer classes to also remove the `:basic_metadata` schema include
|
17
|
+
# * copy fields you want to keep from `/config/metadata/basic_metadata.yaml`
|
18
|
+
# to `/config/metadata/collection_resource.yaml`
|
19
|
+
# * override some basic metadata
|
20
|
+
# * fields are not allowed to repeat, so to override any basic metadata, you
|
21
|
+
# must first comment out or delete the schema include statement for `:basic_metadata`
|
22
|
+
# * update form and indexer classes to also remove the `:basic_metadata` schema include
|
23
|
+
# * copy all fields you want to keep unchanged or to override from `/config/metadata/basic_metadata.yaml`
|
24
|
+
# to `/config/metadata/collection_resource.yaml`
|
25
|
+
# * update them in `config/metadata/collection_resource.yaml to have the desired
|
26
|
+
# characteristics
|
27
|
+
#
|
28
|
+
# Alternative:
|
29
|
+
# * comment out or delete schema include statements
|
30
|
+
# * add Valkyrie attributes to this class
|
31
|
+
# * update form and indexer to process the attributes
|
32
|
+
#
|
33
|
+
include Hyrax::Schema(:basic_metadata)
|
34
|
+
include Hyrax::Schema(:collection_resource)
|
35
|
+
end
|
@@ -54,7 +54,8 @@ Hyrax.config do |config|
|
|
54
54
|
##
|
55
55
|
# NOTE: To Valkyrie works, use Monograph which is_a Hyrax::Work is_a Valkyrie::Resource
|
56
56
|
# To use Valkyrie models, uncomment the following lines.
|
57
|
-
# config.collection_model = 'Hyrax::PcdmCollection'
|
57
|
+
# config.collection_model = 'Hyrax::PcdmCollection' # collection without basic metadata
|
58
|
+
# config.collection_model = 'CollectionResource' # collection with basic metadata
|
58
59
|
# config.admin_set_model = 'Hyrax::AdministrativeSet'
|
59
60
|
end
|
60
61
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Simple yaml config-driven schema which is used to define model attributes,
|
2
|
+
# index key names, and form properties.
|
3
|
+
#
|
4
|
+
# Originally generated with no metadata via
|
5
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
6
|
+
#
|
7
|
+
# A few custom fields are added for testing purposes.
|
8
|
+
|
9
|
+
---
|
10
|
+
attributes:
|
11
|
+
target_audience:
|
12
|
+
type: string
|
13
|
+
form:
|
14
|
+
primary: true
|
15
|
+
multiple: true
|
16
|
+
department:
|
17
|
+
type: string
|
18
|
+
form:
|
19
|
+
primary: true
|
20
|
+
course:
|
21
|
+
type: string
|
22
|
+
form:
|
23
|
+
primary: false
|
data/.dassie/db/seeds.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
require 'rails_helper'
|
6
|
+
require 'valkyrie/specs/shared_specs'
|
7
|
+
|
8
|
+
RSpec.describe CollectionResourceForm do
|
9
|
+
let(:change_set) { described_class.new(resource) }
|
10
|
+
let(:resource) { CollectionResource.new }
|
11
|
+
|
12
|
+
it_behaves_like 'a Valkyrie::ChangeSet'
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
require 'rails_helper'
|
6
|
+
require 'hyrax/specs/shared_specs/indexers'
|
7
|
+
|
8
|
+
RSpec.describe CollectionResourceIndexer do
|
9
|
+
let(:indexer_class) { described_class }
|
10
|
+
let(:resource) { CollectionResource.new }
|
11
|
+
|
12
|
+
it_behaves_like 'a Hyrax::Resource indexer'
|
13
|
+
it_behaves_like 'a Basic metadata indexer'
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Generated via
|
4
|
+
# `rails generate hyrax:collection_resource CollectionResource`
|
5
|
+
require 'rails_helper'
|
6
|
+
require 'hyrax/specs/shared_specs/hydra_works'
|
7
|
+
|
8
|
+
RSpec.describe CollectionResource do
|
9
|
+
subject(:collection) { described_class.new }
|
10
|
+
|
11
|
+
it_behaves_like 'a Hyrax::PcdmCollection'
|
12
|
+
it_behaves_like 'a model with basic metadata'
|
13
|
+
end
|
data/.regen
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
46
|
data/.rubocop.yml
CHANGED
data/.rubocop_fixme.yml
CHANGED
@@ -171,14 +171,31 @@ RSpec/RepeatedDescription:
|
|
171
171
|
- 'spec/models/sipity/workflow_state_action_spec.rb'
|
172
172
|
- 'spec/models/sipity/workflow_state_spec.rb'
|
173
173
|
|
174
|
-
# Offense count:
|
174
|
+
# Offense count: 2
|
175
175
|
# Configuration parameters: Include.
|
176
176
|
# Include: app/models/**/*.rb
|
177
177
|
Rails/HasManyOrHasOneDependent:
|
178
178
|
Exclude:
|
179
179
|
- 'app/models/admin_set.rb'
|
180
|
+
- 'app/models/hyrax/permission_template.rb'
|
180
181
|
|
181
182
|
# Offense count: 1
|
182
|
-
|
183
|
+
Rails/SkipsModelValidations:
|
184
|
+
Exclude:
|
185
|
+
- 'app/services/hyrax/works/migration_service.rb'
|
186
|
+
|
187
|
+
# Offense count: 12
|
188
|
+
Lint/MissingSuper:
|
183
189
|
Exclude:
|
190
|
+
- 'app/actors/hyrax/actors/interpret_visibility_actor.rb'
|
191
|
+
- 'app/actors/hyrax/actors/ordered_members_actor.rb'
|
184
192
|
- 'app/models/concerns/hyrax/file_set/characterization.rb'
|
193
|
+
- 'app/presenters/hyrax/file_usage.rb'
|
194
|
+
- 'app/presenters/hyrax/work_usage.rb'
|
195
|
+
- 'app/services/hyrax/batch_create_failure_service.rb'
|
196
|
+
- 'app/services/hyrax/batch_create_success_service.rb'
|
197
|
+
- 'app/services/hyrax/collection_types/create_service.rb'
|
198
|
+
- 'app/services/hyrax/solr_query_service.rb'
|
199
|
+
- 'lib/hyrax/form_fields.rb'
|
200
|
+
- 'lib/hyrax/health_checks/solr_check.rb'
|
201
|
+
- 'lib/hyrax/schema.rb'
|
data/CONTAINERS.md
CHANGED
@@ -143,28 +143,32 @@ _This is for applications that mount Hyrax and is separate from the docker conta
|
|
143
143
|
|
144
144
|
### Maintaining
|
145
145
|
|
146
|
-
We publish several Hyrax images to
|
147
|
-
[
|
146
|
+
We publish several Hyrax images to the [GitHub container registry][ghcr] under
|
147
|
+
the [Samvera organization][samvera-packages]. To build them:
|
148
148
|
|
149
149
|
```sh
|
150
|
-
|
151
|
-
|
152
|
-
docker push samveralabs/hyrax:(git rev-parse HEAD)
|
150
|
+
export HYRAX_VERSION=v3.4.1 # or desired version
|
151
|
+
git checkout $HYRAX_VERSION
|
153
152
|
|
154
|
-
|
155
|
-
|
156
|
-
docker
|
153
|
+
docker build --target hyrax-base --tag ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD) .
|
154
|
+
|
155
|
+
docker tag ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD) ghcr.io/samvera/hyrax/hyrax-base:$HYRAX_VERSION
|
156
|
+
|
157
|
+
docker push ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD)
|
158
|
+
docker push ghcr.io/samvera/hyrax/hyrax-base:$HYRAX_VERSION
|
157
159
|
```
|
158
160
|
|
161
|
+
Do the same for `hyrax-worker-base`.
|
162
|
+
|
159
163
|
We also publish an image for the stable test application `dassie`:
|
160
164
|
|
161
165
|
```sh
|
162
|
-
docker build --target hyrax-engine-dev --tag
|
166
|
+
docker build --target hyrax-engine-dev --tag ghcr.io/samvera/hyrax/dassie:$(git rev-parse HEAD) .
|
163
167
|
|
164
|
-
docker tag
|
168
|
+
docker tag ghcr.io/samvera/hyrax/dassie:$(git rev-parse HEAD) ghcr.io/samvera/hyrax/dassie:$HYRAX_VERSION
|
165
169
|
|
166
|
-
docker push
|
167
|
-
docker push
|
170
|
+
docker push ghcr.io/samvera/hyrax/dassie:$(git rev-parse HEAD)
|
171
|
+
docker push ghcr.io/samvera/hyrax/dassie:$HYRAX_VERSION
|
168
172
|
```
|
169
173
|
|
170
174
|
## Deploying to Production
|
@@ -180,4 +184,5 @@ helm dependency update chart/hyrax
|
|
180
184
|
helm install -n hyrax --set image.tag=(git rev-parse HEAD) dassie chart/hyrax
|
181
185
|
```
|
182
186
|
|
183
|
-
[
|
187
|
+
[ghcr]: https://docs.github.com/en/enterprise-cloud@latest/packages/working-with-a-github-packages-registry/working-with-the-container-registry
|
188
|
+
[samvera-packages]: https://github.com/orgs/samvera/packages
|
data/Dockerfile
CHANGED
@@ -70,7 +70,7 @@ module Hyrax
|
|
70
70
|
# along side the FileSets on the show page
|
71
71
|
def add(env, id)
|
72
72
|
collection = Hyrax.config.collection_class.find(id)
|
73
|
-
collection.reindex_extent
|
73
|
+
collection.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX)
|
74
74
|
|
75
75
|
return unless env.current_ability.can?(:deposit, collection)
|
76
76
|
env.curation_concern.member_of_collections << collection
|
@@ -12,10 +12,17 @@ module Hyrax
|
|
12
12
|
# Update the visibility of the work to match the correct state of the embargo, then clear the embargo date, etc.
|
13
13
|
# Saves the embargo and the work
|
14
14
|
def destroy
|
15
|
-
work
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
case work
|
16
|
+
when Valkyrie::Resource
|
17
|
+
embargo_manager = Hyrax::EmbargoManager.new(resource: work)
|
18
|
+
embargo_manager.release && Hyrax::AccessControlList(work).save
|
19
|
+
embargo_manager.nullify
|
20
|
+
else
|
21
|
+
work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
|
22
|
+
work.deactivate_embargo!
|
23
|
+
work.embargo.save!
|
24
|
+
work.save!
|
25
|
+
end
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
@@ -12,10 +12,17 @@ module Hyrax
|
|
12
12
|
# Update the visibility of the work to match the correct state of the lease, then clear the lease date, etc.
|
13
13
|
# Saves the lease and the work
|
14
14
|
def destroy
|
15
|
-
work
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
case work
|
16
|
+
when Valkyrie::Resource
|
17
|
+
lease_manager = Hyrax::LeaseManager.new(resource: work)
|
18
|
+
lease_manager.release && Hyrax::AccessControlList(work).save
|
19
|
+
lease_manager.nullify
|
20
|
+
else
|
21
|
+
work.lease_visibility! # If the lease has lapsed, update the current visibility.
|
22
|
+
work.deactivate_lease!
|
23
|
+
work.lease.save!
|
24
|
+
work.save!
|
25
|
+
end
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
@@ -104,7 +104,7 @@ Hyrax = {
|
|
104
104
|
// On the edit work page
|
105
105
|
new PermissionsControl($("#share"), 'tmpl-work-grant');
|
106
106
|
// On the edit fileset page
|
107
|
-
new PermissionsControl($("#permission"), 'tmpl-file-set-grant');
|
107
|
+
new PermissionsControl($("#permission"), 'tmpl-file-set-grant', { with_visibility_component: true });
|
108
108
|
// On the batch edit page
|
109
109
|
new PermissionsControl($("#form_permissions"), 'tmpl-work-grant');
|
110
110
|
// On the edit collection page
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import CollectionUtilities from 'hyrax/collections_utils';
|
2
|
+
import Editor from 'hyrax/editor';
|
2
3
|
|
3
4
|
export default class CollectionsV2 {
|
4
5
|
constructor() {
|
5
6
|
this.collectionUtilities = new CollectionUtilities();
|
6
7
|
this.setupAddSharingHandler();
|
7
8
|
this.sharingAddButtonDisabler();
|
9
|
+
this.setupEditor();
|
8
10
|
}
|
9
11
|
|
10
12
|
/**
|
@@ -54,4 +56,15 @@ export default class CollectionsV2 {
|
|
54
56
|
)
|
55
57
|
);
|
56
58
|
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Set up editor to enable Geonames autocomplete for Location data
|
62
|
+
* @return {void}
|
63
|
+
*/
|
64
|
+
setupEditor() {
|
65
|
+
var element = $("[data-behavior='collection-form']");
|
66
|
+
if (element.length > 0) {
|
67
|
+
new Editor(element).init();
|
68
|
+
}
|
69
|
+
}
|
57
70
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Registry } from './registry'
|
2
2
|
import { UserControls } from './user_controls'
|
3
3
|
import { GroupControls } from './group_controls'
|
4
|
+
import VisibilityComponent from '../save_work/visibility_component'
|
4
5
|
|
5
6
|
export default class PermissionsControl {
|
6
7
|
/**
|
@@ -8,7 +9,8 @@ export default class PermissionsControl {
|
|
8
9
|
* @param {jQuery} element the jquery selector for the permissions container
|
9
10
|
* @param {String} template_id the identifier of the template for the added elements
|
10
11
|
*/
|
11
|
-
constructor(element, template_id) {
|
12
|
+
constructor(element, template_id, options = {}) {
|
13
|
+
const { with_visibility_component } = options
|
12
14
|
if (element.length === 0) {
|
13
15
|
return
|
14
16
|
}
|
@@ -17,6 +19,11 @@ export default class PermissionsControl {
|
|
17
19
|
this.registry = new Registry(this.element, this.object_name(), template_id)
|
18
20
|
this.user_controls = new UserControls(this.element, this.registry)
|
19
21
|
this.group_controls = new GroupControls(this.element, this.registry)
|
22
|
+
if (with_visibility_component) {
|
23
|
+
this.visibility_component = new VisibilityComponent(this.element)
|
24
|
+
} else {
|
25
|
+
this.visibility_component = null
|
26
|
+
}
|
20
27
|
}
|
21
28
|
|
22
29
|
// retrieve object_name the name of the object to create
|
@@ -15,8 +15,8 @@ module Hyrax
|
|
15
15
|
# Removes a single embargo
|
16
16
|
def destroy
|
17
17
|
Hyrax::Actors::EmbargoActor.new(curation_concern).destroy
|
18
|
-
flash[:notice] = curation_concern
|
19
|
-
if curation_concern.work? && curation_concern
|
18
|
+
flash[:notice] = embargo_history(curation_concern)
|
19
|
+
if curation_concern.work? && work_has_file_set_members?(curation_concern)
|
20
20
|
redirect_to confirm_permission_path
|
21
21
|
else
|
22
22
|
redirect_to edit_embargo_path
|
@@ -60,10 +60,19 @@ module Hyrax
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def edit
|
63
|
+
@curation_concern = Hyrax::Forms::WorkEmbargoForm.new(curation_concern).prepopulate! if
|
64
|
+
Hyrax.config.use_valkyrie?
|
63
65
|
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
64
66
|
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
65
67
|
add_breadcrumb t(:'hyrax.embargoes.index.manage_embargoes'), hyrax.embargoes_path
|
66
68
|
add_breadcrumb t(:'hyrax.embargoes.edit.embargo_update'), '#'
|
67
69
|
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def embargo_history(concern)
|
74
|
+
concern.try(:embargo_history) ||
|
75
|
+
concern.try(:embargo)&.embargo_history
|
76
|
+
end
|
68
77
|
end
|
69
78
|
end
|
@@ -15,8 +15,8 @@ module Hyrax
|
|
15
15
|
# Removes a single lease
|
16
16
|
def destroy
|
17
17
|
Hyrax::Actors::LeaseActor.new(curation_concern).destroy
|
18
|
-
flash[:notice] = curation_concern
|
19
|
-
if curation_concern.work? && curation_concern
|
18
|
+
flash[:notice] = lease_history(curation_concern)&.last
|
19
|
+
if curation_concern.work? && work_has_file_set_members?(curation_concern)
|
20
20
|
redirect_to confirm_permission_path
|
21
21
|
else
|
22
22
|
redirect_to edit_lease_path
|
@@ -51,10 +51,19 @@ module Hyrax
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def edit
|
54
|
+
@curation_concern = Hyrax::Forms::WorkLeaseForm.new(curation_concern).prepopulate! if
|
55
|
+
Hyrax.config.use_valkyrie?
|
54
56
|
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
55
57
|
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
56
58
|
add_breadcrumb t(:'hyrax.leases.index.manage_leases'), hyrax.leases_path
|
57
59
|
add_breadcrumb t(:'hyrax.leases.edit.lease_update'), '#'
|
58
60
|
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def lease_history(concern)
|
65
|
+
concern.try(:lease_history) ||
|
66
|
+
concern.try(:lease)&.lease_history
|
67
|
+
end
|
59
68
|
end
|
60
69
|
end
|
@@ -6,7 +6,8 @@ module Hyrax
|
|
6
6
|
included do
|
7
7
|
attr_accessor :curation_concern
|
8
8
|
helper_method :curation_concern
|
9
|
-
|
9
|
+
base_class = Hyrax.config.use_valkyrie? ? Hyrax::Resource : ActiveFedora::Base
|
10
|
+
load_and_authorize_resource class: base_class, instance_name: :curation_concern, except: [:index]
|
10
11
|
end
|
11
12
|
|
12
13
|
# This is an override of Hyrax::ApplicationController
|
@@ -15,5 +16,16 @@ module Hyrax
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def edit; end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def work_has_file_set_members?(work)
|
23
|
+
case work
|
24
|
+
when Valkyrie::Resource
|
25
|
+
Hyrax.custom_queries.find_child_file_set_ids(resource: work).any?
|
26
|
+
else
|
27
|
+
work.file_sets.present?
|
28
|
+
end
|
29
|
+
end
|
18
30
|
end
|
19
31
|
end
|