hyrax 3.0.2 → 3.1.0
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 +4 -4
- data/.circleci/config.yml +22 -0
- data/.dassie/Gemfile +10 -5
- data/.dassie/config/initializers/hyrax.rb +5 -0
- data/.dockerignore +3 -0
- data/.env +0 -1
- data/.rubocop.yml +4 -0
- data/CONTAINERS.md +1 -1
- data/Dockerfile +12 -6
- data/Gemfile +21 -27
- data/app/actors/hyrax/actors/base_actor.rb +1 -1
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +85 -63
- data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +7 -42
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +20 -8
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +21 -9
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +14 -5
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +22 -3
- data/app/controllers/hyrax/admin/workflows_controller.rb +8 -2
- data/app/controllers/hyrax/dashboard/collection_members_controller.rb +13 -9
- data/app/controllers/hyrax/dashboard/collections_controller.rb +12 -10
- data/app/controllers/hyrax/file_sets_controller.rb +49 -13
- data/app/controllers/hyrax/permissions_controller.rb +3 -4
- data/app/controllers/hyrax/workflow_actions_controller.rb +3 -1
- data/app/forms/hyrax/forms/collection_form.rb +7 -3
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +24 -2
- data/app/forms/hyrax/forms/file_set_form.rb +46 -0
- data/app/forms/hyrax/forms/permission.rb +23 -0
- data/app/forms/hyrax/forms/permission_template_form.rb +8 -2
- data/app/forms/hyrax/forms/resource_form.rb +10 -17
- data/app/forms/hyrax/forms/work_form.rb +5 -2
- data/app/helpers/hyrax/batch_edits_helper.rb +3 -1
- data/app/helpers/hyrax/collections_helper.rb +88 -2
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +3 -7
- data/app/helpers/hyrax/file_set_helper.rb +25 -6
- data/app/helpers/hyrax/work_form_helper.rb +53 -0
- data/app/indexers/hyrax/administrative_set_indexer.rb +18 -0
- data/app/indexers/hyrax/valkyrie_indexer.rb +3 -3
- data/app/inputs/controlled_vocabulary_input.rb +2 -5
- data/app/jobs/attach_files_to_work_job.rb +19 -10
- data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +6 -5
- data/app/jobs/inherit_permissions_job.rb +9 -5
- data/app/models/admin_set.rb +6 -25
- data/app/models/concerns/hyrax/ability.rb +3 -1
- data/app/models/concerns/hyrax/collection_behavior.rb +17 -44
- data/app/models/concerns/hyrax/file_set/characterization.rb +18 -12
- data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -52
- data/app/models/concerns/hyrax/suppressible.rb +5 -0
- data/app/models/concerns/hyrax/user.rb +9 -3
- data/app/models/hyrax/file_set.rb +6 -0
- data/app/models/hyrax/pcdm_collection.rb +1 -0
- data/app/models/hyrax/permission_template.rb +98 -12
- data/app/models/hyrax/virus_scanner.rb +27 -18
- data/app/models/sipity/agent.rb +1 -0
- data/app/models/sipity/entity.rb +30 -8
- data/app/models/sipity/workflow.rb +1 -0
- data/app/models/sipity.rb +42 -0
- data/app/presenters/hyrax/admin_set_options_presenter.rb +2 -10
- data/app/presenters/hyrax/admin_set_presenter.rb +5 -1
- data/app/presenters/hyrax/admin_set_selection_presenter.rb +116 -0
- data/app/presenters/hyrax/collection_presenter.rb +31 -6
- data/app/presenters/hyrax/file_set_presenter.rb +6 -1
- data/app/presenters/hyrax/file_usage.rb +3 -2
- data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
- data/app/presenters/hyrax/trophy_presenter.rb +33 -4
- data/app/presenters/hyrax/user_profile_presenter.rb +11 -1
- data/app/presenters/hyrax/version_list_presenter.rb +19 -0
- data/app/presenters/hyrax/version_presenter.rb +3 -2
- data/app/presenters/hyrax/work_show_presenter.rb +25 -4
- data/app/presenters/hyrax/work_usage.rb +5 -3
- data/app/renderers/hyrax/renderers/attribute_renderer.rb +10 -2
- data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
- data/app/search_builders/hyrax/my/collections_search_builder.rb +1 -1
- data/app/services/hyrax/admin_set_create_service.rb +3 -1
- data/app/services/hyrax/collections/collection_member_search_service.rb +72 -0
- data/app/services/hyrax/collections/collection_member_service.rb +112 -27
- data/app/services/hyrax/collections/migration_service.rb +4 -2
- data/app/services/hyrax/collections/nested_collection_persistence_service.rb +12 -13
- data/app/services/hyrax/collections/nested_collection_query_service.rb +2 -0
- data/app/services/hyrax/collections/permissions_create_service.rb +6 -4
- data/app/services/hyrax/contextual_path.rb +23 -0
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +7 -5
- data/app/services/hyrax/custom_queries/navigators/parent_collections_navigator.rb +46 -0
- data/app/services/hyrax/edit_permissions_service.rb +27 -20
- data/app/services/hyrax/find_objects_via_solr_service.rb +11 -7
- data/app/services/hyrax/multiple_membership_checker.rb +51 -31
- data/app/services/hyrax/resource_status.rb +7 -0
- data/app/services/hyrax/search_service.rb +4 -2
- data/app/services/hyrax/solr_query_builder_service.rb +29 -6
- data/app/services/hyrax/solr_query_service.rb +224 -0
- data/app/services/hyrax/solr_service.rb +8 -1
- data/app/services/hyrax/statistics/depositors/summary.rb +2 -1
- data/app/services/hyrax/work_uploads_handler.rb +17 -2
- data/app/services/hyrax/workflow/actionable_objects.rb +70 -0
- data/app/services/hyrax/workflow/object_in_workflow_decorator.rb +31 -0
- data/app/services/hyrax/workflow/status_list_service.rb +43 -13
- data/app/views/hyrax/base/_form_relationships.html.erb +1 -2
- data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
- data/app/views/hyrax/base/_form_representative.html.erb +1 -1
- data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
- data/app/views/hyrax/base/_guts4form.html.erb +2 -2
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -3
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/edit.html.erb +4 -2
- data/app/views/hyrax/dashboard/collections/new.html.erb +4 -2
- data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
- data/app/views/hyrax/file_sets/edit.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
- data/app/views/hyrax/file_sets/show.html.erb +1 -1
- data/app/views/hyrax/my/_admin_set_action_menu.html.erb +0 -11
- data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -2
- data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -5
- data/bin/solrcloud-assign-configset.sh +8 -5
- data/bin/solrcloud-upload-configset.sh +4 -2
- data/chart/hyrax/Chart.yaml +3 -3
- data/chart/hyrax/README.md +47 -1
- data/chart/hyrax/templates/_helpers.tpl +1 -1
- data/chart/hyrax/templates/configmap-env.yaml +1 -3
- data/chart/hyrax/templates/deployment-worker.yaml +6 -3
- data/chart/hyrax/templates/deployment.yaml +8 -3
- data/chart/hyrax/values.yaml +12 -0
- data/config/brakeman.ignore +2 -2
- data/config/locales/hyrax.de.yml +1 -1
- data/config/locales/hyrax.en.yml +1 -1
- data/config/locales/hyrax.es.yml +1 -1
- data/config/locales/hyrax.fr.yml +1 -1
- data/config/locales/hyrax.it.yml +1 -1
- data/config/locales/hyrax.pt-BR.yml +1 -1
- data/config/locales/hyrax.zh.yml +1 -1
- data/docker-compose.yml +1 -0
- data/documentation/developing-your-hyrax-based-app.md +1 -1
- data/documentation/legacyREADME.md +1 -1
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +5 -0
- data/lib/hyrax/active_fedora_dummy_model.rb +62 -0
- data/lib/hyrax/configuration.rb +8 -0
- data/lib/hyrax/engine.rb +1 -0
- data/lib/hyrax/errors.rb +2 -0
- data/lib/hyrax/specs/capybara.rb +3 -1
- data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +9 -0
- data/lib/hyrax/transactions/container.rb +21 -0
- data/lib/hyrax/transactions/file_set_destroy.rb +21 -0
- data/lib/hyrax/transactions/steps/add_file_sets.rb +3 -2
- data/lib/hyrax/transactions/steps/add_to_parent.rb +36 -0
- data/lib/hyrax/transactions/steps/remove_file_set_from_work.rb +47 -0
- data/lib/hyrax/transactions/work_create.rb +2 -1
- data/lib/hyrax/valkyrie_can_can_adapter.rb +1 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +9 -0
- data/lib/tasks/collection_type_global_id.rake +1 -1
- data/lib/tasks/regenerate_derivatives.rake +12 -0
- data/lib/wings/orm_converter.rb +18 -2
- data/lib/wings/setup.rb +1 -0
- data/lib/wings/valkyrie/storage.rb +56 -1
- data/template.rb +1 -1
- metadata +17 -2
|
@@ -37,7 +37,8 @@ module Hyrax
|
|
|
37
37
|
'Use `Hyrax.config.solr_select_path` instead'
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
delegate :add, :commit, :count, :delete, :get, :instance, :ping, :post,
|
|
40
|
+
delegate :add, :commit, :count, :delete, :get, :instance, :ping, :post,
|
|
41
|
+
:query, :delete_by_query, :search_by_id, :wipe!, to: :new
|
|
41
42
|
end
|
|
42
43
|
|
|
43
44
|
# Wraps rsolr get
|
|
@@ -100,6 +101,12 @@ module Hyrax
|
|
|
100
101
|
connection.delete_by_id(id, params: COMMIT_PARAMS)
|
|
101
102
|
end
|
|
102
103
|
|
|
104
|
+
# Deletes all solr documents
|
|
105
|
+
def wipe!
|
|
106
|
+
delete_by_query("*:*")
|
|
107
|
+
commit
|
|
108
|
+
end
|
|
109
|
+
|
|
103
110
|
# Wraps rsolr add
|
|
104
111
|
# @return [Hash] the hash straight form rsolr
|
|
105
112
|
def add(solr_doc, commit: true)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# Gather information about the depositors who have contributed to the repository
|
|
3
2
|
module Hyrax
|
|
4
3
|
module Statistics
|
|
5
4
|
module Depositors
|
|
5
|
+
##
|
|
6
|
+
# Gather information about the depositors who have contributed to the repository
|
|
6
7
|
class Summary
|
|
7
8
|
include Blacklight::SearchHelper
|
|
8
9
|
|
|
@@ -48,7 +48,9 @@ module Hyrax
|
|
|
48
48
|
# @return [Enumberable<Hyrax::UploadedFile>]
|
|
49
49
|
# @!attribute [r] work
|
|
50
50
|
# @return [Hyrax::Work]
|
|
51
|
-
|
|
51
|
+
# @!attribute [r] file_set_params
|
|
52
|
+
# @return [Enumerable<Hash>]
|
|
53
|
+
attr_reader :files, :work, :file_set_params
|
|
52
54
|
|
|
53
55
|
##
|
|
54
56
|
# @param [Hyrax::Work] work
|
|
@@ -71,9 +73,10 @@ module Hyrax
|
|
|
71
73
|
# @return [WorkFileSetManager] self
|
|
72
74
|
# @raise [ArgumentError] if any of the uploaded files are not an
|
|
73
75
|
# `UploadedFile`
|
|
74
|
-
def add(files:)
|
|
76
|
+
def add(files:, file_set_params: [])
|
|
75
77
|
validate_files(files) &&
|
|
76
78
|
@files = Array.wrap(files).reject { |f| f.file_set_uri.present? }
|
|
79
|
+
@file_set_params = file_set_params
|
|
77
80
|
self
|
|
78
81
|
end
|
|
79
82
|
|
|
@@ -105,6 +108,10 @@ module Hyrax
|
|
|
105
108
|
|
|
106
109
|
# copy ACLs; should we also be propogating embargo/lease?
|
|
107
110
|
Hyrax::AccessControlList.copy_permissions(source: target_permissions, target: file_set)
|
|
111
|
+
|
|
112
|
+
# set visibility from params and save
|
|
113
|
+
file_set.visibility = file_set_extra_params(file)[:visibility] if file_set_extra_params(file)[:visibility].present?
|
|
114
|
+
file_set.permission_manager.acl.save if file_set.permission_manager.acl.pending_changes?
|
|
108
115
|
append_to_work(file_set)
|
|
109
116
|
|
|
110
117
|
IngestJob.perform_later(wrap_file(file, file_set))
|
|
@@ -135,6 +142,14 @@ module Hyrax
|
|
|
135
142
|
title: file.uploader.filename }
|
|
136
143
|
end
|
|
137
144
|
|
|
145
|
+
##
|
|
146
|
+
# @api private
|
|
147
|
+
#
|
|
148
|
+
# return [Hash(Symbol => Object)]
|
|
149
|
+
def file_set_extra_params(file)
|
|
150
|
+
file_set_params&.find { |fs| fs[:uploaded_file_id] == file.id.to_s } || {}
|
|
151
|
+
end
|
|
152
|
+
|
|
138
153
|
##
|
|
139
154
|
# @api private
|
|
140
155
|
#
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Hyrax
|
|
3
|
+
module Workflow
|
|
4
|
+
##
|
|
5
|
+
# Produces a list of workflow-ready objects for a given user. Results are
|
|
6
|
+
# given as a presenter objects with SolrDocument-like behavior, with added
|
|
7
|
+
# support for workflow states.
|
|
8
|
+
#
|
|
9
|
+
# @example
|
|
10
|
+
# Hyrax::Workflow::ActionableObjects.new(user: current_user).each do |object|
|
|
11
|
+
# puts object.title
|
|
12
|
+
# puts object.workflow_state
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# @see Hyrax::Workflow::ObjectInWorkflowDecorator
|
|
16
|
+
class ActionableObjects
|
|
17
|
+
include Enumerable
|
|
18
|
+
|
|
19
|
+
##
|
|
20
|
+
# @!attribute [rw] user
|
|
21
|
+
# @return [::User]
|
|
22
|
+
attr_accessor :user
|
|
23
|
+
|
|
24
|
+
##
|
|
25
|
+
# @param [::User] user the user whose
|
|
26
|
+
def initialize(user:)
|
|
27
|
+
@user = user
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
##
|
|
31
|
+
# @return [Hyrax::Workflow::ObjectInWorkflowDecorator]
|
|
32
|
+
def each
|
|
33
|
+
return enum_for(:each) unless block_given?
|
|
34
|
+
ids_and_states = id_state_pairs
|
|
35
|
+
return if ids_and_states.none?
|
|
36
|
+
|
|
37
|
+
docs = Hyrax::SolrQueryService.new.with_ids(ids: ids_and_states.map(&:first)).solr_documents
|
|
38
|
+
|
|
39
|
+
docs.each do |solr_doc|
|
|
40
|
+
object = ObjectInWorkflowDecorator.new(solr_doc)
|
|
41
|
+
_, state = ids_and_states.find { |id, _| id == object.id }
|
|
42
|
+
|
|
43
|
+
object.workflow_state = state
|
|
44
|
+
|
|
45
|
+
yield object
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
##
|
|
52
|
+
# @api private
|
|
53
|
+
# @return [Array[String, Sipity::WorkflowState]]
|
|
54
|
+
def id_state_pairs
|
|
55
|
+
gids_and_states = PermissionQuery
|
|
56
|
+
.scope_entities_for_the_user(user: user)
|
|
57
|
+
.pluck(:proxy_for_global_id, :workflow_state_id)
|
|
58
|
+
|
|
59
|
+
return [] if gids_and_states.none?
|
|
60
|
+
|
|
61
|
+
all_states = Sipity::WorkflowState.find(gids_and_states.map(&:last).uniq)
|
|
62
|
+
|
|
63
|
+
gids_and_states.map do |str, state_id|
|
|
64
|
+
[GlobalID.new(str).model_id,
|
|
65
|
+
all_states.find { |state| state.id == state_id }]
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hyrax
|
|
4
|
+
module Workflow
|
|
5
|
+
##
|
|
6
|
+
# Decorates objects with attributes with their workflow state.
|
|
7
|
+
class ObjectInWorkflowDecorator < Hyrax::ModelDecorator
|
|
8
|
+
delegate_all
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
# @!attribute [w] workflow
|
|
12
|
+
# @return [Sipity::Workflow]
|
|
13
|
+
# @!attribute [w] workflow_state
|
|
14
|
+
# @return [Sipity::WorkflowState]
|
|
15
|
+
attr_writer :workflow, :workflow_state
|
|
16
|
+
|
|
17
|
+
##
|
|
18
|
+
# @return [Boolean]
|
|
19
|
+
def published?
|
|
20
|
+
Hyrax::Admin::WorkflowsController.deposited_workflow_state_name ==
|
|
21
|
+
workflow_state
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
##
|
|
25
|
+
# @return [String]
|
|
26
|
+
def workflow_state
|
|
27
|
+
@workflow_state&.name || 'unknown'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -1,35 +1,65 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module Hyrax
|
|
3
3
|
module Workflow
|
|
4
|
-
|
|
4
|
+
##
|
|
5
|
+
# @deprecated use the Hyrax::Workflow::ActionableObjects enumerator instead.
|
|
6
|
+
# that service is designed as a more efficient and ergonomic replacement
|
|
7
|
+
# for this one, and has fewer dependencies on specific indexing behavior.
|
|
8
|
+
#
|
|
9
|
+
# Finds a list of works that a given user can perform a workflow action on.
|
|
5
10
|
class StatusListService
|
|
6
|
-
|
|
11
|
+
##
|
|
12
|
+
# @param context_or_user [::User, #current_user]
|
|
7
13
|
# @param filter_condition [String] a solr filter
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
#
|
|
15
|
+
# @raise [ArgumentError] if th caller fails to provide a user
|
|
16
|
+
def initialize(context_or_user, filter_condition)
|
|
17
|
+
Deprecation
|
|
18
|
+
.warn("Use the Hyrax::Workflow::ActionableObjects enumerator instead.")
|
|
19
|
+
|
|
20
|
+
case context_or_user
|
|
21
|
+
when ::User
|
|
22
|
+
@user = context_or_user
|
|
23
|
+
when nil
|
|
24
|
+
raise ArgumentError, "A current user MUST be provided."
|
|
25
|
+
else
|
|
26
|
+
Deprecation.warn('Initializing StatusListService with a controller ' \
|
|
27
|
+
'"context" is deprecated. Pass in a user instead.')
|
|
28
|
+
@context = context_or_user
|
|
29
|
+
@user = @context.current_user
|
|
30
|
+
end
|
|
10
31
|
@filter_condition = filter_condition
|
|
11
32
|
end
|
|
12
33
|
|
|
34
|
+
##
|
|
35
|
+
# @!attribute [r] context
|
|
36
|
+
# @deprecated
|
|
37
|
+
# @return [#current_user]
|
|
13
38
|
attr_reader :context
|
|
39
|
+
deprecation_deprecate :context
|
|
14
40
|
|
|
15
|
-
|
|
16
|
-
# @
|
|
41
|
+
##
|
|
42
|
+
# @todo We will want to paginate this
|
|
43
|
+
# @return [Enumerable<StatusRow>] a list of results that the given user can take action on.
|
|
17
44
|
def each
|
|
18
45
|
return enum_for(:each) unless block_given?
|
|
46
|
+
|
|
19
47
|
solr_documents.each do |doc|
|
|
20
48
|
yield doc
|
|
21
49
|
end
|
|
22
50
|
end
|
|
23
51
|
|
|
24
|
-
|
|
52
|
+
##
|
|
53
|
+
# @deprecated
|
|
25
54
|
def user
|
|
26
|
-
|
|
55
|
+
Deprecation.warn('This method was always intended to be private. ' \
|
|
56
|
+
'It will be removed in Hyrax 4.0')
|
|
57
|
+
@user
|
|
27
58
|
end
|
|
28
59
|
|
|
29
60
|
private
|
|
30
61
|
|
|
31
|
-
|
|
32
|
-
|
|
62
|
+
##
|
|
33
63
|
# @return [Hash<String,SolrDocument>] a hash of id to solr document
|
|
34
64
|
def solr_documents
|
|
35
65
|
search_solr.map { |result| ::SolrDocument.new(result) }
|
|
@@ -37,9 +67,9 @@ module Hyrax
|
|
|
37
67
|
|
|
38
68
|
def search_solr
|
|
39
69
|
actionable_roles = roles_for_user
|
|
40
|
-
logger.debug("Actionable roles for #{user.user_key} are #{actionable_roles}")
|
|
70
|
+
Hyrax.logger.debug("Actionable roles for #{@user.user_key} are #{actionable_roles}")
|
|
41
71
|
return [] if actionable_roles.empty?
|
|
42
|
-
WorkRelation.new.search_with_conditions(query(actionable_roles),
|
|
72
|
+
WorkRelation.new.search_with_conditions(query(actionable_roles), method: :post)
|
|
43
73
|
end
|
|
44
74
|
|
|
45
75
|
def query(actionable_roles)
|
|
@@ -59,7 +89,7 @@ module Hyrax
|
|
|
59
89
|
# @param workflow [Sipity::Workflow]
|
|
60
90
|
# @return [ActiveRecord::Relation<Sipity::WorkflowRole>]
|
|
61
91
|
def workflow_roles_for_user_and_workflow(workflow)
|
|
62
|
-
Hyrax::Workflow::PermissionQuery.scope_processing_workflow_roles_for_user_and_workflow(user: user, workflow: workflow)
|
|
92
|
+
Hyrax::Workflow::PermissionQuery.scope_processing_workflow_roles_for_user_and_workflow(user: @user, workflow: workflow)
|
|
63
93
|
end
|
|
64
94
|
end
|
|
65
95
|
end
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<% if Flipflop.assign_admin_set? %>
|
|
2
|
-
<%# TODO: avoid direct dependency on AdminSetService and AdminSetOptionsPresenter in the view!! make the controller provide the options! %>
|
|
3
2
|
<%= f.input :admin_set_id, as: :select,
|
|
4
3
|
include_blank: false,
|
|
5
|
-
collection:
|
|
4
|
+
collection: admin_set_options,
|
|
6
5
|
input_html: { class: 'form-control' } %>
|
|
7
6
|
<% end %>
|
|
8
7
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<div class="form-group">
|
|
8
8
|
<span class="help-block"><%= t("hyrax.base.form_rendering.help_html") %></span>
|
|
9
9
|
<%= f.select :rendering_ids,
|
|
10
|
-
f.object
|
|
10
|
+
form_file_set_select_for(parent: f.object),
|
|
11
11
|
{ include_blank: true },
|
|
12
12
|
{ class: 'form-control', multiple: true } %>
|
|
13
13
|
</div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</legend>
|
|
7
7
|
<div class="form-group">
|
|
8
8
|
<span class="help-block"><%= t("hyrax.base.form_representative.help_html") %></span>
|
|
9
|
-
<%= f.select :representative_id, @form
|
|
9
|
+
<%= f.select :representative_id, form_file_set_select_for(parent: @form), {}, { class: 'form-control' } %>
|
|
10
10
|
</div>
|
|
11
11
|
</fieldset>
|
|
12
12
|
</div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</legend>
|
|
7
7
|
<div class="form-group">
|
|
8
8
|
<span class="help-block"><%= t("hyrax.base.form_thumbnail.help_html") %></span>
|
|
9
|
-
<%= f.select :thumbnail_id, @form
|
|
9
|
+
<%= f.select :thumbnail_id, form_file_set_select_for(parent: @form), {}, { class: 'form-control' } %>
|
|
10
10
|
</div>
|
|
11
11
|
</fieldset>
|
|
12
12
|
</div>
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
<li role="presentation">
|
|
12
12
|
<% end %>
|
|
13
13
|
<a href="#<%= tab %>" aria-controls="<%= tab %>" role="tab" data-toggle="tab">
|
|
14
|
-
<%=
|
|
14
|
+
<%= form_tab_label_for(form: f.object, tab: tab) %>
|
|
15
15
|
</a>
|
|
16
16
|
</li>
|
|
17
17
|
<% end %>
|
|
18
18
|
|
|
19
19
|
<li role="presentation" id="tab-share" class="hidden">
|
|
20
20
|
<a href="#share" aria-controls="share" role="tab" data-toggle="tab">
|
|
21
|
-
<%=
|
|
21
|
+
<%= form_tab_label_for(form: f.object, tab: 'share') %>
|
|
22
22
|
</a>
|
|
23
23
|
</li>
|
|
24
24
|
</ul>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% if defined?(viewer) && viewer %>
|
|
3
3
|
<%= iiif_viewer_display presenter %>
|
|
4
4
|
<% else %>
|
|
5
|
-
<%=
|
|
5
|
+
<%= render media_display_partial(presenter.representative_presenter), file_set: presenter.representative_presenter %>
|
|
6
6
|
<% end %>
|
|
7
7
|
<% else %>
|
|
8
8
|
<%= image_tag 'default.png', class: "canonical-image", alt: 'default representative image' %>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="col-sm-6 text-right">
|
|
28
28
|
<% if presenter.editor? && !workflow_restriction?(presenter) %>
|
|
29
29
|
<%= link_to t('.edit'), edit_polymorphic_path([main_app, presenter]), class: 'btn btn-default' %>
|
|
30
|
-
<% if presenter.
|
|
30
|
+
<% if presenter.member_count > 1 %>
|
|
31
31
|
<%= link_to t("hyrax.file_manager.link_text"), polymorphic_path([main_app, :file_manager, presenter]), class: 'btn btn-default' %>
|
|
32
32
|
<% end %>
|
|
33
33
|
<% if presenter.valid_child_concerns.length > 0 %>
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
<a href="#description" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t('.tabs.description') %></a>
|
|
6
6
|
</li>
|
|
7
7
|
<% if @form.persisted? %>
|
|
8
|
-
<% if @collection
|
|
8
|
+
<% if collection_brandable?(collection: @collection) %>
|
|
9
9
|
<li>
|
|
10
10
|
<a href="#branding" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t('.tabs.branding') %></a>
|
|
11
11
|
</li>
|
|
12
12
|
<% end %>
|
|
13
|
-
<% if @collection
|
|
13
|
+
<% if collection_discoverable?(collection: @collection) %>
|
|
14
14
|
<li>
|
|
15
15
|
<a href="#discovery" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t('.tabs.discovery') %></a>
|
|
16
16
|
</li>
|
|
17
17
|
<% end %>
|
|
18
|
-
<% if @collection
|
|
18
|
+
<% if collection_sharable?(collection: @collection) %>
|
|
19
19
|
<li>
|
|
20
20
|
<a href="#sharing" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t('.tabs.sharing') %></a>
|
|
21
21
|
</li>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% id = collection_presenter.id %>
|
|
3
3
|
<tr id="document_<%= id %>"
|
|
4
4
|
data-id="<%= id %>"
|
|
5
|
-
data-colls-hash="<%=
|
|
5
|
+
data-colls-hash="<%= available_parent_collections_data(collection: collection_presenter) %>"
|
|
6
6
|
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>"
|
|
7
7
|
data-post-delete-url="<%= is_admin_set ? hyrax.admin_admin_set_path(id) : hyrax.dashboard_collection_path(id) %>">
|
|
8
8
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<% type_title = collection_type_label_for(collection: @collection) %>
|
|
2
|
+
|
|
3
|
+
<% provide :page_title, construct_page_title( t('.header', type_title: type_title, title: @form.title.first) ) %>
|
|
2
4
|
|
|
3
5
|
<% provide :page_header do %>
|
|
4
|
-
<h1><span class="fa fa-edit" aria-hidden="true"></span><%= t('.header', type_title:
|
|
6
|
+
<h1><span class="fa fa-edit" aria-hidden="true"></span><%= t('.header', type_title: type_title, title: @form.title.first) %></h1>
|
|
5
7
|
<% end %>
|
|
6
8
|
|
|
7
9
|
<div class="row">
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<% type_title = collection_type_label_for(collection: @collection) %>
|
|
2
|
+
|
|
3
|
+
<% provide :page_title, construct_page_title( t('.header', type_title: type_title)) %>
|
|
2
4
|
<% provide :page_header do %>
|
|
3
|
-
<h1><span class="fa fa-edit" aria-hidden="true"></span> <%= t('.header', type_title:
|
|
5
|
+
<h1><span class="fa fa-edit" aria-hidden="true"></span> <%= t('.header', type_title: type_title) %> </h1>
|
|
4
6
|
<% end %>
|
|
5
7
|
|
|
6
8
|
<div class="row">
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
<% if @presenter.collection_type_is_nestable? && !collection_search_parameters? %>
|
|
98
98
|
<%= render 'hyrax/my/collections/modal_add_to_collection', source: 'show' %>
|
|
99
|
-
<%= render 'hyrax/my/collections/modal_add_subcollection', id: @presenter.id, source: 'show' %>
|
|
99
|
+
<%= render 'hyrax/my/collections/modal_add_subcollection', id: @presenter.id, presenter: @presenter, source: 'show' %>
|
|
100
100
|
<%= render 'hyrax/dashboard/collections/modal_parent_collection_remove_deny', source: 'show' %>
|
|
101
101
|
<% end %>
|
|
102
102
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div class="row">
|
|
8
8
|
<div class="col-xs-12 col-sm-4">
|
|
9
|
-
<%=
|
|
9
|
+
<%= render media_display_partial(curation_concern.to_presenter), file_set: curation_concern.to_presenter %>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="col-xs-12 col-sm-8">
|
|
12
12
|
<div class="panel panel-default tabs">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% if
|
|
1
|
+
<% if display_media_download_link?(file_set: file_set) %>
|
|
2
2
|
<div>
|
|
3
3
|
<h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
|
|
4
4
|
<audio controls="controls" class="audiojs" style="width:100%" controlsList="nodownload" preload="auto">
|