hyrax 3.4.2 → 3.5.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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/actors/hyrax/actors/collections_membership_actor.rb +1 -1
  3. data/app/actors/hyrax/actors/embargo_actor.rb +11 -4
  4. data/app/actors/hyrax/actors/lease_actor.rb +11 -4
  5. data/app/assets/javascripts/hyrax/app.js.erb +1 -1
  6. data/app/assets/javascripts/hyrax/permissions/control.es6 +8 -1
  7. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +11 -2
  8. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +11 -2
  9. data/app/controllers/concerns/hyrax/manages_embargoes.rb +13 -1
  10. data/app/controllers/hyrax/dashboard/collections_controller.rb +1 -2
  11. data/app/controllers/hyrax/downloads_controller.rb +16 -1
  12. data/app/controllers/hyrax/file_sets_controller.rb +10 -1
  13. data/app/controllers/hyrax/permissions_controller.rb +1 -1
  14. data/app/controllers/hyrax/transfers_controller.rb +0 -2
  15. data/app/controllers/hyrax/workflow_actions_controller.rb +3 -2
  16. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +2 -0
  17. data/app/forms/hyrax/forms/embargo.rb +13 -0
  18. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  19. data/app/forms/hyrax/forms/file_set_form.rb +8 -35
  20. data/app/forms/hyrax/forms/lease.rb +13 -0
  21. data/app/forms/hyrax/forms/pcdm_object_form.rb +46 -0
  22. data/app/forms/hyrax/forms/resource_form.rb +36 -32
  23. data/app/forms/hyrax/forms/work_embargo_form.rb +35 -0
  24. data/app/forms/hyrax/forms/work_lease_form.rb +35 -0
  25. data/app/helpers/hyrax/embargo_helper.rb +11 -0
  26. data/app/helpers/hyrax/lease_helper.rb +11 -0
  27. data/app/indexers/hyrax/pcdm_collection_indexer.rb +1 -0
  28. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -8
  29. data/app/jobs/content_event_job.rb +1 -1
  30. data/app/models/concerns/hyrax/collection_behavior.rb +2 -1
  31. data/app/models/concerns/hyrax/collection_nesting.rb +10 -1
  32. data/app/models/concerns/hyrax/file_set_behavior.rb +1 -0
  33. data/app/models/concerns/hyrax/work_behavior.rb +2 -1
  34. data/app/models/hyrax/embargo.rb +1 -1
  35. data/app/models/hyrax/file_set.rb +3 -3
  36. data/app/models/hyrax/lease.rb +1 -1
  37. data/app/models/proxy_deposit_request.rb +1 -1
  38. data/app/presenters/hyrax/permission_badge.rb +3 -2
  39. data/app/presenters/hyrax/version_list_presenter.rb +6 -1
  40. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +13 -5
  41. data/app/services/hyrax/collections/nested_collection_query_service.rb +1 -1
  42. data/app/services/hyrax/edit_permissions_service.rb +21 -3
  43. data/app/services/hyrax/embargo_manager.rb +9 -0
  44. data/app/services/hyrax/file_set_file_service.rb +55 -0
  45. data/app/services/hyrax/lease_manager.rb +9 -0
  46. data/app/services/hyrax/user_stat_importer.rb +2 -0
  47. data/app/services/hyrax/versioning_service.rb +77 -9
  48. data/app/services/hyrax/visibility_propagator.rb +5 -5
  49. data/app/services/hyrax/work_resource_query_service.rb +45 -0
  50. data/app/views/hyrax/base/_form_progress.html.erb +1 -1
  51. data/app/views/hyrax/base/_form_visibility_component.html.erb +5 -1
  52. data/app/views/hyrax/embargoes/edit.html.erb +3 -3
  53. data/app/views/hyrax/file_sets/_permission.html.erb +1 -1
  54. data/app/views/hyrax/file_sets/_permission_form.html.erb +1 -6
  55. data/app/views/hyrax/file_sets/edit.html.erb +2 -2
  56. data/app/views/hyrax/leases/edit.html.erb +3 -3
  57. data/app/views/hyrax/transfers/new.html.erb +1 -1
  58. data/config/locales/hyrax.de.yml +2 -1
  59. data/config/locales/hyrax.en.yml +3 -0
  60. data/config/locales/hyrax.es.yml +1 -0
  61. data/config/locales/hyrax.fr.yml +2 -1
  62. data/config/locales/hyrax.it.yml +1 -0
  63. data/config/locales/hyrax.pt-BR.yml +1 -0
  64. data/config/locales/hyrax.zh.yml +1 -0
  65. data/config/metadata/file_set_metadata.yaml +130 -0
  66. data/documentation/developing-your-hyrax-based-app.md +2 -2
  67. data/documentation/legacyREADME.md +3 -3
  68. data/hyrax.gemspec +2 -0
  69. data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +1 -1
  70. data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +1 -1
  71. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
  72. data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +1 -1
  73. data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +1 -1
  74. data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +1 -1
  75. data/lib/hyrax/active_fedora_dummy_model.rb +13 -0
  76. data/lib/hyrax/configuration.rb +9 -2
  77. data/lib/hyrax/errors.rb +2 -0
  78. data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +6 -0
  79. data/lib/hyrax/specs/shared_specs/indexers.rb +5 -0
  80. data/lib/hyrax/version.rb +1 -1
  81. data/lib/wings/valkyrie/storage.rb +6 -2
  82. data/template.rb +1 -1
  83. metadata +39 -3
