hyrax 4.0.0 → 5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +116 -231
  3. data/.dassie/.env +3 -1
  4. data/.dassie/config/environments/test.rb +1 -0
  5. data/.dassie/config/initializers/hyrax.rb +3 -1
  6. data/.dassie/config/initializers/riiif.rb +13 -3
  7. data/.dassie/db/schema.rb +2 -2
  8. data/.dockerignore +6 -0
  9. data/.github/PULL_REQUEST_TEMPLATE.md +10 -7
  10. data/.github/release.yml +5 -2
  11. data/.koppie/.env +3 -0
  12. data/.koppie/app/forms/collection_resource_form.rb +1 -0
  13. data/.koppie/app/indexers/collection_resource_indexer.rb +1 -0
  14. data/.koppie/app/models/collection_resource.rb +1 -0
  15. data/.koppie/config/environments/test.rb +1 -0
  16. data/.koppie/config/initializers/hyrax.rb +8 -2
  17. data/.koppie/config/initializers/riiif.rb +13 -4
  18. data/.koppie/config/metadata/collection_resource.yaml +1 -128
  19. data/.koppie/yarn.lock +23 -23
  20. data/.regen +1 -1
  21. data/CONTAINERS.md +1 -1
  22. data/Dockerfile +6 -11
  23. data/app/actors/hyrax/actors/base_actor.rb +4 -3
  24. data/app/actors/hyrax/actors/embargo_actor.rb +5 -2
  25. data/app/actors/hyrax/actors/lease_actor.rb +5 -2
  26. data/app/assets/javascripts/hyrax/file_manager/sorting.es6 +3 -2
  27. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +1 -1
  28. data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +74 -0
  29. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -5
  30. data/app/controllers/hyrax/admin/workflows_controller.rb +48 -3
  31. data/app/controllers/hyrax/batch_edits_controller.rb +33 -4
  32. data/app/controllers/hyrax/downloads_controller.rb +8 -1
  33. data/app/controllers/hyrax/file_sets_controller.rb +1 -0
  34. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  35. data/app/forms/hyrax/forms/permission_template_form.rb +2 -0
  36. data/app/forms/hyrax/forms/resource_batch_edit_form.rb +90 -0
  37. data/app/forms/hyrax/forms/work_embargo_form.rb +1 -0
  38. data/app/forms/hyrax/forms/work_form.rb +1 -1
  39. data/app/forms/hyrax/forms/work_lease_form.rb +1 -0
  40. data/app/helpers/hyrax/dashboard_helper_behavior.rb +17 -9
  41. data/app/helpers/hyrax/membership_helper.rb +13 -1
  42. data/app/helpers/hyrax/work_form_helper.rb +0 -107
  43. data/app/indexers/hyrax/file_set_indexer.rb +6 -0
  44. data/app/indexers/hyrax/pcdm_collection_indexer.rb +8 -0
  45. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +41 -5
  46. data/app/indexers/hyrax/valkyrie_work_indexer.rb +8 -2
  47. data/app/jobs/valkyrie_create_derivatives_job.rb +8 -7
  48. data/app/jobs/valkyrie_ingest_job.rb +0 -1
  49. data/app/models/admin_set.rb +1 -31
  50. data/app/models/concerns/hyrax/file_set/derivatives.rb +3 -2
  51. data/app/models/concerns/hyrax/solr_document_behavior.rb +1 -1
  52. data/app/models/hyrax/collection_type.rb +5 -14
  53. data/app/models/hyrax/file_metadata.rb +6 -7
  54. data/app/models/hyrax/file_set.rb +8 -0
  55. data/app/models/hyrax/resource.rb +30 -2
  56. data/app/presenters/hyrax/file_set_presenter.rb +6 -0
  57. data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -7
  58. data/app/presenters/hyrax/presenter_renderer.rb +0 -7
  59. data/app/presenters/hyrax/work_show_presenter.rb +6 -11
  60. data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
  61. data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +37 -0
  62. data/app/search_builders/hyrax/valkyrie_work_relation.rb +9 -0
  63. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +11 -9
  64. data/app/services/hyrax/custom_queries/find_by_date_range.rb +55 -0
  65. data/app/services/hyrax/custom_queries/find_count_by.rb +62 -0
  66. data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
  67. data/app/services/hyrax/custom_queries/find_models_by_access.rb +59 -0
  68. data/app/services/hyrax/derivative_bucketed_storage.rb +25 -0
  69. data/app/services/hyrax/derivative_path.rb +14 -4
  70. data/app/services/hyrax/embargo_manager.rb +76 -10
  71. data/app/services/hyrax/file_set_derivatives_service.rb +3 -2
  72. data/app/services/hyrax/lease_manager.rb +88 -8
  73. data/app/services/hyrax/listeners/file_metadata_listener.rb +2 -2
  74. data/app/services/hyrax/listeners/workflow_listener.rb +8 -11
  75. data/app/services/hyrax/persist_directly_contained_output_file_service.rb +24 -2
  76. data/app/services/hyrax/solr_query_service.rb +7 -6
  77. data/app/services/hyrax/statistics/depositors/summary.rb +1 -1
  78. data/app/services/hyrax/statistics/over_time.rb +1 -1
  79. data/app/services/hyrax/statistics/users/over_time.rb +3 -1
  80. data/app/services/hyrax/statistics/valkyrie_query_service.rb +49 -0
  81. data/app/services/hyrax/statistics/works/count.rb +1 -1
  82. data/app/services/hyrax/thumbnail_path_service.rb +5 -0
  83. data/app/services/hyrax/valkyrie_persist_derivatives.rb +16 -11
  84. data/app/services/hyrax/valkyrie_upload.rb +5 -3
  85. data/app/services/hyrax/versioning_service.rb +1 -0
  86. data/app/services/hyrax/visibility_intention.rb +1 -4
  87. data/app/services/hyrax/visibility_propagator.rb +1 -1
  88. data/app/services/hyrax/workflow/actionable_objects.rb +28 -3
  89. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +1 -1
  90. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +1 -1
  91. data/app/services/hyrax/workflow/permission_query.rb +23 -2
  92. data/app/views/hyrax/admin/workflows/_tabs.html.erb +9 -0
  93. data/app/views/hyrax/admin/workflows/index.html.erb +53 -76
  94. data/app/views/hyrax/base/_file_manager_members.html.erb +2 -2
  95. data/app/views/hyrax/base/_form.html.erb +0 -10
  96. data/app/views/hyrax/base/_form_permission_embargo.html.erb +1 -1
  97. data/app/views/hyrax/base/_form_permission_lease.html.erb +1 -1
  98. data/app/views/hyrax/base/_form_visibility_component.html.erb +2 -2
  99. data/app/views/hyrax/base/_items.html.erb +1 -1
  100. data/app/views/hyrax/base/file_manager.html.erb +1 -1
  101. data/app/views/hyrax/base/show.json.jbuilder +2 -2
  102. data/app/views/hyrax/file_sets/show.html.erb +5 -3
  103. data/app/views/hyrax/homepage/_explore_collections.html.erb +1 -1
  104. data/chart/hyrax/Chart.yaml +18 -14
  105. data/chart/hyrax/README.md +34 -21
  106. data/chart/hyrax/templates/_helpers.tpl +26 -1
  107. data/chart/hyrax/templates/configmap-env.yaml +12 -2
  108. data/chart/hyrax/templates/secrets.yaml +1 -1
  109. data/chart/hyrax/values.yaml +36 -14
  110. data/config/initializers/listeners.rb +4 -10
  111. data/config/initializers/storage_adapter_initializer.rb +1 -1
  112. data/config/locales/hyrax.en.yml +8 -0
  113. data/config/metadata/file_set_metadata.yaml +1 -1
  114. data/docker-compose-koppie.yml +17 -4
  115. data/docker-compose.yml +19 -6
  116. data/documentation/developing-your-hyrax-based-app.md +6 -14
  117. data/documentation/legacyREADME.md +3 -1
  118. data/hyrax.gemspec +2 -2
  119. data/karma.conf.js +8 -9
  120. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
  121. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +15 -5
  122. data/lib/hyrax/active_fedora_dummy_model.rb +6 -1
  123. data/lib/hyrax/configuration.rb +6 -0
  124. data/lib/hyrax/engine.rb +2 -0
  125. data/lib/hyrax/publisher.rb +19 -3
  126. data/lib/hyrax/specs/capybara.rb +9 -4
  127. data/lib/hyrax/transactions/container.rb +5 -0
  128. data/lib/hyrax/transactions/steps/add_file_sets.rb +6 -0
  129. data/lib/hyrax/transactions/steps/apply_permission_template.rb +40 -0
  130. data/lib/hyrax/transactions/steps/save.rb +21 -0
  131. data/lib/hyrax/transactions/work_create.rb +1 -0
  132. data/lib/hyrax/version.rb +1 -1
  133. data/lib/hyrax.rb +1 -0
  134. data/lib/wings/active_fedora_converter/default_work.rb +7 -2
  135. data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
  136. data/lib/wings/active_fedora_converter.rb +47 -11
  137. data/lib/wings/model_transformer.rb +23 -4
  138. data/lib/wings/setup.rb +21 -1
  139. data/lib/wings/valkyrie/persister.rb +4 -2
  140. data/package.json +3 -1
  141. data/template.rb +1 -1
  142. metadata +17 -12
  143. data/app/forms/hyrax/forms/file_manager_form.rb +0 -35
  144. data/app/services/hyrax/collections/migration_service.rb +0 -113
  145. data/app/views/hyrax/base/_form_collections_error.html.erb +0 -1
  146. data/app/views/hyrax/base/_form_in_works_error.html.erb +0 -3
  147. data/app/views/hyrax/base/_form_ordered_members_error.html.erb +0 -3
  148. data/app/views/hyrax/base/_form_visibility_error.html.erb +0 -19
