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
@@ -1,7 +1,80 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Hyrax
|
4
|
+
##
|
5
|
+
# Provides methods for dealing with versions of files across both ActiveFedora
|
6
|
+
# and Valkyrie.
|
7
|
+
#
|
8
|
+
# Note that many of the methods pertaining to version creation are currently
|
9
|
+
# implemented as static methods.
|
4
10
|
class VersioningService
|
11
|
+
##
|
12
|
+
# @!attribute [rw] resource
|
13
|
+
# @return [ActiveFedora::File | Hyrax::FileMetadata | NilClass]
|
14
|
+
attr_accessor :resource
|
15
|
+
|
16
|
+
##
|
17
|
+
# @!attribute [r] storage_adapter
|
18
|
+
# @return [#supports?]
|
19
|
+
attr_reader :storage_adapter
|
20
|
+
|
21
|
+
##
|
22
|
+
# @param resource [ActiveFedora::File | Hyrax::FileMetadata | NilClass]
|
23
|
+
def initialize(resource:, storage_adapter: Hyrax.storage_adapter)
|
24
|
+
@storage_adapter = storage_adapter
|
25
|
+
self.resource = resource
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Returns an array of versions for the resource associated with this
|
30
|
+
# Hyrax::VersioningService.
|
31
|
+
#
|
32
|
+
# If the resource is nil, or if it is a Hyrax::FileMetadata and versioning
|
33
|
+
# is not supported in the storage adapter, an empty array will be returned.
|
34
|
+
def versions
|
35
|
+
if resource.nil?
|
36
|
+
[]
|
37
|
+
elsif resource.is_a?(Hyrax::FileMetadata)
|
38
|
+
if storage_adapter.try(:"supports?", :versions)
|
39
|
+
storage_adapter.find_versions(id: resource.file_identifier).to_a
|
40
|
+
else
|
41
|
+
[]
|
42
|
+
end
|
43
|
+
else
|
44
|
+
resource.versions.all.to_a
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Returns the latest version of the file associated with this
|
50
|
+
# Hyrax::VersioningService.
|
51
|
+
def latest_version
|
52
|
+
versions.last
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Returns the file ID of the latest version of the file associated with this
|
57
|
+
# Hyrax::VersioningService, or the ID of the file resource itself if no
|
58
|
+
# latest version is defined.
|
59
|
+
#
|
60
|
+
# If the resource is nil, this method returns an empty string.
|
61
|
+
def versioned_file_id
|
62
|
+
latest = latest_version
|
63
|
+
if latest
|
64
|
+
if latest.respond_to?(:id)
|
65
|
+
latest.id
|
66
|
+
else
|
67
|
+
Hyrax.config.translate_uri_to_id.call(latest.uri)
|
68
|
+
end
|
69
|
+
elsif resource.nil?
|
70
|
+
""
|
71
|
+
elsif resource.is_a?(Hyrax::FileMetadata)
|
72
|
+
resource.file_identifier
|
73
|
+
else
|
74
|
+
resource.id
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
5
78
|
class << self
|
6
79
|
# Make a version and record the version committer
|
7
80
|
# @param [ActiveFedora::File | Hyrax::FileMetadata] content
|
@@ -11,19 +84,14 @@ module Hyrax
|
|
11
84
|
perform_create(content, user, use_valkyrie)
|
12
85
|
end
|
13
86
|
|
14
|
-
# @param [ActiveFedora::File | Hyrax::FileMetadata]
|
87
|
+
# @param [ActiveFedora::File | Hyrax::FileMetadata] file
|
15
88
|
def latest_version_of(file)
|
16
|
-
file.
|
89
|
+
Hyrax::VersioningService.new(resource: file).latest_version
|
17
90
|
end
|
18
91
|
|
19
|
-
# @param [ActiveFedora::File | Hyrax::FileMetadata]
|
92
|
+
# @param [ActiveFedora::File | Hyrax::FileMetadata] file
|
20
93
|
def versioned_file_id(file)
|
21
|
-
|
22
|
-
if versions.present?
|
23
|
-
Hyrax.config.translate_uri_to_id.call(versions.last.uri)
|
24
|
-
else
|
25
|
-
file.id
|
26
|
-
end
|
94
|
+
Hyrax::VersioningService.new(resource: file).versioned_file_id
|
27
95
|
end
|
28
96
|
|
29
97
|
# Record the version committer of the last version
|
@@ -15,13 +15,13 @@ module Hyrax
|
|
15
15
|
when Hyrax::Resource # Valkyrie
|
16
16
|
ResourceVisibilityPropagator.new(source: source)
|
17
17
|
else
|
18
|
-
|
18
|
+
NullVisibilityPropagator.new(source: source)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
##
|
23
|
-
# Provides a null/logging implementation of the visibility
|
24
|
-
class
|
23
|
+
# Provides a null/logging implementation of the visibility propagator.
|
24
|
+
class NullVisibilityPropagator
|
25
25
|
##
|
26
26
|
# @!attribute [rw] source
|
27
27
|
# @return [#visibility]
|
@@ -36,8 +36,8 @@ module Hyrax
|
|
36
36
|
##
|
37
37
|
# @return [void]
|
38
38
|
# @raise [RuntimeError] if we're in development mode
|
39
|
-
def
|
40
|
-
message = "Tried to
|
39
|
+
def propagate
|
40
|
+
message = "Tried to propagate visibility to members of #{source} " \
|
41
41
|
"but didn't know what kind of object it is. Model " \
|
42
42
|
"name #{source.try(:model_name)}. Called from #{caller[0]}."
|
43
43
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
# Responsible for retrieving information based on the given work.
|
4
|
+
#
|
5
|
+
# @see ProxyDepositRequest
|
6
|
+
# @see SolrDocument
|
7
|
+
# @see Hyrax::SolrService
|
8
|
+
# @note This was extracted from the ProxyDepositRequest, which was coordinating lots of effort. It was also an ActiveRecord object that required lots of Fedora/Solr interactions.
|
9
|
+
class WorkResourceQueryService
|
10
|
+
# @param [String] id - The id of the work
|
11
|
+
def initialize(id:)
|
12
|
+
@id = id
|
13
|
+
end
|
14
|
+
attr_reader :id
|
15
|
+
|
16
|
+
# @return [Boolean] if the work has been deleted
|
17
|
+
def deleted_work?
|
18
|
+
Hyrax.query_service.find_by(id: id)
|
19
|
+
false
|
20
|
+
rescue Valkyrie::Persistence::ObjectNotFoundError
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
def work
|
25
|
+
# Need to ensure it is a work?
|
26
|
+
resource = Hyrax.query_service.find_by(id: id)
|
27
|
+
raise ModelMismatchError, "Expected work but got #{resource.class}" unless resource.work?
|
28
|
+
resource
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
if deleted_work?
|
33
|
+
'work not found'
|
34
|
+
else
|
35
|
+
solr_doc.to_s
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def solr_doc
|
42
|
+
@solr_doc ||= ::SolrDocument.new(Hyrax::SolrService.search_by_id(id))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -128,16 +128,14 @@ module Hyrax
|
|
128
128
|
def call
|
129
129
|
self.errors = []
|
130
130
|
Array.wrap(data.fetch(:workflows)).map do |configuration|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
errors << error
|
138
|
-
end
|
139
|
-
Sipity::Workflow.find_by(name: configuration[:name])
|
131
|
+
find_or_create_from(configuration: configuration)
|
132
|
+
rescue InvalidStateRemovalException => e
|
133
|
+
e.states.each do |state|
|
134
|
+
error = I18n.t('hyrax.workflow.load.state_error', workflow_name: state.workflow.name, state_name: state.name, entity_count: state.entities.count)
|
135
|
+
Rails.logger.error(error)
|
136
|
+
errors << error
|
140
137
|
end
|
138
|
+
Sipity::Workflow.find_by(name: configuration[:name])
|
141
139
|
end
|
142
140
|
end
|
143
141
|
|
@@ -34,12 +34,10 @@ module Hyrax::Strategies
|
|
34
34
|
|
35
35
|
def yaml_file
|
36
36
|
@yaml_file ||=
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
{}
|
42
|
-
end
|
37
|
+
if File.exist?(@config_file)
|
38
|
+
YAML.load_file(@config_file)
|
39
|
+
else
|
40
|
+
{}
|
43
41
|
end
|
44
42
|
end
|
45
43
|
end
|
@@ -4,21 +4,21 @@ module Hyrax
|
|
4
4
|
# Override the directory where uploaded files will be stored.
|
5
5
|
# This is a sensible default for uploaders that are meant to be mounted:
|
6
6
|
def store_dir
|
7
|
-
configured_upload_path
|
7
|
+
(configured_upload_path / model.class.to_s.underscore / mounted_as.to_s / model.id.to_s).to_s
|
8
8
|
end
|
9
9
|
|
10
10
|
def cache_dir
|
11
|
-
configured_cache_path
|
11
|
+
(configured_cache_path / model.class.to_s.underscore / mounted_as.to_s / model.id.to_s).to_s
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def configured_upload_path
|
17
|
-
Hyrax.config.upload_path.call
|
17
|
+
Pathname.new(Hyrax.config.upload_path.call)
|
18
18
|
end
|
19
19
|
|
20
20
|
def configured_cache_path
|
21
|
-
Hyrax.config.cache_path.call
|
21
|
+
Pathname.new(Hyrax.config.cache_path.call)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
-
|
3
|
+
##
|
4
|
+
# Validates that the record passes the multiple membership requirements for collections.
|
4
5
|
class CollectionMembershipValidator < ActiveModel::Validator
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
##
|
7
|
+
# @param multiple_membership_checker
|
8
|
+
def initialize(multiple_membership_checker: Hyrax::MultipleMembershipChecker, **options)
|
9
|
+
@multiple_membership_checker = multiple_membership_checker
|
10
|
+
super(options)
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
def validate_multi_membership(record)
|
13
|
+
def validate(record)
|
15
14
|
# collections-in-collections do not have multi-membership restrictions
|
16
15
|
return true if record.is_a? Hyrax::Forms::PcdmCollectionForm
|
16
|
+
checker = @multiple_membership_checker.new(item: nil)
|
17
|
+
ids = collections_ids(record)
|
17
18
|
|
18
|
-
|
19
|
+
errors = Array(checker.check(collection_ids: ids))
|
20
|
+
record.errors[:member_of_collection_ids].concat(errors)
|
19
21
|
end
|
20
22
|
|
21
|
-
|
22
|
-
record.member_of_collection_ids = collections_ids(record)
|
23
|
-
record.member_of_collection_ids.uniq!
|
24
|
-
end
|
23
|
+
private
|
25
24
|
|
26
25
|
def collections_ids(record)
|
27
|
-
collection_ids =
|
26
|
+
collection_ids = record.member_of_collection_ids.reject(&:blank?)
|
27
|
+
|
28
28
|
if record.member_of_collections_attributes.present?
|
29
29
|
record.member_of_collections_attributes
|
30
30
|
.each do |_k, h|
|
@@ -32,6 +32,7 @@ module Hyrax
|
|
32
32
|
collection_ids << Valkyrie::ID.new(h["id"])
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
35
36
|
collection_ids
|
36
37
|
end
|
37
38
|
end
|
@@ -1,3 +1,10 @@
|
|
1
|
+
<% model = document.hydra_model %>
|
1
2
|
<div class="search-results-title-row">
|
2
|
-
|
3
|
+
<% if model == Hyrax::PcdmCollection || model < Hyrax::PcdmCollection %>
|
4
|
+
<h3 class="search-result-title"><%= link_to document.title_or_label, [hyrax, document] %></h3>
|
5
|
+
<%= Hyrax::CollectionPresenter.new(document, current_ability).collection_type_badge %>
|
6
|
+
<% else %>
|
7
|
+
<h3 class="search-result-title"><%= link_to document.title_or_label, document %></h3>
|
8
|
+
<% end %>
|
3
9
|
</div>
|
10
|
+
|
@@ -1,5 +1,10 @@
|
|
1
|
+
<% model = document.hydra_model %>
|
1
2
|
<div class="col-md-2">
|
2
|
-
<
|
3
|
-
<%= render_thumbnail_tag document %>
|
4
|
-
|
3
|
+
<% if model == Hyrax::PcdmCollection || model < Hyrax::PcdmCollection %>
|
4
|
+
<%= render_thumbnail_tag document, {}, suppress_link: true %>
|
5
|
+
<% else %>
|
6
|
+
<div class="list-thumbnail">
|
7
|
+
<%= render_thumbnail_tag document %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
5
10
|
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%= f.input key,
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
as: :multi_value,
|
3
|
+
input_html: {
|
4
|
+
class: 'form-control',
|
5
|
+
data: { 'autocomplete-url' => "/authorities/search/geonames",
|
6
|
+
'autocomplete' => key }
|
7
|
+
},
|
8
|
+
required: f.object.required?(key) %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<div class="set-access-controls list-group-item">
|
22
|
-
<%= render 'form_visibility_component', f: f %>
|
22
|
+
<%= render 'form_visibility_component', f: f, save_work: true %>
|
23
23
|
</div>
|
24
24
|
<% if Flipflop.proxy_deposit? && current_user.can_make_deposits_for.any? %>
|
25
25
|
<div class="list-group-item">
|
@@ -4,7 +4,11 @@
|
|
4
4
|
<%= render 'form_permission_under_lease', f: f %>
|
5
5
|
<% else %>
|
6
6
|
<fieldset>
|
7
|
-
|
7
|
+
<% if local_assigns[:save_work] %>
|
8
|
+
<legend class="legend-save-work"><%= t('.visibility') %></legend>
|
9
|
+
<% else %>
|
10
|
+
<legend><%= t('.visibility') %><%= raw(t('.subtitle_html')) %></legend>
|
11
|
+
<% end %>
|
8
12
|
<ul class="visibility">
|
9
13
|
<li class="radio">
|
10
14
|
<label>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
</ul>
|
25
25
|
|
26
|
-
<%= simple_form_for @form, url: [hyrax, :dashboard, @form], html: { class: 'editor nav-safety' } do |f| %>
|
26
|
+
<%= simple_form_for @form, url: [hyrax, :dashboard, @form], html: { class: 'editor nav-safety', data: { behavior: 'collection-form', 'param-key' => @form.model_name.param_key } } do |f| %>
|
27
27
|
<div class="tab-content">
|
28
28
|
<div id="description" class="tab-pane active">
|
29
29
|
<div class="panel panel-default labels">
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<% end %>
|
36
36
|
|
37
37
|
<% # TODO: Remove check for PcdmCollection when Issue #5286 is resolved. %>
|
38
|
-
<% if f.object.persisted? && Hyrax.config.collection_class
|
38
|
+
<% if f.object.persisted? && !(Hyrax.config.collection_class < Valkyrie::Resource) %>
|
39
39
|
<%# we're loading these values dynamically to speed page load %>
|
40
40
|
<%= f.input :thumbnail_id,
|
41
41
|
input_html: { data: { text: thumbnail_label_for(object: f.object) } } %>
|
@@ -116,3 +116,4 @@
|
|
116
116
|
<% end # simple_form_for %>
|
117
117
|
|
118
118
|
</div> <!-- end collection-controls -->
|
119
|
+
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<% end %>
|
33
33
|
<% end %>
|
34
34
|
|
35
|
-
<% if current_ability.can_create_any_work? %>
|
35
|
+
<% if current_ability.can_create_any_work? && Hyrax.config.analytics? %>
|
36
36
|
<li>
|
37
37
|
<%= menu.collapsable_section t('hyrax.admin.sidebar.analytics'),
|
38
38
|
icon_class: "fa fa-pie-chart",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<fieldset class="set-access-controls">
|
14
14
|
<section class="help-block">
|
15
15
|
<p>
|
16
|
-
<% if curation_concern
|
16
|
+
<% if embargo_enforced?(curation_concern) %>
|
17
17
|
<%= t('.embargo_true_html', cc: cc_type) %>
|
18
18
|
<% else %>
|
19
19
|
<%= t('.embargo_false_html', cc: cc_type) %>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
<div class="row">
|
31
31
|
<div class="col-md-12 form-actions">
|
32
|
-
<% if curation_concern
|
32
|
+
<% if embargo_enforced?(curation_concern) %>
|
33
33
|
<%= f.submit t('.embargo_update'), class: 'btn btn-primary' %>
|
34
34
|
<%= link_to t('.embargo_deactivate'), embargo_path(curation_concern), method: :delete, class: 'btn btn-danger' %>
|
35
35
|
<% else %>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
<h2 class="panel-title"><%= t('.header.past') %></h2>
|
49
49
|
</div>
|
50
50
|
<div class="panel-body">
|
51
|
-
<% if curation_concern.
|
51
|
+
<% if embargo_history(curation_concern).empty? %>
|
52
52
|
<%= t('.history_empty', cc: cc_type) %>
|
53
53
|
<% else %>
|
54
54
|
<%= render partial: "embargo_history", object: curation_concern.embargo_history %>
|
@@ -1,8 +1,3 @@
|
|
1
|
-
<% depositor = f.object.depositor %>
|
2
|
-
<% public_perm = f.object.permissions.map { |perm| perm.access if perm.agent_name == "public"}.compact.first %>
|
3
|
-
<% public_perm = true if params[:controller] == 'batch' %>
|
4
|
-
<% registered_perm = f.object.permissions.map { |perm| perm.access if perm.agent_name == "registered"}.compact.first %>
|
5
|
-
|
6
1
|
<h2 id="permissions_display"><% if params[:controller] == 'batch' %><%= t('.bulk') %> <% end %><%= t('.header') %> <% if params[:controller] == 'batch' %>
|
7
2
|
<small><%= t('.applied_to') %></small><% end %>
|
8
3
|
</h2>
|
@@ -13,7 +8,7 @@
|
|
13
8
|
<span id="permissions_error_text"></span>
|
14
9
|
</div>
|
15
10
|
|
16
|
-
<%= render 'hyrax/base/
|
11
|
+
<%= render 'hyrax/base/form_visibility_component', f: f %>
|
17
12
|
|
18
13
|
<!-- Share With -->
|
19
14
|
<div class="row">
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<div class="row">
|
8
8
|
<div class="col-xs-12 col-sm-4">
|
9
|
-
<%= render media_display_partial(
|
9
|
+
<%= render media_display_partial(@presenter.solr_document), file_set: @presenter.solr_document %>
|
10
10
|
</div>
|
11
11
|
<div class="col-xs-12 col-sm-8">
|
12
12
|
<div class="panel panel-default tabs">
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<h2><%= t('.descriptions') %></h2>
|
28
28
|
<%= render "form" %>
|
29
29
|
</div>
|
30
|
-
<%= render "permission", file_set: curation_concern %>
|
30
|
+
<%= render "permission", file_set: curation_concern, form_object: @form %>
|
31
31
|
<%= render "versioning", file_set: curation_concern %>
|
32
32
|
</div>
|
33
33
|
</div>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<fieldset class="set-access-controls">
|
14
14
|
<section class="help-block">
|
15
15
|
<p>
|
16
|
-
<% if curation_concern
|
16
|
+
<% if lease_enforced?(curation_concern) %>
|
17
17
|
<%= t('.lease_true_html', cc: cc_type) %>
|
18
18
|
<% else %>
|
19
19
|
<%= t('.lease_false_html', cc: cc_type) %>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
<div class="row">
|
31
31
|
<div class="col-md-12 form-actions">
|
32
|
-
<% if curation_concern
|
32
|
+
<% if lease_enforced?(curation_concern) %>
|
33
33
|
<%= f.submit t('.lease_update'), class: 'btn btn-primary' %>
|
34
34
|
<%= link_to t('.lease_deactivate'), lease_path(curation_concern), method: :delete, class: 'btn btn-danger' %>
|
35
35
|
<% else %>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
<h2 class="panel-title"><%= t('.header.past') %></h2>
|
49
49
|
</div>
|
50
50
|
<div class="panel-body">
|
51
|
-
<% if curation_concern.
|
51
|
+
<% if lease_history(curation_concern).empty? %>
|
52
52
|
<%= t('.history_empty', cc: cc_type) %>
|
53
53
|
<% else %>
|
54
54
|
<%= render partial: 'lease_history', object: curation_concern.lease_history %>
|
@@ -1,6 +1,11 @@
|
|
1
1
|
<ul class="nav nav-tabs" id="my_nav" role="list">
|
2
2
|
<li<%= ' class="active"'.html_safe if current_page?(hyrax.dashboard_works_path(locale: nil)) %>>
|
3
|
-
|
3
|
+
<% if params[:add_works_to_collection].present? && params[:add_works_to_collection_label].present? %>
|
4
|
+
<%= link_to t("hyrax.dashboard.#{current_ability.admin? ? 'all' : 'managed'}.works"), hyrax.dashboard_works_path(add_works_to_collection: params[:add_works_to_collection], add_works_to_collection_label: params[:add_works_to_collection_label]) %>
|
5
|
+
<% else %>
|
6
|
+
<%= link_to t("hyrax.dashboard.#{current_ability.admin? ? 'all' : 'managed'}.works"), hyrax.dashboard_works_path %>
|
7
|
+
<% end %>
|
8
|
+
|
4
9
|
</li>
|
5
10
|
<li<%= ' class="active"'.html_safe if current_page?(hyrax.my_works_path(locale: nil)) %>>
|
6
11
|
<%= link_to t('hyrax.dashboard.my.your_works'), hyrax.my_works_path %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<span class="sr-only"><%= t(:'.sr_only_description', work_title: @proxy_deposit_request.to_s) %></span>
|
6
6
|
|
7
7
|
<%= simple_form_for @proxy_deposit_request,
|
8
|
-
url: hyrax.work_transfers_path(
|
8
|
+
url: hyrax.work_transfers_path(params[:id]) do |f| %>
|
9
9
|
<%= f.input :transfer_to,
|
10
10
|
placeholder: t(:'.placeholder') %>
|
11
11
|
<%= f.input :sender_comment %>
|
data/chart/hyrax/Chart.yaml
CHANGED
@@ -2,7 +2,7 @@ apiVersion: v2
|
|
2
2
|
name: hyrax
|
3
3
|
description: An open-source, Samvera-powered digital repository system
|
4
4
|
type: application
|
5
|
-
version: 1.1
|
5
|
+
version: 1.5.1
|
6
6
|
appVersion: 3.3.0
|
7
7
|
dependencies:
|
8
8
|
- name: fcrepo
|
@@ -11,21 +11,25 @@ dependencies:
|
|
11
11
|
condition: fcrepo.enabled
|
12
12
|
- name: memcached
|
13
13
|
version: 4.2.21
|
14
|
-
repository: https://
|
14
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
15
15
|
condition: memcached.enabled
|
16
16
|
- name: minio
|
17
17
|
version: 6.7.2
|
18
|
-
repository: https://
|
18
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
19
19
|
condition: minio.enabled
|
20
20
|
- name: postgresql
|
21
21
|
version: 10.3.13
|
22
|
-
repository: https://
|
22
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
23
23
|
condition: postgresql.enabled
|
24
24
|
- name: redis
|
25
25
|
version: 10.7.16
|
26
|
-
repository: https://
|
26
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
27
27
|
condition: redis.enabled
|
28
28
|
- name: solr
|
29
29
|
version: 1.0.1
|
30
|
-
repository: https://
|
30
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
31
31
|
condition: solr.enabled
|
32
|
+
- name: nginx
|
33
|
+
version: 9.8.0
|
34
|
+
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
35
|
+
condition: nginx.enabled
|
@@ -179,6 +179,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
|
179
179
|
{{- printf "redis://:%s@%s:%s" .Values.redis.password (include "hyrax.redis.host" .) "6379/0" -}}
|
180
180
|
{{- end -}}
|
181
181
|
|
182
|
+
{{- define "hyrax.nginx.host" -}}
|
183
|
+
{{- printf "%s-%s" .Release.Name "nginx" | trunc 63 | trimSuffix "-" -}}
|
184
|
+
{{- end -}}
|
185
|
+
|
182
186
|
{{- define "hyrax.sharedPvcAccessModes" -}}
|
183
187
|
{{- if .Values.worker.enabled }}
|
184
188
|
accessModes:
|
@@ -64,6 +64,17 @@ spec:
|
|
64
64
|
{{- end }}
|
65
65
|
env:
|
66
66
|
{{- toYaml .Values.worker.extraEnvVars | nindent 12 }}
|
67
|
+
{{- if .Values.worker.readinessProbe.enabled }}
|
68
|
+
readinessProbe:
|
69
|
+
exec:
|
70
|
+
command:
|
71
|
+
{{- toYaml .Values.worker.readinessProbe.command | nindent 16 }}
|
72
|
+
failureThreshold: {{ .Values.worker.readinessProbe.failureThreshold }}
|
73
|
+
initialDelaySeconds: {{ .Values.worker.readinessProbe.initialDelaySeconds }}
|
74
|
+
periodSeconds: {{ .Values.worker.readinessProbe.periodSeconds }}
|
75
|
+
successThreshold: {{ .Values.worker.readinessProbe.successThreshold }}
|
76
|
+
timeoutSeconds: {{ .Values.worker.readinessProbe.timeoutSeconds }}
|
77
|
+
{{- end }}
|
67
78
|
volumeMounts:
|
68
79
|
- name: derivatives
|
69
80
|
mountPath: /app/samvera/derivatives
|