@@ -13,7 +13,7 @@
13
13
  <fieldset class="set-access-controls">
14
14
  <section class="help-block">
15
15
  <p>
16
- <% if curation_concern.embargo_release_date %>
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.embargo_release_date %>
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.embargo_history.empty? %>
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,5 +1,5 @@
1
1
  <div id="permissions_display" class="tab-pane">
2
- <%= simple_form_for [main_app, file_set],
2
+ <%= simple_form_for [main_app, form_object],
3
3
  html: { multipart: true,
4
4
  id: 'permission',
5
5
  data: { param_key: file_set.model_name.param_key },
@@ -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/form_permission', f: f %>
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(curation_concern.to_presenter), file_set: curation_concern.to_presenter %>
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.lease_expiration_date %>
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.lease_expiration_date %>
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.lease_history.empty? %>
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 %>
@@ -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(@work) do |f| %>
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 %>
@@ -557,7 +557,7 @@ de:
557
557
  actions: Aktion
558
558
  title: Sammlungstitel
559
559
  form_permission:
560
- visibility: Sichtbarkeit <small> Wer sollte diesen Inhalt anzeigen oder herunterladen können? </ Small>
560
+ visibility: Sichtbarkeit <small> Wer sollte diesen Inhalt anzeigen oder herunterladen können? </small>
561
561
  form_permission_under_embargo:
562
562
  help_html: "<strong>Diese Arbeit ist unter Embargo.</strong> Hier können Sie die Einstellungen des Embargos ändern, oder Sie können den %{edit_link} besuchen, um ihn zu deaktivieren."
563
563
  legend_html: Sichtbarkeit <small>Wer sollte in der Lage sein, diesen Inhalt anzusehen oder herunterzuladen?</small>
@@ -596,6 +596,7 @@ de:
596
596
  legend_html: Miniaturansicht
597
597
  form_visibility_component:
598
598
  visibility: Sichtbarkeit
599
+ subtitle_html: <small>Wer sollte diesen Inhalt anzeigen oder herunterladen können?</small>
599
600
  inspect_work:
600
601
  back_to: Zurück zu
601
602
  entity_id: Mandanten-ID
@@ -588,6 +588,7 @@ en:
588
588
  legend_html: Thumbnail
589
589
  form_visibility_component:
590
590
  visibility: Visibility
591
+ subtitle_html: <small>Who should be able to view or download this content?</small>
591
592
  inspect_work:
592
593
  back_to: Back to
593
594
  entity_id: Entity ID
@@ -1687,6 +1688,8 @@ en:
1687
1688
  note_html: Keep to myself with option to share.
1688
1689
  text: Private
1689
1690
  restricted_title_attr: Change the visibility of this resource
1691
+ unknown:
1692
+ text: Unknown
1690
1693
  work_button_row:
1691
1694
  attach_child: Attach Child
1692
1695
  workflow:
@@ -601,6 +601,7 @@ es:
601
601
  legend_html: Miniatura
602
602
  form_visibility_component:
603
603
  visibility: La visibilidad
604
+ subtitle_html: <small>¿Quién debería poder ver o descargar este contenido?</small>
604
605
  inspect_work:
605
606
  back_to: De regreso
606
607
  entity_id: ID de entidad
@@ -563,7 +563,7 @@ fr:
563
563
  actions: action
564
564
  title: Titre de la collection
565
565
  form_permission:
566
- visibility: Visibilité <small> Qui devrait être en mesure d’afficher ou de télécharger ce contenu? </ Small>
566
+ visibility: Visibilité <small> Qui devrait être en mesure d’afficher ou de télécharger ce contenu? </small>
567
567
  form_permission_under_embargo:
568
568
  help_html: "<strong>Ce travail est sous embargo.</strong> Vous pouvez modifier les paramètres de l'embargo ici, ou vous pouvez visiter le %{edit_link} pour le désactiver."
569
569
  legend_html: Visibilité <small>Qui devrait pouvoir afficher ou télécharger ce contenu?</small>
@@ -602,6 +602,7 @@ fr:
602
602
  legend_html: La vignette
603
603
  form_visibility_component:
604
604
  visibility: Visibilité
605
+ subtitle_html: <small>Qui devrait être en mesure d’afficher ou de télécharger ce contenu?</small>
605
606
  inspect_work:
606
607
  back_to: Retour à
607
608
  entity_id: ID d'entité
@@ -601,6 +601,7 @@ it:
601
601
  legend_html: Thumbnail
602
602
  form_visibility_component:
603
603
  visibility: Visibilità
604
+ subtitle_html: <small>Chi dovrebbe essere in grado di visualizzare o scaricare questo contenuto?</small>
604
605
  inspect_work:
605
606
  back_to: Torna a
606
607
  entity_id: ID entità
@@ -596,6 +596,7 @@ pt-BR:
596
596
  legend_html: Miniatura
597
597
  form_visibility_component:
598
598
  visibility: Visibilidade
599
+ subtitle_html: <small>Quem deve conseguir visualizar ou baixar este conteúdo?</small>
599
600
  inspect_work:
600
601
  back_to: De volta a
601
602
  entity_id: ID da entidade
@@ -599,6 +599,7 @@ zh:
599
599
  legend_html: 缩略图
600
600
  form_visibility_component:
601
601
  visibility: 可见性
602
+ subtitle_html: <small>谁应该能够查看或下载此内容?</ small>
602
603
  inspect_work:
603
604
  back_to: 回到
604
605
  entity_id: 实体ID
@@ -0,0 +1,130 @@
1
+ # This is the metadata used for `Hyrax::FileSet`s.` It is similar to
2
+ # `basic_metadata.yaml`, but not exactly the same.
3
+ #
4
+ # Terms which are already present in `core_metadata.yaml` are not repeated here.
5
+ attributes:
6
+ # Required attributes:
7
+ creator:
8
+ type: string
9
+ multiple: true
10
+ form:
11
+ required: true
12
+ primary: true
13
+ index_keys:
14
+ - "creator_tesim"
15
+ license:
16
+ type: string
17
+ multiple: true
18
+ form:
19
+ required: true
20
+ primary: true
21
+
22
+ # Other attributes:
23
+ abstract:
24
+ type: string
25
+ multiple: true
26
+ # form:
27
+ # primary: false
28
+ # missing: access_right
29
+ # missing: alternative_title
30
+ based_near:
31
+ type: string
32
+ multiple: true
33
+ form:
34
+ primary: false
35
+ index_keys:
36
+ - "based_near_sim"
37
+ - "based_near_tesim"
38
+ # missing: bibliograpic_citation
39
+ contributor:
40
+ type: string
41
+ multiple: true
42
+ form:
43
+ primary: false
44
+ # required: creator
45
+ date_created:
46
+ type: date_time
47
+ multiple: true
48
+ form:
49
+ primary: false
50
+ index_keys:
51
+ - "date_created_tesim"
52
+ description:
53
+ type: string
54
+ multiple: true
55
+ form:
56
+ primary: false
57
+ index_keys:
58
+ - "description_tesim"
59
+ identifier:
60
+ type: string
61
+ multiple: true
62
+ form:
63
+ primary: false
64
+ # missing: import_url
65
+ keyword:
66
+ type: string
67
+ multiple: true
68
+ form:
69
+ primary: false
70
+ index_keys:
71
+ - "keyword_sim"
72
+ - "keyword_tesim"
73
+ # missing: publisher
74
+ label:
75
+ type: string
76
+ # form:
77
+ # primary: false
78
+ language:
79
+ type: string
80
+ multiple: true
81
+ form:
82
+ primary: false
83
+ # required: license
84
+ publisher:
85
+ type: string
86
+ multiple: true
87
+ form:
88
+ primary: false
89
+ related_url:
90
+ type: string
91
+ multiple: true
92
+ form:
93
+ primary: false
94
+ index_keys:
95
+ - "related_url_tesim"
96
+ relative_path:
97
+ type: string
98
+ resource_type:
99
+ type: string
100
+ multiple: true
101
+ # form:
102
+ # primary: false
103
+ index_keys:
104
+ - "resource_type_sim"
105
+ - "resource_type_tesim"
106
+ rights_notes:
107
+ type: string
108
+ multiple: true
109
+ # form:
110
+ # primary: false
111
+ rights_statement:
112
+ type: string
113
+ multiple: true
114
+ # form:
115
+ # primary: true
116
+ index_keys:
117
+ - "rights_statement_tesim"
118
+ source:
119
+ type: string
120
+ multiple: true
121
+ # form:
122
+ # primary: false
123
+ subject:
124
+ type: string
125
+ multiple: true
126
+ form:
127
+ primary: false
128
+ index_keys:
129
+ - "subject_sim"
130
+ - "subject_tesim"
@@ -109,7 +109,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
109
109
 
110
110
  ```
111
111
  # If you don't already have Rails at your disposal...
112
- gem install rails -v 5.2.6
112
+ gem install rails -v 5.2.8.1
113
113
  ```
114
114
 
115
115
  ### JavaScript runtime
@@ -125,7 +125,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
125
125
  Generate a new Rails application using the template.
126
126
 
127
127
  ```
128
- rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.4.2/template.rb
128
+ rails _5.2.8.1_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.5.0/template.rb
129
129
  ```
130
130
 
131
131
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -50,7 +50,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
50
50
  # Getting started
51
51
 
52
52
  This document contains instructions specific to setting up an app with __Hyrax
53
- v3.4.2__. If you are looking for instructions on installing a different
53
+ v3.5.0__. If you are looking for instructions on installing a different
54
54
  version, be sure to select the appropriate branch or tag from the drop-down
55
55
  menu above.
56
56
 
@@ -143,7 +143,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
143
143
 
144
144
  ```
145
145
  # If you don't already have Rails at your disposal...
146
- gem install rails -v 5.2.6
146
+ gem install rails -v 5.2.8.1
147
147
  ```
148
148
 
149
149
  ### JavaScript runtime
@@ -159,7 +159,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
159
159
  Generate a new Rails application using the template.
160
160
 
161
161
  ```
162
- rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.2/template.rb
162
+ rails _5.2.8.1_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.5.0/template.rb
163
163
  ```
164
164
 
165
165
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
data/hyrax.gemspec CHANGED
@@ -44,6 +44,7 @@ SUMMARY
44
44
  spec.add_dependency 'dry-events', '~> 0.2.0'
45
45
  spec.add_dependency 'dry-equalizer', '~> 0.2'
46
46
  spec.add_dependency 'dry-struct', '~> 1.0'
47
+ spec.add_dependency 'dry-monads', '< 1.5'
47
48
  spec.add_dependency 'dry-transaction', '~> 0.11'
48
49
  spec.add_dependency 'dry-validation', '~> 1.3'
49
50
  spec.add_dependency 'flipflop', '~> 2.3'
@@ -76,6 +77,7 @@ SUMMARY
76
77
  spec.add_dependency 'rails_autolink', '~> 1.1'
77
78
  spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
78
79
  spec.add_dependency 'rdf-vocab', '~> 3.0'
80
+ spec.add_dependency 'redis', '~> 4.0'
79
81
  spec.add_dependency 'redis-namespace', '~> 1.5'
80
82
  spec.add_dependency 'redlock', '>= 0.1.2'
81
83
  spec.add_dependency 'reform', '~> 2.3'
@@ -50,7 +50,7 @@ de:
50
50
  directory:
51
51
  suffix: "@ Example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2018 Samvera lizenziert</strong> unter der Apache Lizenz, Version 2.0"
53
+ copyright_html: "<strong>Copyright © 2022 Samvera lizenziert</strong> unter der Apache Lizenz, Version 2.0"
54
54
  service_html: Ein Dienst von <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Institution
56
56
  institution_name_full: Name des Instituts
@@ -50,7 +50,7 @@ en:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright &copy; 2018 Samvera</strong> Licensed under the Apache License, Version 2.0"
53
+ copyright_html: "<strong>Copyright &copy; 2022 Samvera</strong> Licensed under the Apache License, Version 2.0"
54
54
  service_html: A service of <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
55
55
  institution_name: Institution
56
56
  institution_name_full: The Institution Name
@@ -50,7 +50,7 @@ es:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright &copy; 2018 Samvera</strong> bajo licencia de Apache, Version 2.0"
53
+ copyright_html: "<strong>Copyright &copy; 2022 Samvera</strong> bajo licencia de Apache, Version 2.0"
54
54
  service_html: Un servicio de <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
55
55
  institution_name: institución
56
56
  institution_name_full: El nombre de la institución
@@ -50,7 +50,7 @@ fr:
50
50
  directory:
51
51
  suffix: "@ Example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2018 Samvera</strong> Licence sous Licence Apache, Version 2.0"
53
+ copyright_html: "<strong>Copyright © 2022 Samvera</strong> Licence sous Licence Apache, Version 2.0"
54
54
  service_html: Un service de <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Institution
56
56
  institution_name_full: Nom de l'établissement
@@ -50,7 +50,7 @@ it:
50
50
  directory:
51
51
  suffix: "@ example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2018 Samvera</strong> Licenza sotto la licenza Apache, versione 2.0"
53
+ copyright_html: "<strong>Copyright © 2022 Samvera</strong> Licenza sotto la licenza Apache, versione 2.0"
54
54
  service_html: Un servizio di <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Istituzione
56
56
  institution_name_full: Nome dell'Istituzione
@@ -50,7 +50,7 @@ zh:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>版权所有 &copy; 2018 Samvera</strong> 根据Apache许可证2.0版许可"
53
+ copyright_html: "<strong>版权所有 &copy; 2022 Samvera</strong> 根据Apache许可证2.0版许可"
54
54
  service_html: 的服务<a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
55
55
  institution_name: 机构
56
56
  institution_name_full: 机构名称
@@ -35,12 +35,25 @@ module Hyrax
35
35
  @id
36
36
  end
37
37
 
38
+ ##
39
+ # @api public
40
+ def to_key
41
+ [@id]
42
+ end
43
+
38
44
  ##
39
45
  # @api public
40
46
  def model_name
41
47
  @model.model_name
42
48
  end
43
49
 
50
+ ##
51
+ # @api public
52
+ # @return [String]
53
+ def human_readable_type
54
+ @model.human_readable_type
55
+ end
56
+
44
57
  ##
45
58
  # @api public
46
59
  #
@@ -875,10 +875,17 @@ module Hyrax
875
875
  end
876
876
  end
877
877
 
878
- attr_accessor :nested_relationship_reindexer
878
+ def use_solr_graph_for_collection_nesting
879
+ ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_USE_SOLR_GRAPH_NESTING', false))
880
+ end
879
881
 
882
+ attr_accessor :nested_relationship_reindexer
880
883
  def default_nested_relationship_reindexer
881
- ->(id:, extent:) { Samvera::NestingIndexer.reindex_relationships(id: id, extent: extent) }
884
+ if use_solr_graph_for_collection_nesting
885
+ ->(id:, extent:) {}
886
+ else
887
+ ->(id:, extent:) { Samvera::NestingIndexer.reindex_relationships(id: id, extent: extent) }
888
+ end
882
889
  end
883
890
 
884
891
  attr_writer :solr_select_path
data/lib/hyrax/errors.rb CHANGED
@@ -15,4 +15,6 @@ module Hyrax
15
15
  class SingleMembershipError < HyraxError; end
16
16
 
17
17
  class ObjectNotFoundError < ActiveFedora::ObjectNotFoundError; end
18
+
19
+ class ModelMismatchError < HyraxError; end
18
20
  end
@@ -3,6 +3,12 @@
3
3
  # @example
4
4
  # let(:resource) { FactoryBot.valkyrie_create(:hyrax_work) }
5
5
  class ValkyrieCreateStrategy
6
+ def initialize
7
+ @strategy = FactoryBot.strategy_by_name(:create).new
8
+ end
9
+
10
+ delegate :association, to: :@strategy
11
+
6
12
  def result(evaluation)
7
13
  evaluation.notify(:after_build, evaluation.object)
8
14
  evaluation.notify(:before_create, evaluation.object)
@@ -266,6 +266,11 @@ RSpec.shared_examples 'a Collection indexer' do
266
266
  .to include(generic_type_sim: a_collection_containing_exactly('Collection'))
267
267
  end
268
268
 
269
+ it 'indexes member_of_collection_ids' do
270
+ expect(indexer.to_solr)
271
+ .to include(member_of_collection_ids_ssim: resource.member_of_collection_ids)
272
+ end
273
+
269
274
  it 'indexes depositor' do
270
275
  expect(indexer.to_solr)
271
276
  .to include(depositor_ssim: [resource.depositor],
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '3.4.2'
3
+ VERSION = '3.5.0'
4
4
  end
@@ -73,7 +73,7 @@ module Wings
73
73
  version_graph.query([uri, RDF::Vocab::Fcrepo4.created, :created])
74
74
  .first_object
75
75
  .object
76
- Version.new(cast_to_valkyrie_id(uri.to_s), timestamp, self)
76
+ Version.new(id: cast_to_valkyrie_id(uri.to_s), created: timestamp, adapter: self)
77
77
  end.sort
78
78
  end
79
79
 
@@ -86,7 +86,7 @@ module Wings
86
86
  # this implementation uses an orderable {#version_token}. in practice
87
87
  # the token is the fcrepo created date for the version, as extracted from
88
88
  # the versions graph.
89
- Version = Struct.new(:id, :version_token, :adapter) do
89
+ Version = Struct.new("Version", :id, :created, :adapter, keyword_init: true) do
90
90
  include Comparable
91
91
 
92
92
  ##
@@ -95,6 +95,10 @@ module Wings
95
95
  adapter.find_by(id: id)
96
96
  end
97
97
 
98
+ def version_token
99
+ created
100
+ end
101
+
98
102
  def <=>(other)
99
103
  raise ArgumentError unless other.respond_to?(:version_token)
100
104
  version_token <=> other.version_token
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # Hack for https://github.com/rails/rails/issues/35153
3
3
  gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"'
4
- gem 'hyrax', '3.4.2'
4
+ gem 'hyrax', '3.5.0'
5
5
  run 'bundle install'
6
6
  generate 'hyrax:install', '-f'