@@ -19,131 +19,4 @@
19
19
  # Generated via
20
20
  # `rails generate hyrax:collection_resource CollectionResource`
21
21
 
22
- attributes:
23
- description:
24
- type: string
25
- multiple: true
26
- form:
27
- primary: true
28
- index_keys:
29
- - "description_tesim"
30
- creator:
31
- type: string
32
- multiple: true
33
- form:
34
- required: false
35
- primary: false
36
- index_keys:
37
- - "creator_tesim"
38
- rights_statement:
39
- type: string
40
- multiple: true
41
- form:
42
- primary: false
43
- abstract:
44
- type: string
45
- multiple: true
46
- form:
47
- primary: false
48
- access_right:
49
- type: string
50
- multiple: true
51
- form:
52
- primary: false
53
- alternative_title:
54
- type: string
55
- multiple: true
56
- form:
57
- primary: false
58
- based_near:
59
- type: string
60
- multiple: true
61
- form:
62
- primary: false
63
- index_keys:
64
- - "based_near_sim"
65
- - "based_near_tesim"
66
- bibliographic_citation:
67
- type: string
68
- multiple: true
69
- contributor:
70
- type: string
71
- multiple: true
72
- form:
73
- primary: false
74
- date_created:
75
- type: date_time
76
- multiple: true
77
- form:
78
- primary: false
79
- index_keys:
80
- - "date_created_tesim"
81
- identifier:
82
- type: string
83
- multiple: true
84
- form:
85
- primary: false
86
- import_url:
87
- type: string
88
- keyword:
89
- type: string
90
- multiple: true
91
- index_keys:
92
- - "keyword_sim"
93
- - "keyword_tesim"
94
- form:
95
- primary: false
96
- publisher:
97
- type: string
98
- multiple: true
99
- form:
100
- primary: false
101
- label:
102
- type: string
103
- form:
104
- primary: false
105
- language:
106
- type: string
107
- multiple: true
108
- form:
109
- primary: false
110
- license:
111
- type: string
112
- multiple: true
113
- form:
114
- primary: false
115
- relative_path:
116
- type: string
117
- related_url:
118
- type: string
119
- multiple: true
120
- form:
121
- primary: false
122
- index_keys:
123
- - "related_url_tesim"
124
- resource_type:
125
- type: string
126
- multiple: true
127
- form:
128
- primary: false
129
- index_keys:
130
- - "resource_type_sim"
131
- - "resource_type_tesim"
132
- rights_notes:
133
- type: string
134
- multiple: true
135
- form:
136
- primary: false
137
- source:
138
- type: string
139
- multiple: true
140
- form:
141
- primary: false
142
- subject:
143
- type: string
144
- multiple: true
145
- index_keys:
146
- - "subject_sim"
147
- - "subject_tesim"
148
- form:
149
- primary: false
22
+ attributes: {}
data/.koppie/yarn.lock CHANGED
@@ -706,7 +706,7 @@ iconv-lite@^0.6.2:
706
706
  immediate@~3.0.5:
