hyrax 3.0.0.pre.beta1 → 3.0.0.pre.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +157 -68
- data/.travis.yml +4 -1
- data/Gemfile +1 -0
- data/README.md +3 -3
- data/app/actors/hyrax/actors/collections_membership_actor.rb +5 -55
- data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +6 -8
- data/app/actors/hyrax/actors/environment.rb +15 -0
- data/app/actors/hyrax/actors/interpret_visibility_actor.rb +22 -37
- data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +1 -1
- data/app/assets/stylesheets/hyrax/_collections.scss +5 -3
- data/app/assets/stylesheets/hyrax/dashboard.scss +3 -3
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +21 -2
- data/app/controllers/hyrax/homepage_controller.rb +1 -1
- data/app/forms/hyrax/forms/work_form.rb +1 -1
- data/app/helpers/hyrax/collections_helper.rb +13 -0
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +3 -3
- data/app/indexers/hyrax/admin_set_indexer.rb +1 -1
- data/app/indexers/hyrax/basic_metadata_indexer.rb +1 -1
- data/app/indexers/hyrax/collection_indexer.rb +3 -3
- data/app/indexers/hyrax/deep_indexing_service.rb +12 -12
- data/app/indexers/hyrax/file_set_indexer.rb +1 -1
- data/app/indexers/hyrax/indexes_workflow.rb +4 -4
- data/app/indexers/hyrax/work_indexer.rb +1 -1
- data/app/models/concerns/hyrax/basic_metadata.rb +2 -0
- data/app/models/concerns/hyrax/collection_behavior.rb +3 -3
- data/app/models/concerns/hyrax/file_set/querying.rb +1 -1
- data/app/models/concerns/hyrax/human_readable_type.rb +2 -2
- data/app/models/concerns/hyrax/solr_document/characterization.rb +23 -23
- data/app/models/concerns/hyrax/solr_document/metadata.rb +3 -2
- data/app/models/concerns/hyrax/solr_document_behavior.rb +3 -3
- data/app/models/concerns/hyrax/user.rb +10 -2
- data/app/presenters/hyrax/work_show_presenter.rb +2 -2
- data/app/renderers/hyrax/renderers/faceted_attribute_renderer.rb +1 -1
- data/app/search_builders/hyrax/collection_search_builder.rb +1 -1
- data/app/search_builders/hyrax/deposit_search_builder.rb +1 -1
- data/app/search_builders/hyrax/embargo_search_builder.rb +1 -1
- data/app/search_builders/hyrax/lease_search_builder.rb +1 -1
- data/app/services/hyrax/default_middleware_stack.rb +0 -4
- data/app/services/hyrax/statistics/file_sets/by_format.rb +1 -1
- data/app/services/hyrax/statistics/works/by_resource_type.rb +1 -1
- data/app/services/hyrax/visibility_intention.rb +78 -0
- data/app/views/catalog/_index_list_default.html.erb +3 -3
- data/app/views/catalog/_thumbnail_list_collection.html.erb +3 -2
- data/app/views/hyrax/base/_attribute_rows.html.erb +1 -0
- data/app/views/hyrax/base/_form_files.html.erb +2 -2
- data/app/views/hyrax/base/_form_visibility_component.html.erb +1 -1
- data/app/views/hyrax/base/_show_actions.html.erb +6 -6
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_edits/_check_all.html.erb +1 -1
- data/app/views/hyrax/batch_edits/_delete_selected.html.erb +1 -1
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +1 -1
- data/app/views/hyrax/dashboard/show_admin.html.erb +4 -4
- data/app/views/records/show_fields/_based_near.html.erb +1 -1
- data/app/views/records/show_fields/_creator.html.erb +1 -1
- data/app/views/records/show_fields/_keyword.html.erb +1 -1
- data/app/views/records/show_fields/_language.html.erb +1 -1
- data/app/views/records/show_fields/_publisher.html.erb +1 -1
- data/app/views/records/show_fields/_resource_type.html.erb +1 -1
- data/app/views/records/show_fields/_subject.html.erb +1 -1
- data/config/initializers/samvera-nesting_indexer_initializer.rb +3 -3
- data/config/locales/hyrax.de.yml +35 -22
- data/config/locales/hyrax.en.yml +22 -2
- data/config/locales/hyrax.es.yml +21 -1
- data/config/locales/hyrax.fr.yml +21 -1
- data/config/locales/hyrax.it.yml +21 -1
- data/config/locales/hyrax.pt-BR.yml +21 -1
- data/config/locales/hyrax.zh.yml +21 -1
- data/hyrax.gemspec +7 -9
- data/lib/generators/hyrax/templates/catalog_controller.rb +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +10 -10
- data/lib/generators/hyrax/work/templates/locale.pt-BR.yml.erb +1 -1
- data/lib/hyrax/configuration.rb +18 -0
- data/lib/hyrax/engine.rb +8 -0
- data/lib/hyrax/transactions/container.rb +6 -0
- data/lib/hyrax/transactions/destroy_work.rb +21 -0
- data/lib/hyrax/transactions/steps/destroy_work.rb +24 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/wings.rb +45 -0
- data/lib/wings/active_fedora_converter.rb +56 -0
- data/lib/wings/model_transformer.rb +158 -0
- data/lib/wings/resource_factory.rb +8 -0
- data/lib/wings/valkyrie/metadata_adapter.rb +29 -0
- data/lib/wings/valkyrie/persister.rb +50 -0
- data/lib/wings/valkyrie/query_service.rb +43 -0
- data/lib/wings/valkyrie/resource_factory.rb +45 -0
- data/lib/wings/valkyrizable.rb +24 -0
- data/lib/wings/value_mapper.rb +59 -0
- data/spec/abilities/collection_ability_spec.rb +5 -5
- data/spec/abilities/permission_template_ability_spec.rb +1 -1
- data/spec/actors/hyrax/actors/collections_membership_actor_spec.rb +6 -175
- data/spec/actors/hyrax/actors/create_with_remote_files_ordered_members_actor_spec.rb +30 -22
- data/spec/actors/hyrax/actors/interpret_visibility_actor_spec.rb +2 -0
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +9 -9
- data/spec/controllers/hyrax/collections_controller_spec.rb +5 -5
- data/spec/controllers/hyrax/dashboard/collection_members_controller_spec.rb +16 -13
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +9 -9
- data/spec/controllers/hyrax/dashboard/nest_collections_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +10 -1
- data/spec/controllers/hyrax/homepage_controller_spec.rb +3 -3
- data/spec/controllers/hyrax/my/shares_controller_spec.rb +1 -1
- data/spec/features/actor_stack_spec.rb +48 -0
- data/spec/features/catalog_search_spec.rb +2 -2
- data/spec/features/collection_multi_membership_spec.rb +2 -2
- data/spec/features/collection_spec.rb +7 -7
- data/spec/features/collection_type_spec.rb +2 -2
- data/spec/features/dashboard/collection_spec.rb +18 -18
- data/spec/features/delete_work_spec.rb +1 -1
- data/spec/features/search_spec.rb +2 -2
- data/spec/features/work_show_spec.rb +5 -2
- data/spec/forms/hyrax/forms/batch_upload_form_spec.rb +1 -0
- data/spec/forms/hyrax/forms/collection_form_spec.rb +5 -5
- data/spec/forms/hyrax/forms/permission_template_form_spec.rb +1 -1
- data/spec/forms/hyrax/forms/work_form_spec.rb +2 -0
- data/spec/helpers/blacklight_helper_spec.rb +3 -1
- data/spec/helpers/hyrax/collections_helper_spec.rb +42 -0
- data/spec/helpers/hyrax/dashboard_helper_behavior_spec.rb +4 -4
- data/spec/helpers/hyrax_helper_spec.rb +8 -4
- data/spec/hyrax/transactions/destroy_work_spec.rb +35 -0
- data/spec/hyrax/transactions/steps/destroy_work_spec.rb +33 -0
- data/spec/indexers/hyrax/collection_indexer_spec.rb +1 -1
- data/spec/jobs/characterize_job_spec.rb +1 -1
- data/spec/lib/hyrax/resource_sync/change_list_writer_spec.rb +35 -21
- data/spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb +1 -1
- data/spec/models/collection_spec.rb +18 -18
- data/spec/models/concerns/hyrax/collection_nesting_spec.rb +2 -2
- data/spec/models/file_set_spec.rb +2 -2
- data/spec/models/hyrax/collection_type_spec.rb +2 -2
- data/spec/models/user_spec.rb +26 -1
- data/spec/presenters/hyrax/collection_presenter_spec.rb +11 -11
- data/spec/presenters/hyrax/work_show_presenter_spec.rb +11 -0
- data/spec/search_builders/hyrax/collection_member_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/collection_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/dashboard/nested_collections_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/work_relation_spec.rb +1 -1
- data/spec/services/hyrax/adapters/nesting_index_adapter_spec.rb +2 -2
- data/spec/services/hyrax/collections/collection_member_service_spec.rb +2 -2
- data/spec/services/hyrax/collections/migration_service_spec.rb +27 -27
- data/spec/services/hyrax/collections/nested_collection_persistence_service_spec.rb +1 -1
- data/spec/services/hyrax/collections/nested_collection_query_service_spec.rb +38 -38
- data/spec/services/hyrax/curation_concern_spec.rb +1 -1
- data/spec/services/hyrax/default_middleware_stack_spec.rb +1 -2
- data/spec/services/hyrax/statistics/depositors/summary_spec.rb +1 -1
- data/spec/services/hyrax/statistics/works/by_resource_type_spec.rb +11 -4
- data/spec/services/hyrax/visibility_intention_spec.rb +144 -0
- data/spec/services/hyrax/workflow/changes_required_notification_spec.rb +1 -1
- data/spec/spec_helper.rb +10 -8
- data/spec/support/selectors.rb +10 -1
- data/spec/test_app_templates/Gemfile.extra +2 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +6 -0
- data/spec/views/catalog/_index_list_default.html.erb_spec.rb +3 -2
- data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +38 -5
- data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +9 -9
- data/spec/views/hyrax/base/show.html.erb_spec.rb +3 -2
- data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +3 -2
- data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +3 -2
- data/spec/wings/active_fedora_converter_spec.rb +31 -0
- data/spec/wings/model_transformer_spec.rb +288 -0
- data/spec/wings/valkyrie/metadata_adapter_spec.rb +10 -0
- data/spec/wings/valkyrie/persister_spec.rb +71 -0
- data/spec/wings/valkyrie/query_service_spec.rb +81 -0
- data/spec/wings/valkyrie/resource_factory_spec.rb +32 -0
- data/spec/wings/value_mapper_spec.rb +60 -0
- data/spec/wings_spec.rb +8 -0
- data/template.rb +3 -1
- metadata +86 -36
|
@@ -3,27 +3,27 @@ module Hyrax
|
|
|
3
3
|
# TODO: aside from height and width, I don't think any of these other terms are indexed by default. - Justin 3/2016
|
|
4
4
|
module Characterization
|
|
5
5
|
def byte_order
|
|
6
|
-
self[
|
|
6
|
+
self[ActiveFedora.index_field_mapper.solr_name("byte_order")]
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def capture_device
|
|
10
|
-
self[
|
|
10
|
+
self[ActiveFedora.index_field_mapper.solr_name("capture_device")]
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def color_map
|
|
14
|
-
self[
|
|
14
|
+
self[ActiveFedora.index_field_mapper.solr_name("color_map")]
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def color_space
|
|
18
|
-
self[
|
|
18
|
+
self[ActiveFedora.index_field_mapper.solr_name("color_space")]
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def compression
|
|
22
|
-
self[
|
|
22
|
+
self[ActiveFedora.index_field_mapper.solr_name("compression")]
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def gps_timestamp
|
|
26
|
-
self[
|
|
26
|
+
self[ActiveFedora.index_field_mapper.solr_name("gps_timestamp")]
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def height
|
|
@@ -31,31 +31,31 @@ module Hyrax
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def image_producer
|
|
34
|
-
self[
|
|
34
|
+
self[ActiveFedora.index_field_mapper.solr_name("image_producer")]
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def latitude
|
|
38
|
-
self[
|
|
38
|
+
self[ActiveFedora.index_field_mapper.solr_name("latitude")]
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def longitude
|
|
42
|
-
self[
|
|
42
|
+
self[ActiveFedora.index_field_mapper.solr_name("longitude")]
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def orientation
|
|
46
|
-
self[
|
|
46
|
+
self[ActiveFedora.index_field_mapper.solr_name("orientation")]
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def profile_name
|
|
50
|
-
self[
|
|
50
|
+
self[ActiveFedora.index_field_mapper.solr_name("profile_name")]
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def profile_version
|
|
54
|
-
self[
|
|
54
|
+
self[ActiveFedora.index_field_mapper.solr_name("profile_version")]
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def scanning_software
|
|
58
|
-
self[
|
|
58
|
+
self[ActiveFedora.index_field_mapper.solr_name("scanning_software")]
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def width
|
|
@@ -63,43 +63,43 @@ module Hyrax
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def format_label
|
|
66
|
-
self[
|
|
66
|
+
self[ActiveFedora.index_field_mapper.solr_name("format_label")]
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def file_size
|
|
70
|
-
self[
|
|
70
|
+
self[ActiveFedora.index_field_mapper.solr_name("file_size")]
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
def filename
|
|
74
|
-
self[
|
|
74
|
+
self[ActiveFedora.index_field_mapper.solr_name("filename")]
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def well_formed
|
|
78
|
-
self[
|
|
78
|
+
self[ActiveFedora.index_field_mapper.solr_name("well_formed")]
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def page_count
|
|
82
|
-
self[
|
|
82
|
+
self[ActiveFedora.index_field_mapper.solr_name("page_count")]
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def file_title
|
|
86
|
-
self[
|
|
86
|
+
self[ActiveFedora.index_field_mapper.solr_name("file_title")]
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def duration
|
|
90
|
-
self[
|
|
90
|
+
self[ActiveFedora.index_field_mapper.solr_name("duration")]
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def sample_rate
|
|
94
|
-
self[
|
|
94
|
+
self[ActiveFedora.index_field_mapper.solr_name("sample_rate")]
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def last_modified
|
|
98
|
-
self[
|
|
98
|
+
self[ActiveFedora.index_field_mapper.solr_name("last_modified")]
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def original_checksum
|
|
102
|
-
self[
|
|
102
|
+
self[ActiveFedora.index_field_mapper.solr_name("original_checksum")]
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
end
|
|
@@ -10,7 +10,7 @@ module Hyrax
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def solr_name(*args)
|
|
13
|
-
|
|
13
|
+
ActiveFedora.index_field_mapper.solr_name(*args)
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -66,6 +66,7 @@ module Hyrax
|
|
|
66
66
|
attribute :source, Solr::Array, solr_name('source')
|
|
67
67
|
attribute :date_created, Solr::Array, solr_name('date_created')
|
|
68
68
|
attribute :rights_statement, Solr::Array, solr_name('rights_statement')
|
|
69
|
+
attribute :rights_notes, Solr::Array, solr_name('rights_notes')
|
|
69
70
|
|
|
70
71
|
attribute :mime_type, Solr::String, solr_name('mime_type', :stored_sortable)
|
|
71
72
|
attribute :workflow_state, Solr::String, solr_name('workflow_state_name', :symbol)
|
|
@@ -77,7 +78,7 @@ module Hyrax
|
|
|
77
78
|
attribute :thumbnail_path, Solr::String, CatalogController.blacklight_config.index.thumbnail_field
|
|
78
79
|
attribute :label, Solr::String, solr_name('label')
|
|
79
80
|
attribute :file_format, Solr::String, solr_name('file_format')
|
|
80
|
-
attribute :suppressed?, Solr::String, solr_name('suppressed',
|
|
81
|
+
attribute :suppressed?, Solr::String, solr_name('suppressed', ActiveFedora::Indexing::Descriptor.new(:boolean, :stored, :indexed))
|
|
81
82
|
|
|
82
83
|
attribute :date_modified, Solr::Date, solr_name('date_modified', :stored_sortable, type: :date)
|
|
83
84
|
attribute :date_uploaded, Solr::Date, solr_name('date_uploaded', :stored_sortable, type: :date)
|
|
@@ -71,11 +71,11 @@ module Hyrax
|
|
|
71
71
|
|
|
72
72
|
# Method to return the ActiveFedora model
|
|
73
73
|
def hydra_model
|
|
74
|
-
first(
|
|
74
|
+
first(ActiveFedora.index_field_mapper.solr_name('has_model', :symbol)).constantize
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def depositor(default = '')
|
|
78
|
-
val = first(
|
|
78
|
+
val = first(ActiveFedora.index_field_mapper.solr_name('depositor'))
|
|
79
79
|
val.present? ? val : default
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -85,7 +85,7 @@ module Hyrax
|
|
|
85
85
|
else
|
|
86
86
|
:stored_searchable
|
|
87
87
|
end
|
|
88
|
-
fetch(
|
|
88
|
+
fetch(ActiveFedora.index_field_mapper.solr_name('creator', descriptor), [])
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
def visibility
|
|
@@ -30,7 +30,7 @@ module Hyrax::User
|
|
|
30
30
|
|
|
31
31
|
scope :guests, ->() { where(guest: true) }
|
|
32
32
|
scope :registered, ->() { where(guest: false) }
|
|
33
|
-
scope :without_system_accounts, -> { where("#{
|
|
33
|
+
scope :without_system_accounts, -> { where("#{::User.user_key_field} not in (?)", [::User.batch_user_key, ::User.audit_user_key]) }
|
|
34
34
|
|
|
35
35
|
# Validate and normalize ORCIDs
|
|
36
36
|
validates_with OrcidValidator
|
|
@@ -48,6 +48,10 @@ module Hyrax::User
|
|
|
48
48
|
has_one :sipity_agent, as: :proxy_for, dependent: :destroy, class_name: 'Sipity::Agent'
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def user_key
|
|
52
|
+
public_send(self.class.user_key_field)
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
# Look for, in order:
|
|
52
56
|
# A cached version of the agent
|
|
53
57
|
# A non-cached version (direct read of the database)
|
|
@@ -149,6 +153,10 @@ module Hyrax::User
|
|
|
149
153
|
Hyrax.config.audit_user_key
|
|
150
154
|
end
|
|
151
155
|
|
|
156
|
+
def user_key_field
|
|
157
|
+
Hydra.config.user_key_field
|
|
158
|
+
end
|
|
159
|
+
|
|
152
160
|
# Override this method if you aren't using email/password
|
|
153
161
|
def batch_user
|
|
154
162
|
find_or_create_system_user(batch_user_key)
|
|
@@ -159,7 +167,7 @@ module Hyrax::User
|
|
|
159
167
|
end
|
|
160
168
|
|
|
161
169
|
def find_or_create_system_user(user_key)
|
|
162
|
-
User.find_by_user_key(user_key) || User.create!(
|
|
170
|
+
User.find_by_user_key(user_key) || User.create!(user_key_field => user_key, password: Devise.friendly_token[0, 20])
|
|
163
171
|
end
|
|
164
172
|
|
|
165
173
|
def from_url_component(component)
|
|
@@ -15,7 +15,7 @@ module Hyrax
|
|
|
15
15
|
|
|
16
16
|
# delegate fields from Hyrax::Works::Metadata to solr_document
|
|
17
17
|
delegate :based_near_label, :related_url, :depositor, :identifier, :resource_type,
|
|
18
|
-
:keyword, :itemtype, :admin_set, to: :solr_document
|
|
18
|
+
:keyword, :itemtype, :admin_set, :rights_notes, to: :solr_document
|
|
19
19
|
|
|
20
20
|
# @param [SolrDocument] solr_document
|
|
21
21
|
# @param [Ability] current_ability
|
|
@@ -218,7 +218,7 @@ module Hyrax
|
|
|
218
218
|
Hyrax.config.iiif_metadata_fields.each do |field|
|
|
219
219
|
metadata << {
|
|
220
220
|
'label' => I18n.t("simple_form.labels.defaults.#{field}"),
|
|
221
|
-
'value' => Array.wrap(send(field))
|
|
221
|
+
'value' => Array.wrap(send(field).map { |f| Loofah.fragment(f.to_s).scrub!(:whitewash).to_s })
|
|
222
222
|
}
|
|
223
223
|
end
|
|
224
224
|
metadata
|
|
@@ -12,7 +12,7 @@ module Hyrax
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def search_field
|
|
15
|
-
ERB::Util.h(
|
|
15
|
+
ERB::Util.h(ActiveFedora.index_field_mapper.solr_name(options.fetch(:search_field, field), :facetable, type: :string))
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -19,7 +19,7 @@ module Hyrax
|
|
|
19
19
|
|
|
20
20
|
# @return [String] Solr field name indicating default sort order
|
|
21
21
|
def sort_field
|
|
22
|
-
|
|
22
|
+
ActiveFedora.index_field_mapper.solr_name('title', :sortable)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# This overrides the models in FilterByType
|
|
@@ -3,10 +3,6 @@ module Hyrax
|
|
|
3
3
|
# rubocop:disable Metrics/MethodLength
|
|
4
4
|
def self.build_stack
|
|
5
5
|
ActionDispatch::MiddlewareStack.new.tap do |middleware|
|
|
6
|
-
# Wrap everything in a database transaction, if the save of the resource
|
|
7
|
-
# fails then roll back any database AdminSetChangeSet
|
|
8
|
-
middleware.use Hyrax::Actors::TransactionalRequest
|
|
9
|
-
|
|
10
6
|
# Ensure you are mutating the most recent version
|
|
11
7
|
middleware.use Hyrax::Actors::OptimisticLockValidator
|
|
12
8
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Hyrax
|
|
3
|
+
##
|
|
4
|
+
# Provides tools for interpreting form input as a visibility.
|
|
5
|
+
#
|
|
6
|
+
# @since 3.0.0
|
|
7
|
+
class VisibilityIntention
|
|
8
|
+
PUBLIC = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
|
9
|
+
PRIVATE = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
|
10
|
+
LEASE_REQUEST = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE
|
|
11
|
+
EMBARGO_REQUEST = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
# @!attribute [rw] after
|
|
15
|
+
# @return [String] the visibility requested after the embargo/lease release
|
|
16
|
+
# @!attribute [rw] during
|
|
17
|
+
# @return [String] the visibility requested while the embargo/lease is in effect
|
|
18
|
+
# @!attribute [rw] release_date
|
|
19
|
+
# @return [String]
|
|
20
|
+
# @!attribute [rw] visibility
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :after, :during, :release_date, :visibility
|
|
23
|
+
|
|
24
|
+
##
|
|
25
|
+
# @param [String] after
|
|
26
|
+
# @param [String] during
|
|
27
|
+
# @param [String] release_date
|
|
28
|
+
# @param [String] visibility
|
|
29
|
+
def initialize(visibility: PRIVATE, release_date: nil, during: nil, after: nil)
|
|
30
|
+
self.after = after
|
|
31
|
+
self.during = during
|
|
32
|
+
self.release_date = release_date
|
|
33
|
+
self.visibility = visibility
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
##
|
|
37
|
+
# @return [Array] the parameters for the requested embargo
|
|
38
|
+
def embargo_params
|
|
39
|
+
return [] unless wants_embargo?
|
|
40
|
+
raise ArgumentError unless valid_embargo?
|
|
41
|
+
|
|
42
|
+
[release_date, (during || PRIVATE), (after || PUBLIC)]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
# @return [Array] the parameters for the requested embargo
|
|
47
|
+
def lease_params
|
|
48
|
+
return [] unless wants_lease?
|
|
49
|
+
raise ArgumentError unless valid_lease?
|
|
50
|
+
|
|
51
|
+
[release_date, (during || PUBLIC), (after || PRIVATE)]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
##
|
|
55
|
+
# @return [Boolean]
|
|
56
|
+
def valid_embargo?
|
|
57
|
+
wants_embargo? && release_date.present?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
##
|
|
61
|
+
# @return [Boolean]
|
|
62
|
+
def wants_embargo?
|
|
63
|
+
visibility == EMBARGO_REQUEST
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
##
|
|
67
|
+
# @return [Boolean]
|
|
68
|
+
def valid_lease?
|
|
69
|
+
wants_lease? && release_date.present?
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
##
|
|
73
|
+
# @return [Boolean]
|
|
74
|
+
def wants_lease?
|
|
75
|
+
visibility == LEASE_REQUEST
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
<% index_fields(document).each do |field_name, field| -%>
|
|
6
6
|
<% if should_render_index_field? document, field %>
|
|
7
7
|
<dt><%= render_index_field_label document, field: field_name %></dt>
|
|
8
|
-
<dd><%= doc_presenter.field_value
|
|
8
|
+
<dd><%= doc_presenter.field_value field %></dd>
|
|
9
9
|
<% end %>
|
|
10
10
|
<% end %>
|
|
11
11
|
</dl>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
|
-
<% if
|
|
15
|
-
|
|
14
|
+
<% if document.collection? %>
|
|
15
|
+
<% collection_presenter = Hyrax::CollectionPresenter.new(document, current_ability) %>
|
|
16
16
|
<div class="col-md-4">
|
|
17
17
|
<div class="collection-counts-wrapper">
|
|
18
18
|
<div class="collection-counts-item">
|
|
@@ -12,4 +12,5 @@
|
|
|
12
12
|
<%= presenter.attribute_to_html(:resource_type, render_as: :faceted, html_dl: true) %>
|
|
13
13
|
<%= presenter.attribute_to_html(:source, html_dl: true) %>
|
|
14
14
|
<%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %>
|
|
15
|
+
<%= presenter.attribute_to_html(:rights_notes, html_dl: true) %>
|
|
15
16
|
<%= presenter.attribute_to_html(:license, render_as: :license, html_dl: true) %>
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
<!-- The fileinput-button span is used to style the file input field as button -->
|
|
16
16
|
<span id="addfiles" class="btn btn-success fileinput-button">
|
|
17
17
|
<span class="glyphicon glyphicon-plus"></span>
|
|
18
|
-
<span
|
|
18
|
+
<span><%= t(".add_files") %></span>
|
|
19
19
|
<input type="file" name="files[]" multiple />
|
|
20
20
|
</span>
|
|
21
21
|
<!-- The fileinput-button span is used to style the file input field as button -->
|
|
22
22
|
<span id="addfolder" class="btn btn-success fileinput-button">
|
|
23
23
|
<span class="glyphicon glyphicon-plus"></span>
|
|
24
|
-
<span
|
|
24
|
+
<span><%= t(".add_folder") %></span>
|
|
25
25
|
<input type="file" name="files[]" multiple directory webkitdirectory />
|
|
26
26
|
</span>
|
|
27
27
|
<% if Hyrax.config.browse_everything? %>
|