707
707
  version "3.0.6"
708
708
  resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
709
- integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=
709
+ integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
710
710
 
711
711
  imsc@^1.0.1-rc.1:
712
712
  version "1.1.2"
@@ -757,7 +757,7 @@ is-typedarray@~1.0.0:
757
757
  isarray@~1.0.0:
758
758
  version "1.0.0"
759
759
  resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
760
- integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
760
+ integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
761
761
 
762
762
  isexe@^2.0.0:
763
763
  version "2.0.0"
@@ -818,9 +818,9 @@ json-stringify-safe@~5.0.1:
818
818
  integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
819
819
 
820
820
  json5@^1.0.1:
821
- version "1.0.1"
822
- resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
823
- integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
821
+ version "1.0.2"
822
+ resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
823
+ integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==
824
824
  dependencies:
825
825
  minimist "^1.2.0"
826
826
 
@@ -840,14 +840,14 @@ jsviews@0.9.83:
840
840
  integrity sha1-BpsFEigz0jFVzDziwtn7LPeJqYo=
841
841
 
842
842
  jszip@*, jszip@^3.1.5, jszip@^3.2.2:
843
- version "3.7.1"
844
- resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9"
845
- integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==
843
+ version "3.10.1"
844
+ resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2"
845
+ integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==
846
846
  dependencies:
847
847
  lie "~3.3.0"
848
848
  pako "~1.0.2"
849
849
  readable-stream "~2.3.6"
850
- set-immediate-shim "~1.0.1"
850
+ setimmediate "^1.0.5"
851
851
 
852
852
  lie@3.1.1:
853
853
  version "3.1.1"
@@ -864,9 +864,9 @@ lie@~3.3.0:
864
864
  immediate "~3.0.5"
865
865
 
866
866
  loader-utils@^1.0.0:
867
- version "1.4.0"
868
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
869
- integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
867
+ version "1.4.2"
868
+ resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3"
869
+ integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==
870
870
  dependencies:
871
871
  big.js "^5.2.2"
872
872
  emojis-list "^3.0.0"
@@ -953,9 +953,9 @@ minimist@1.2.0:
953
953
  integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
954
954
 
955
955
  minimist@^1.2.0:
956
- version "1.2.5"
957
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
958
- integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
956
+ version "1.2.7"
957
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
958
+ integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
959
959
 
960
960
  mute-stream@0.0.7:
961
961
  version "0.0.7"
@@ -1100,9 +1100,9 @@ punycode@^2.1.0, punycode@^2.1.1:
1100
1100
  integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
1101
1101
 
1102
1102
  qs@~6.5.2:
1103
- version "6.5.2"
1104
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
1105
- integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
1103
+ version "6.5.3"
1104
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
1105
+ integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==
1106
1106
 
1107
1107
  readable-stream@^2.0.2, readable-stream@~2.3.6:
1108
1108
  version "2.3.7"
@@ -1209,10 +1209,10 @@ schema-utils@^0.4.0:
1209
1209
  ajv "^6.1.0"
1210
1210
  ajv-keywords "^3.1.0"
1211
1211
 
1212
- set-immediate-shim@~1.0.1:
1213
- version "1.0.1"
1214
- resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
1215
- integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=
1212
+ setimmediate@^1.0.5:
1213
+ version "1.0.5"
1214
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
1215
+ integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==
1216
1216
 
1217
1217
  shebang-command@^2.0.0:
1218
1218
  version "2.0.0"
@@ -1419,7 +1419,7 @@ url-toolkit@^2.1.2:
1419
1419
  util-deprecate@~1.0.1:
1420
1420
  version "1.0.2"
1421
1421
  resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
1422
- integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
1422
+ integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
1423
1423
 
1424
1424
  uuid@^3.3.2:
1425
1425
  version "3.4.0"
data/.regen CHANGED
@@ -1,2 +1,2 @@
1
1
  # When updating CI regen seed, set to current date.
2
- 2023-05-24T10:43:07
2
+ 2023-08-09T14:34:59
data/CONTAINERS.md CHANGED
@@ -191,7 +191,7 @@ We publish several Hyrax images to the [GitHub container registry][ghcr] under
191
191
  the [Samvera organization][samvera-packages]. To build them:
192
192
 
193
193
  ```sh
194
- export HYRAX_VERSION=v4.0.0 # or desired version
194
+ export HYRAX_VERSION=v5.0.0.rc1 # or desired version
195
195
  git checkout hyrax-$HYRAX_VERSION
196
196
 
197
197
  docker build --target hyrax-base --tag ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD) .
data/Dockerfile CHANGED
@@ -1,15 +1,10 @@
1
- ARG RUBY_VERSION=3.2.1
1
+ ARG ALPINE_VERSION=3.18
2
+ ARG RUBY_VERSION=3.2.2
2
3
 
3
- # Replace with official jemalloc package in alpine 3.17
4
- FROM ruby:$RUBY_VERSION-alpine3.16 as builder
5
- RUN apk add build-base curl
6
- RUN curl -sL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
7
- cd jemalloc-5.3.0 && \
8
- ./configure && \
9
- make && \
10
- make install
4
+ FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as builder
5
+ RUN apk add build-base curl jemalloc
11
6
 
12
- FROM ruby:$RUBY_VERSION-alpine3.16 as hyrax-base
7
+ FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base
13
8
 
14
9
  ARG DATABASE_APK_PACKAGE="postgresql-dev"
15
10
  ARG EXTRA_APK_PACKAGES="git"
@@ -43,7 +38,7 @@ ENV PATH="/app/samvera:$PATH"
43
38
  ENV RAILS_ROOT="/app/samvera/hyrax-webapp"
44
39
  ENV RAILS_SERVE_STATIC_FILES="1"
45
40
 
46
- COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/
41
+ COPY --from=builder /usr/lib/libjemalloc.so.2 /usr/local/lib/
47
42
  ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
48
43
 
49
44
  ENTRYPOINT ["hyrax-entrypoint.sh"]
@@ -71,7 +71,8 @@ module Hyrax
71
71
  def save(env, use_valkyrie: false)
72
72
  return env.curation_concern.save unless use_valkyrie
73
73
 
74
- resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource)
74
+ # don't run validations again on the converted object if they've already passed
75
+ resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource, is_valid: env.curation_concern.save)
75
76
 
76
77
  # we need to manually set the id and reload, because the actor stack requires
77
78
  # `env.curation_concern` to be the exact same instance throughout.
@@ -115,9 +116,9 @@ module Hyrax
115
116
  attributes.select { |_, v| v.respond_to?(:select) && !v.respond_to?(:read) }
116
117
  end
117
118
 
118
- def valkyrie_save(resource:)
119
+ def valkyrie_save(resource:, is_valid:)
119
120
  permissions = resource.permission_manager.acl.permissions
120
- resource = Hyrax.persister.save(resource: resource)
121
+ resource = Hyrax.persister.save(resource: resource, perform_af_validation: !is_valid)
121
122
 
122
123
  resource.permission_manager.acl.permissions = permissions
123
124
  resource.permission_manager.acl.save
@@ -15,8 +15,11 @@ module Hyrax
15
15
  case work
16
16
  when Valkyrie::Resource
17
17
  embargo_manager = Hyrax::EmbargoManager.new(resource: work)
18
- embargo_manager.release && Hyrax::AccessControlList(work).save
19
- embargo_manager.nullify
18
+ return if embargo_manager.embargo.embargo_release_date.blank?
19
+
20
+ embargo_manager.deactivate!
21
+ work.embargo = Hyrax.persister.save(resource: embargo_manager.embargo)
22
+ Hyrax::AccessControlList(work).save
20
23
  else
21
24
  work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
22
25
  work.deactivate_embargo!
@@ -15,8 +15,11 @@ module Hyrax
15
15
  case work
16
16
  when Valkyrie::Resource
17
17
  lease_manager = Hyrax::LeaseManager.new(resource: work)
18
- lease_manager.release && Hyrax::AccessControlList(work).save
19
- lease_manager.nullify
18
+ return if lease_manager.lease.lease_expiration_date.blank?
19
+
20
+ lease_manager.deactivate!
21
+ work.lease = Hyrax.persister.save(resource: lease_manager.lease)
22
+ Hyrax::AccessControlList(work).save
20
23
  else
21
24
  work.lease_visibility! # If the lease has lapsed, update the current visibility.
22
25
  work.deactivate_lease!
@@ -4,6 +4,7 @@ export default class SortManager {
4
4
  this.sorting_info = {}
5
5
  this.initialize_sort()
6
6
  this.element.data("current-order", this.order)
7
+ this.sort_property = this.element.data("sort-property")
7
8
  this.save_manager = save_manager
8
9
  this.initialize_alpha_sort_button()
9
10
  }
@@ -38,9 +39,9 @@ export default class SortManager {
38
39
  params() {
39
40
  let params = {}
40
41
  params[this.singular_class_name] = {
41
- "version": this.version,
42
- "ordered_member_ids": this.order
42
+ "version": this.version
43
43
  }
44
+ params[this.singular_class_name][this.sort_property] = this.order
44
45
  params["_method"] = "PATCH"
45
46
  return params
46
47
  }
@@ -15,7 +15,7 @@ module Hyrax
15
15
  # Removes a single embargo
16
16
  def destroy
17
17
  Hyrax::Actors::EmbargoActor.new(curation_concern).destroy
18
- flash[:notice] = embargo_history(curation_concern)
18
+ flash[:notice] = embargo_history(curation_concern).last
19
19
  if curation_concern.work? && work_has_file_set_members?(curation_concern)
20
20
  redirect_to confirm_permission_path
21
21
  else
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ module ValkyrieDownloadsControllerBehavior
4
+ def show_valkyrie
5
+ file_set_id = params.require(:id)
6
+ file_set = Hyrax.query_service.find_by(id: file_set_id)
7
+ send_file_contents_valkyrie(file_set)
8
+ end
9
+
10
+ private
11
+
12
+ def send_file_contents_valkyrie(file_set)
13
+ response.headers["Accept-Ranges"] = "bytes"
14
+ self.status = 200
15
+ use = params.fetch(:file, :original_file).to_sym
16
+ file_metadata = find_file_metadata(file_set: file_set, use: use)
17
+ return unless stale?(last_modified: file_metadata.updated_at, template: false)
18
+
19
+ file = Hyrax.storage_adapter.find_by(id: file_metadata.file_identifier)
20
+ prepare_file_headers_valkyrie(metadata: file_metadata, file: file)
21
+
22
+ # Warning - using the range header will load the range selection in to memory
23
+ # this can cause memory bloat
24
+ if request.headers['Range']
25
+ file.rewind
26
+ send_data send_range_valkyrie(file: file), data_options(file_metadata)
27
+ else
28
+ send_file file.disk_path
29
+ end
30
+ end
31
+
32
+ def data_options(file_metadata)
33
+ {
34
+ type: file_metadata.mime_type,
35
+ filename: file_metadata.original_filename,
36
+ disposition: "inline",
37
+ status: status
38
+ }
39
+ end
40
+
41
+ def send_range_valkyrie(file:)
42
+ _, range = request.headers['Range'].split('bytes=')
43
+ from, to = range.split('-').map(&:to_i)
44
+ to = file.size - 1 unless to
45
+ length = to - from + 1
46
+ response.headers['Content-Range'] = "bytes #{from}-#{to}/#{file.size}"
47
+ response.headers['Content-Length'] = length.to_s
48
+ self.status = 206
49
+ file.read from # Seek to start of requested range
50
+ file.read length
51
+ end
52
+
53
+ def prepare_file_headers_valkyrie(metadata:, file:, inline: false)
54
+ inline_display = ActiveRecord::Type::Boolean.new.cast(params.fetch(:inline, inline))
55
+ response.headers["Content-Disposition"] = "#{inline_display ? 'inline' : 'attachment'}; filename=#{metadata.original_filename}"
56
+ response.headers["Content-Type"] = metadata.mime_type
57
+ response.headers["Content-Length"] ||= (file.try(:size) || metadata.size.first).to_s
58
+ # Prevent Rack::ETag from calculating a digest over body
59
+ response.headers["Last-Modified"] = metadata.updated_at.utc.strftime("%a, %d %b %Y %T GMT")
60
+ self.content_type = metadata.mime_type
61
+ end
62
+
63
+ def find_file_metadata(file_set:, use: :original_file)
64
+ use = :thumbnail_file if use == :thumbnail
65
+ begin
66
+ use = Hyrax::FileMetadata::Use.uri_for(use: use)
67
+ rescue ArgumentError
68
+ raise Hyrax::ObjectNotFoundError
69
+ end
70
+ results = Hyrax.custom_queries.find_many_file_metadata_by_use(resource: file_set, use: use)
71
+ results.first || raise(Hyrax::ObjectNotFoundError)
72
+ end
73
+ end
74
+ end
@@ -125,7 +125,7 @@ module Hyrax
125
125
  end
126
126
 
127
127
  def file_manager
128
- @form = Forms::FileManagerForm.new(curation_concern, current_ability)
128
+ @form = presenter
129
129
  end
130
130
 
131
131
  def inspect_work
@@ -180,15 +180,18 @@ module Hyrax
180
180
 
181
181
  ##
182
182
  # @return [#errors]
183
+ # rubocop:disable Metrics/MethodLength
183
184
  def create_valkyrie_work
184
185
  form = build_form
185
- return after_create_error(form_err_msg(form)) unless form.validate(params[hash_key_for_curation_concern])
186
+ # fallback to an empty hash to avoid: # NoMethodError: undefined method `has_key?` for nil:NilClass
187
+ original_input_params_for_form = params[hash_key_for_curation_concern] ? params[hash_key_for_curation_concern] : {}
188
+ return after_create_error(form_err_msg(form), original_input_params_for_form) unless form.validate(original_input_params_for_form)
186
189
 
187
190
  result =
188
191
  transactions['change_set.create_work']
189
192
  .with_step_args(
190
193
  'work_resource.add_to_parent' => { parent_id: params[:parent_id], user: current_user },
191
- 'work_resource.add_file_sets' => { uploaded_files: uploaded_files, file_set_params: params[hash_key_for_curation_concern][:file_set] },
194
+ 'work_resource.add_file_sets' => { uploaded_files: uploaded_files, file_set_params: original_input_params_for_form[:file_set] },
192
195
  'change_set.set_user_as_depositor' => { user: current_user },
193
196
  'work_resource.change_depositor' => { user: ::User.find_by_user_key(form.on_behalf_of) },
194
197
  'work_resource.save_acl' => { permissions_params: form.input_params["permissions"] }
@@ -197,6 +200,7 @@ module Hyrax
197
200
  @curation_concern = result.value_or { return after_create_error(transaction_err_msg(result)) }
198
201
  after_create_response
199
202
  end
203
+ # rubocop:enable Metrics/MethodLength
200
204
 
201
205
  def update_valkyrie_work
202
206
  form = build_form
@@ -370,10 +374,15 @@ module Hyrax
370
374
  end
371
375
  end
372
376
 
377
+ def format_error_messages(errors)
378
+ # the error may already be a string
379
+ errors.respond_to?(:messages) ? errors.messages.values.flatten.join("\n") : errors
380
+ end
381
+
373
382
  def after_create_error(errors, original_input_params_for_form = nil)
374
383
  respond_to do |wants|
375
384
  wants.html do
376
- flash[:error] = errors.to_s
385
+ flash[:error] = format_error_messages(errors)
377
386
  rebuild_form(original_input_params_for_form) if original_input_params_for_form.present?
378
387
  render 'new', status: :unprocessable_entity
379
388
  end
@@ -402,7 +411,7 @@ module Hyrax
402
411
  def after_update_error(errors)
403
412
  respond_to do |wants|
404
413
  wants.html do
405
- flash[:error] = errors.to_s
414
+ flash[:error] = format_error_messages(errors)
406
415
  build_form unless @form.is_a? Hyrax::ChangeSet
407
416
  render 'edit', status: :unprocessable_entity
408
417
  end
@@ -15,9 +15,8 @@ module Hyrax
15
15
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
16
16
  add_breadcrumb t(:'hyrax.admin.sidebar.tasks'), '#'
17
17
  add_breadcrumb t(:'hyrax.admin.sidebar.workflow_review'), request.path
18
-
19
- @status_list = actionable_objects.reject(&:published?)
20
- @published_list = actionable_objects.select(&:published?)
18
+ assign_action_objects_params
19
+ @response = WorkflowResponse.new(actionable_objects.to_a, actionable_objects.total_count, current_page, per_page, under_review?)
21
20
  end
22
21
 
23
22
  private
@@ -30,5 +29,51 @@ module Hyrax
30
29
  @actionable_objects ||=
31
30
  Hyrax::Workflow::ActionableObjects.new(user: current_user)
32
31
  end
32
+
33
+ def current_page
34
+ @page ||= params.fetch('page', 1).to_i
35
+ end
36
+
37
+ def per_page
38
+ @per_page ||= params.fetch('per_page', 10).to_i
39
+ end
40
+
41
+ def assign_action_objects_params
42
+ actionable_objects.page = current_page
43
+ actionable_objects.per_page = per_page
44
+ actionable_objects.workflow_state_filter = (under_review? ? '!' : '') + deposited_workflow_state_name
45
+ end
46
+
47
+ def under_review?
48
+ @under_review = params['state'] != 'published'
49
+ end
50
+
51
+ class WorkflowResponse
52
+ attr_reader :total_count
53
+ attr_reader :current_page
54
+ attr_reader :per_page
55
+ attr_reader :docs
56
+ attr_reader :under_review
57
+
58
+ def initialize(docs, total_count, page, per_page, under_review)
59
+ @docs = docs
60
+ @total_count = total_count
61
+ @per_page = per_page.to_i
62
+ @current_page = page.to_i
63
+ @under_review = under_review
64
+ end
65
+
66
+ def total_pages
67
+ (total_count.to_f / per_page).ceil
68
+ end
69
+
70
+ def limit_value
71
+ docs.length
72
+ end
73
+
74
+ def viewing_under_review?
75
+ under_review
76
+ end
77
+ end
33
78
  end
34
79
  end
@@ -52,7 +52,7 @@ module Hyrax
52
52
  def update_document(obj)
53
53
  interpret_visiblity_params(obj)
54
54
  obj.attributes = work_params(admin_set_id: obj.admin_set_id).except(*visibility_params)
55
- obj.date_modified = Time.current.ctime
55
+ obj.date_modified = TimeService.time_in_utc
56
56
 
57
57
  InheritPermissionsJob.perform_now(obj)
58
58
  VisibilityCopyJob.perform_now(obj)
@@ -60,11 +60,30 @@ module Hyrax
60
60
  obj.save
61
61
  end
62
62
 
63
+ def valkyrie_update_document(obj)
64
+ form = form_class.new(obj, current_ability, nil)
65
+ return unless form.validate(params[form_class.model_class.model_name.param_key])
66
+
67
+ cleanup_form_fields form
68
+
69
+ result = transactions['change_set.update_work']
70
+ .with_step_args('work_resource.save_acl' => { permissions_params: form.input_params["permissions"] })
71
+ .call(form)
72
+ obj = result.value!
73
+
74
+ InheritPermissionsJob.perform_now(obj)
75
+ VisibilityCopyJob.perform_now(obj)
76
+ end
77
+
63
78
  def update
64
79
  case params["update_type"]
65
80
  when "update"
66
81
  batch.each do |doc_id|
67
- update_document(Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: doc_id, use_valkyrie: false))
82
+ if Hyrax.config.use_valkyrie?
83
+ valkyrie_update_document(Hyrax.query_service.find_by(id: doc_id))
84
+ else
85
+ update_document(Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: doc_id, use_valkyrie: false))
86
+ end
68
87
  end
69
88
  flash[:notice] = "Batch update complete"
70
89
  after_update
@@ -97,7 +116,7 @@ module Hyrax
97
116
  end
98
117
 
99
118
  def form_class
100
- Forms::BatchEditForm
119
+ Hyrax.config.use_valkyrie? ? Forms::ResourceBatchEditForm : Forms::BatchEditForm
101
120
  end
102
121
 
103
122
  def terms
@@ -105,7 +124,7 @@ module Hyrax
105
124
  end
106
125
 
107
126
  def work_params(extra_params = {})
108
- work_params = params[form_class.model_name.param_key] || ActionController::Parameters.new
127
+ work_params = params[form_class.model_class.model_name.param_key] || ActionController::Parameters.new
109
128
  form_class.model_attributes(work_params.merge(extra_params))
110
129
  end
111
130
 
@@ -135,5 +154,15 @@ module Hyrax
135
154
  redirect_to hyrax.dashboard_path
136
155
  end
137
156
  end
157
+
158
+ # Clean up form fields
159
+ # @param form Hyrax::Froms::ResourceBatchEditForm
160
+ def cleanup_form_fields(form)
161
+ form.lease = nil if form.lease && form.lease.fields['lease_expiration_date'].nil?
162
+ form.embargo = nil if form.embargo && form.embargo.fields['embargo_release_date'].nil?
163
+ form.fields.keys.each do |k|
164
+ form.fields[k] = nil if form.fields[k].is_a?(Array) && form.fields[k].blank?
165
+ end
166
+ end
138
167
  end
139
168
  end
@@ -3,6 +3,7 @@ module Hyrax
3
3
  class DownloadsController < ApplicationController
4
4
  include Hydra::Controller::DownloadBehavior
5
5
  include Hyrax::LocalFileDownloadsControllerBehavior
6
+ include Hyrax::ValkyrieDownloadsControllerBehavior
6
7
  include Hyrax::WorkflowsHelper # Provides #workflow_restriction?
7
8
 
8
9
  def self.default_content_path
@@ -12,6 +13,8 @@ module Hyrax
12
13
  # Render the 404 page if the file doesn't exist.
13
14
  # Otherwise renders the file.
14
15
  def show
16
+ return show_valkyrie if Hyrax.config.use_valkyrie?
17
+
15
18
  case file
16
19
  when ActiveFedora::File
17
20
  # For original files that are stored in fedora
@@ -39,7 +42,11 @@ module Hyrax
39
42
  end
40
43
 
41
44
  def file_set_parent(file_set_id)
42
- file_set = Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: file_set_id, use_valkyrie: Hyrax.config.use_valkyrie?)
45
+ file_set = if defined?(Wings) && Hyrax.metadata_adapter.is_a?(Wings::Valkyrie::MetadataAdapter)
46
+ Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: file_set_id, use_valkyrie: Hyrax.config.use_valkyrie?)
47
+ else
48
+ Hyrax.query_service.find_by(id: file_set_id)
49
+ end
43
50
  @parent ||=
44
51
  case file_set
45
52
  when Hyrax::Resource