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.
Files changed (170) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +157 -68
  3. data/.travis.yml +4 -1
  4. data/Gemfile +1 -0
  5. data/README.md +3 -3
  6. data/app/actors/hyrax/actors/collections_membership_actor.rb +5 -55
  7. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +6 -8
  8. data/app/actors/hyrax/actors/environment.rb +15 -0
  9. data/app/actors/hyrax/actors/interpret_visibility_actor.rb +22 -37
  10. data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +1 -1
  11. data/app/assets/stylesheets/hyrax/_collections.scss +5 -3
  12. data/app/assets/stylesheets/hyrax/dashboard.scss +3 -3
  13. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +21 -2
  14. data/app/controllers/hyrax/homepage_controller.rb +1 -1
  15. data/app/forms/hyrax/forms/work_form.rb +1 -1
  16. data/app/helpers/hyrax/collections_helper.rb +13 -0
  17. data/app/helpers/hyrax/hyrax_helper_behavior.rb +3 -3
  18. data/app/indexers/hyrax/admin_set_indexer.rb +1 -1
  19. data/app/indexers/hyrax/basic_metadata_indexer.rb +1 -1
  20. data/app/indexers/hyrax/collection_indexer.rb +3 -3
  21. data/app/indexers/hyrax/deep_indexing_service.rb +12 -12
  22. data/app/indexers/hyrax/file_set_indexer.rb +1 -1
  23. data/app/indexers/hyrax/indexes_workflow.rb +4 -4
  24. data/app/indexers/hyrax/work_indexer.rb +1 -1
  25. data/app/models/concerns/hyrax/basic_metadata.rb +2 -0
  26. data/app/models/concerns/hyrax/collection_behavior.rb +3 -3
  27. data/app/models/concerns/hyrax/file_set/querying.rb +1 -1
  28. data/app/models/concerns/hyrax/human_readable_type.rb +2 -2
  29. data/app/models/concerns/hyrax/solr_document/characterization.rb +23 -23
  30. data/app/models/concerns/hyrax/solr_document/metadata.rb +3 -2
  31. data/app/models/concerns/hyrax/solr_document_behavior.rb +3 -3
  32. data/app/models/concerns/hyrax/user.rb +10 -2
  33. data/app/presenters/hyrax/work_show_presenter.rb +2 -2
  34. data/app/renderers/hyrax/renderers/faceted_attribute_renderer.rb +1 -1
  35. data/app/search_builders/hyrax/collection_search_builder.rb +1 -1
  36. data/app/search_builders/hyrax/deposit_search_builder.rb +1 -1
  37. data/app/search_builders/hyrax/embargo_search_builder.rb +1 -1
  38. data/app/search_builders/hyrax/lease_search_builder.rb +1 -1
  39. data/app/services/hyrax/default_middleware_stack.rb +0 -4
  40. data/app/services/hyrax/statistics/file_sets/by_format.rb +1 -1
  41. data/app/services/hyrax/statistics/works/by_resource_type.rb +1 -1
  42. data/app/services/hyrax/visibility_intention.rb +78 -0
  43. data/app/views/catalog/_index_list_default.html.erb +3 -3
  44. data/app/views/catalog/_thumbnail_list_collection.html.erb +3 -2
  45. data/app/views/hyrax/base/_attribute_rows.html.erb +1 -0
  46. data/app/views/hyrax/base/_form_files.html.erb +2 -2
  47. data/app/views/hyrax/base/_form_visibility_component.html.erb +1 -1
  48. data/app/views/hyrax/base/_show_actions.html.erb +6 -6
  49. data/app/views/hyrax/base/show.html.erb +2 -2
  50. data/app/views/hyrax/batch_edits/_check_all.html.erb +1 -1
  51. data/app/views/hyrax/batch_edits/_delete_selected.html.erb +1 -1
  52. data/app/views/hyrax/collections/_show_document_list_row.html.erb +1 -1
  53. data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +1 -1
  54. data/app/views/hyrax/dashboard/show_admin.html.erb +4 -4
  55. data/app/views/records/show_fields/_based_near.html.erb +1 -1
  56. data/app/views/records/show_fields/_creator.html.erb +1 -1
  57. data/app/views/records/show_fields/_keyword.html.erb +1 -1
  58. data/app/views/records/show_fields/_language.html.erb +1 -1
  59. data/app/views/records/show_fields/_publisher.html.erb +1 -1
  60. data/app/views/records/show_fields/_resource_type.html.erb +1 -1
  61. data/app/views/records/show_fields/_subject.html.erb +1 -1
  62. data/config/initializers/samvera-nesting_indexer_initializer.rb +3 -3
  63. data/config/locales/hyrax.de.yml +35 -22
  64. data/config/locales/hyrax.en.yml +22 -2
  65. data/config/locales/hyrax.es.yml +21 -1
  66. data/config/locales/hyrax.fr.yml +21 -1
  67. data/config/locales/hyrax.it.yml +21 -1
  68. data/config/locales/hyrax.pt-BR.yml +21 -1
  69. data/config/locales/hyrax.zh.yml +21 -1
  70. data/hyrax.gemspec +7 -9
  71. data/lib/generators/hyrax/templates/catalog_controller.rb +1 -1
  72. data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +10 -10
  73. data/lib/generators/hyrax/work/templates/locale.pt-BR.yml.erb +1 -1
  74. data/lib/hyrax/configuration.rb +18 -0
  75. data/lib/hyrax/engine.rb +8 -0
  76. data/lib/hyrax/transactions/container.rb +6 -0
  77. data/lib/hyrax/transactions/destroy_work.rb +21 -0
  78. data/lib/hyrax/transactions/steps/destroy_work.rb +24 -0
  79. data/lib/hyrax/version.rb +1 -1
  80. data/lib/wings.rb +45 -0
  81. data/lib/wings/active_fedora_converter.rb +56 -0
  82. data/lib/wings/model_transformer.rb +158 -0
  83. data/lib/wings/resource_factory.rb +8 -0
  84. data/lib/wings/valkyrie/metadata_adapter.rb +29 -0
  85. data/lib/wings/valkyrie/persister.rb +50 -0
  86. data/lib/wings/valkyrie/query_service.rb +43 -0
  87. data/lib/wings/valkyrie/resource_factory.rb +45 -0
  88. data/lib/wings/valkyrizable.rb +24 -0
  89. data/lib/wings/value_mapper.rb +59 -0
  90. data/spec/abilities/collection_ability_spec.rb +5 -5
  91. data/spec/abilities/permission_template_ability_spec.rb +1 -1
  92. data/spec/actors/hyrax/actors/collections_membership_actor_spec.rb +6 -175
  93. data/spec/actors/hyrax/actors/create_with_remote_files_ordered_members_actor_spec.rb +30 -22
  94. data/spec/actors/hyrax/actors/interpret_visibility_actor_spec.rb +2 -0
  95. data/spec/controllers/catalog_controller_spec.rb +1 -1
  96. data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +1 -1
  97. data/spec/controllers/hyrax/batch_edits_controller_spec.rb +9 -9
  98. data/spec/controllers/hyrax/collections_controller_spec.rb +5 -5
  99. data/spec/controllers/hyrax/dashboard/collection_members_controller_spec.rb +16 -13
  100. data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +9 -9
  101. data/spec/controllers/hyrax/dashboard/nest_collections_controller_spec.rb +1 -1
  102. data/spec/controllers/hyrax/generic_works_controller_spec.rb +10 -1
  103. data/spec/controllers/hyrax/homepage_controller_spec.rb +3 -3
  104. data/spec/controllers/hyrax/my/shares_controller_spec.rb +1 -1
  105. data/spec/features/actor_stack_spec.rb +48 -0
  106. data/spec/features/catalog_search_spec.rb +2 -2
  107. data/spec/features/collection_multi_membership_spec.rb +2 -2
  108. data/spec/features/collection_spec.rb +7 -7
  109. data/spec/features/collection_type_spec.rb +2 -2
  110. data/spec/features/dashboard/collection_spec.rb +18 -18
  111. data/spec/features/delete_work_spec.rb +1 -1
  112. data/spec/features/search_spec.rb +2 -2
  113. data/spec/features/work_show_spec.rb +5 -2
  114. data/spec/forms/hyrax/forms/batch_upload_form_spec.rb +1 -0
  115. data/spec/forms/hyrax/forms/collection_form_spec.rb +5 -5
  116. data/spec/forms/hyrax/forms/permission_template_form_spec.rb +1 -1
  117. data/spec/forms/hyrax/forms/work_form_spec.rb +2 -0
  118. data/spec/helpers/blacklight_helper_spec.rb +3 -1
  119. data/spec/helpers/hyrax/collections_helper_spec.rb +42 -0
  120. data/spec/helpers/hyrax/dashboard_helper_behavior_spec.rb +4 -4
  121. data/spec/helpers/hyrax_helper_spec.rb +8 -4
  122. data/spec/hyrax/transactions/destroy_work_spec.rb +35 -0
  123. data/spec/hyrax/transactions/steps/destroy_work_spec.rb +33 -0
  124. data/spec/indexers/hyrax/collection_indexer_spec.rb +1 -1
  125. data/spec/jobs/characterize_job_spec.rb +1 -1
  126. data/spec/lib/hyrax/resource_sync/change_list_writer_spec.rb +35 -21
  127. data/spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb +1 -1
  128. data/spec/models/collection_spec.rb +18 -18
  129. data/spec/models/concerns/hyrax/collection_nesting_spec.rb +2 -2
  130. data/spec/models/file_set_spec.rb +2 -2
  131. data/spec/models/hyrax/collection_type_spec.rb +2 -2
  132. data/spec/models/user_spec.rb +26 -1
  133. data/spec/presenters/hyrax/collection_presenter_spec.rb +11 -11
  134. data/spec/presenters/hyrax/work_show_presenter_spec.rb +11 -0
  135. data/spec/search_builders/hyrax/collection_member_search_builder_spec.rb +1 -1
  136. data/spec/search_builders/hyrax/collection_search_builder_spec.rb +1 -1
  137. data/spec/search_builders/hyrax/dashboard/nested_collections_search_builder_spec.rb +1 -1
  138. data/spec/search_builders/hyrax/work_relation_spec.rb +1 -1
  139. data/spec/services/hyrax/adapters/nesting_index_adapter_spec.rb +2 -2
  140. data/spec/services/hyrax/collections/collection_member_service_spec.rb +2 -2
  141. data/spec/services/hyrax/collections/migration_service_spec.rb +27 -27
  142. data/spec/services/hyrax/collections/nested_collection_persistence_service_spec.rb +1 -1
  143. data/spec/services/hyrax/collections/nested_collection_query_service_spec.rb +38 -38
  144. data/spec/services/hyrax/curation_concern_spec.rb +1 -1
  145. data/spec/services/hyrax/default_middleware_stack_spec.rb +1 -2
  146. data/spec/services/hyrax/statistics/depositors/summary_spec.rb +1 -1
  147. data/spec/services/hyrax/statistics/works/by_resource_type_spec.rb +11 -4
  148. data/spec/services/hyrax/visibility_intention_spec.rb +144 -0
  149. data/spec/services/hyrax/workflow/changes_required_notification_spec.rb +1 -1
  150. data/spec/spec_helper.rb +10 -8
  151. data/spec/support/selectors.rb +10 -1
  152. data/spec/test_app_templates/Gemfile.extra +2 -0
  153. data/spec/test_app_templates/lib/generators/test_app_generator.rb +6 -0
  154. data/spec/views/catalog/_index_list_default.html.erb_spec.rb +3 -2
  155. data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +38 -5
  156. data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -1
  157. data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +9 -9
  158. data/spec/views/hyrax/base/show.html.erb_spec.rb +3 -2
  159. data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +3 -2
  160. data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +3 -2
  161. data/spec/wings/active_fedora_converter_spec.rb +31 -0
  162. data/spec/wings/model_transformer_spec.rb +288 -0
  163. data/spec/wings/valkyrie/metadata_adapter_spec.rb +10 -0
  164. data/spec/wings/valkyrie/persister_spec.rb +71 -0
  165. data/spec/wings/valkyrie/query_service_spec.rb +81 -0
  166. data/spec/wings/valkyrie/resource_factory_spec.rb +32 -0
  167. data/spec/wings/value_mapper_spec.rb +60 -0
  168. data/spec/wings_spec.rb +8 -0
  169. data/template.rb +3 -1
  170. metadata +86 -36
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ea3a1997ae611fde653f50e69be5447644b7c8c1
4
- data.tar.gz: 5bd79f0028981330bd6693986a36742ef5ff8c50
2
+ SHA256:
3
+ metadata.gz: 12ca8250128a0ea9333aacfe4a4b71832c0b1df954c5cd8299d2e8c9a897e097
4
+ data.tar.gz: ab169cfb14af7a7139e84070f1dce85532241b05654e20de78538799fbe6827a
5
5
  SHA512:
6
- metadata.gz: a191208ea915f67744c6b42a8f5fb8cc911d3f3c342f70420c74fd2c779919dc9fc4c3199a4ee27e8a59c1ba4c0c79d9452a80cc4994eaedc36998c4b2980316
7
- data.tar.gz: '0821db636ba2f45bb2cd19ef71d01ab6d99aecdd28d175e252484964ff2e62edba87ffabff8a8c969adf6d32ed73584e13b9ba3f88550636e4ff6aa00eef53f9'
6
+ metadata.gz: 3568d5aa17c020e9baafd2e450fe2aeb7748c7a0e32a9e921d774607e9a9dbd9a042edd04c19e7b023578c9dc50f4f43c2f3379d9eb73d61552c610adfb2eaee
7
+ data.tar.gz: 00d6e736c3741544c4b627b7746ebc8e50cadfaadea9bc362c3b159c2ba5f57cc23fe2756423a29b48bf7ad7533c25922865a091940882734f5253b266674ed7
@@ -2,99 +2,162 @@
2
2
  #
3
3
  # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
4
  #
5
- version: 2
6
- jobs:
7
- build:
5
+ version: 2.1
6
+ executors:
7
+ ruby:
8
8
  docker:
9
- - image: circleci/ruby:2.5.3-node-browsers-legacy
10
- - image: circleci/redis:4
11
- - image: ualbertalib/docker-fcrepo4:4.7
12
- environment:
13
- CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
14
- - image: solr:7-alpine
15
- command: bin/solr -cloud -noprompt -f -p 8985
16
-
17
- # Specify service dependencies here if necessary
18
- # CircleCI maintains a library of pre-built images
19
- # documented at https://circleci.com/docs/2.0/circleci-images/
20
- # - image: circleci/postgres:9.4
21
-
22
- working_directory: ~/repo
23
- parallelism: 2
24
-
9
+ - image: circleci/ruby:2.5.3
10
+ working_directory: ~/hyrax
25
11
  environment:
26
- RAILS_ENV: test
27
- RACK_ENV: test
28
- FCREPO_TEST_PORT: 8080/fcrepo
12
+ BUNDLE_PATH: vendor/bundle
29
13
  BUNDLE_JOBS: 4
30
14
  BUNDLE_RETRY: 3
31
- NOKOGIRI_USE_SYSTEM_LIBRARIES: true
32
- ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
33
- SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
34
- COVERALLS_PARALLEL: true
35
15
 
16
+ jobs:
17
+ bundle:
18
+ executor: ruby
36
19
  steps:
37
20
  - restore_cache:
38
21
  keys:
39
- - source-v1-{{ .Branch }}-{{ .Revision }}
40
- - source-v1-{{ .Branch }}-
41
- - source-v1-
22
+ - v1-source-{{ .Branch }}-{{ .Revision }}
23
+ - v1-source-{{ .Branch }}-
24
+ - v1-source-
42
25
 
43
26
  - checkout
44
27
 
45
28
  - save_cache:
46
- key: source-v1-{{ .Branch }}-{{ .Revision }}
29
+ key: v1-source-{{ .Branch }}-{{ .Revision }}
47
30
  paths:
48
31
  - ".git"
49
32
 
50
- # BUNDLE_PATH is unset to allow for `bundle config path` to take precedence.
51
- - run:
52
- name: Extra environment setup
53
- command: |
54
- echo 'unset BUNDLE_PATH' >> $BASH_ENV
55
-
56
33
  - restore_cache:
57
34
  keys:
58
- - v1-internal-test-app-{{ .Branch }}
59
- - v1-internal-test-app-
60
-
61
- # Download and cache dependencies
62
- - restore_cache:
63
- keys:
64
- - v1-dependencies-{{ .Branch }}-{{ checksum "./.internal_test_app/.generated_engine_cart" }}
65
- - v1-dependencies-{{ .Branch }}
66
- - v1-dependencies-
35
+ - v1-bundle-{{ checksum "Gemfile" }}--{{ checksum "hyrax.gemspec" }}
36
+ - v1-bundle
67
37
 
68
38
  - run:
69
39
  name: Install dependencies
70
- command: |
71
- gem update --system
72
- gem update bundler
73
- bundle config path $CIRCLE_WORKING_DIRECTORY/vendor/bundle
74
- bundle install
40
+ command: bundle check || bundle install
41
+
42
+ - save_cache:
43
+ key: v1-bundle-{{ checksum "Gemfile.lock" }}--{{ checksum "hyrax.gemspec" }}
44
+ paths:
45
+ - ~/hyrax/vendor/bundle
46
+
47
+ - persist_to_workspace:
48
+ root: ~/
49
+ paths:
50
+ - hyrax/*
51
+ - hyrax/**/*
52
+
53
+ lint:
54
+ executor: ruby
55
+ steps:
56
+ - attach_workspace:
57
+ at: ~/
75
58
 
76
59
  - run:
77
60
  name: Call Rubocop
78
61
  command: bundle exec rubocop
79
62
 
63
+ build:
64
+ docker:
65
+ - image: circleci/ruby:2.5.3-node
66
+
67
+ working_directory: ~/hyrax
68
+
69
+ environment:
70
+ BUNDLE_PATH: vendor/bundle
71
+ BUNDLE_JOBS: 4
72
+ BUNDLE_RETRY: 3
73
+ RAILS_ENV: test
74
+ RACK_ENV: test
75
+ FCREPO_TEST_PORT: 8080/fcrepo
76
+ NOKOGIRI_USE_SYSTEM_LIBRARIES: true
77
+ ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
78
+ SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
79
+ COVERALLS_PARALLEL: true
80
+
81
+ steps:
82
+ - attach_workspace:
83
+ at: ~/
84
+ # Update to the latest release of Chrome
85
+ - run: wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
86
+ - run: sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
87
+ - run: sudo apt-get update
88
+ - run: sudo apt-get -y install google-chrome-stable
89
+ - restore_cache:
90
+ keys:
91
+ - v1-test-app-{{ checksum "template.rb" }}--{{ checksum "Gemfile.lock" }}
92
+
93
+ - run:
94
+ name: Check dependencies
95
+ command: bundle check || bundle install
96
+
97
+ - run:
98
+ name: Generate test app
99
+ command: (git diff --name-only master | grep -qG 'generators\/hyrax') || bundle exec rake engine_cart:generate
100
+
80
101
  - run:
81
- name: Generate test app, ensure top-level Gemfile.lock is valid
102
+ name: Ensure test app dependencies are installed
82
103
  command: |
83
- bundle exec rake engine_cart:generate
84
- bundle install
104
+ cd .internal_test_app
105
+ bundle check || bundle install
85
106
 
86
107
  - save_cache:
108
+ key: v1-test-app-{{ checksum "template.rb" }}--{{ checksum "Gemfile.lock" }}
87
109
  paths:
88
- - ./.internal_test_app
89
- key: v1-internal-test-app-{{ .Branch }}-{{ checksum "./.internal_test_app/.generated_engine_cart" }}
110
+ - ".internal_test_app"
111
+
112
+ - persist_to_workspace:
113
+ root: ~/
114
+ paths:
115
+ - hyrax/*
116
+ - hyrax/**/*
117
+
118
+ test:
119
+ docker:
120
+ - image: circleci/ruby:2.6.0-node-browsers-legacy
121
+ - image: circleci/redis:4
122
+ - image: ualbertalib/docker-fcrepo4:4.7
123
+ environment:
124
+ CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
125
+ - image: solr:7-alpine
126
+ command: bin/solr -cloud -noprompt -f -p 8985
127
+
128
+ working_directory: ~/hyrax
129
+ parallelism: 2
130
+
131
+ environment: &spec_env
132
+ BUNDLE_PATH: vendor/bundle
133
+ BUNDLE_JOBS: 4
134
+ BUNDLE_RETRY: 3
135
+ RAILS_ENV: test
136
+ RACK_ENV: test
137
+ FCREPO_TEST_PORT: 8080/fcrepo
138
+ NOKOGIRI_USE_SYSTEM_LIBRARIES: true
139
+ ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
140
+ SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
141
+ COVERALLS_PARALLEL: true
142
+
143
+ steps: &run_specs
144
+ - attach_workspace:
145
+ at: ~/
146
+
147
+ - run:
148
+ name: Ensure top-level Gemfile.lock is valid
149
+ command: bundle check || bundle install
90
150
 
91
151
  - run:
92
- name: Start headless Chrome
93
- command: google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 http://localhost
94
- background: true
152
+ name: Uninstall chromedriver Gems
153
+ command: gem uninstall -ax chromedriver-helper
95
154
 
96
155
  - run:
97
- name: Load config into SolrCloud
156
+ name: Install chromedriver Gems
157
+ command: gem install chromedriver-helper
158
+
159
+ - run:
160
+ name: Load config into solr
98
161
  command: |
99
162
  cd .internal_test_app/solr/config
100
163
  zip -1 -r solr_hyrax_config.zip ./*
@@ -107,18 +170,44 @@ jobs:
107
170
  mkdir /tmp/test-results
108
171
  bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
109
172
 
110
- - run:
111
- name: Clean dependencies
112
- command: bundle clean
113
-
114
- - save_cache:
115
- paths:
116
- - ./vendor/bundle
117
- key: v1-dependencies-{{ .Branch }}-{{ checksum "./.internal_test_app/.generated_engine_cart" }}
118
-
119
173
  # collect reports
120
174
  - store_test_results:
121
175
  path: /tmp/test-results
122
176
  - store_artifacts:
123
177
  path: /tmp/test-results
124
178
  destination: test-results
179
+
180
+ test-ruby-2-5:
181
+ docker:
182
+ - image: circleci/ruby:2.5.3-node-browsers-legacy
183
+ - image: circleci/redis:4
184
+ - image: ualbertalib/docker-fcrepo4:4.7
185
+ environment:
186
+ CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
187
+ - image: solr:7-alpine
188
+ command: bin/solr -cloud -noprompt -f -p 8985
189
+
190
+ working_directory: ~/hyrax
191
+ parallelism: 2
192
+ environment: *spec_env
193
+ steps: *run_specs
194
+
195
+ workflows:
196
+ version: 2
197
+ ci:
198
+ jobs:
199
+ - bundle
200
+ - lint:
201
+ requires:
202
+ - bundle
203
+ - build:
204
+ requires:
205
+ - bundle
206
+ - test:
207
+ requires:
208
+ - build
209
+ - lint
210
+ - test-ruby-2-5:
211
+ requires:
212
+ - build
213
+ - lint
@@ -3,7 +3,9 @@ sudo: required
3
3
  dist: trusty
4
4
 
5
5
  addons:
6
- chrome: stable
6
+ apt:
7
+ packages:
8
+ - chromium-chromedriver
7
9
  cache:
8
10
  bundler: true
9
11
 
@@ -31,3 +33,4 @@ services:
31
33
  - redis-server
32
34
  before_script:
33
35
  - jdk_switcher use oraclejdk8
36
+ - ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec
5
5
 
6
6
  group :development, :test do
7
7
  gem 'coveralls', require: false
8
+ gem 'easy_translate'
8
9
  gem 'i18n-tasks'
9
10
  gem 'pry' unless ENV['CI']
10
11
  gem 'pry-byebug' unless ENV['CI']
data/README.md CHANGED
@@ -64,7 +64,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
64
64
  # Getting started
65
65
 
66
66
  This document contains instructions specific to setting up an app with __Hyrax
67
- v3.0.0-beta1__. If you are looking for instructions on installing a different
67
+ v3.0.0-beta2__. If you are looking for instructions on installing a different
68
68
  version, be sure to select the appropriate branch or tag from the drop-down
69
69
  menu above.
70
70
 
@@ -133,7 +133,7 @@ Note here that the following commands assume you're setting up Hyrax in a develo
133
133
 
134
134
  First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
135
135
 
136
- Hyrax supports Ruby 2.3, 2.4 and 2.5. When starting a new project, we recommend using the latest Ruby 2.5 version.
136
+ Hyrax supports Ruby 2.4, 2.5, and 2.6. When starting a new project, we recommend using the latest Ruby 2.6 version.
137
137
 
138
138
  ## Redis
139
139
 
@@ -163,7 +163,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
163
163
  Generate a new Rails application using the template.
164
164
 
165
165
  ```
166
- rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.4.0/template.rb
166
+ rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.0-beta2/template.rb
167
167
  ```
168
168
 
169
169
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -32,13 +32,9 @@ module Hyrax
32
32
  # @return [Boolean]
33
33
  #
34
34
  # rubocop:disable Metrics/MethodLength
35
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
36
35
  def assign_nested_attributes_for_collection(env)
37
36
  attributes_collection = env.attributes.delete(:member_of_collections_attributes)
38
-
39
- return assign_for_collection_ids(env) unless attributes_collection
40
-
41
- emit_deprecation if env.attributes.delete(:member_of_collection_ids)
37
+ return true unless attributes_collection
42
38
 
43
39
  return false unless
44
40
  valid_membership?(env, collection_ids: attributes_collection.map { |_, attributes| attributes['id'] })
@@ -58,46 +54,6 @@ module Hyrax
58
54
  true
59
55
  end
60
56
  # rubocop:enable Metrics/MethodLength
61
- # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
62
-
63
- ##
64
- # @deprecated supports old :member_of_collection_ids arguments
65
- def emit_deprecation
66
- Deprecation.warn(self, ':member_of_collections_attributes and :member_of_collection_ids were both ' \
67
- ' passed. :member_of_collection_ids is ignored when both are passed and is ' \
68
- 'deprecated for removal in Hyrax 3.0.')
69
- end
70
-
71
- ##
72
- # @deprecated supports old :member_of_collection_ids arguments
73
- def assign_for_collection_ids(env)
74
- collection_ids = env.attributes.delete(:member_of_collection_ids)
75
-
76
- return false unless valid_membership?(env, collection_ids: collection_ids)
77
-
78
- if collection_ids
79
- Deprecation.warn(self, ':member_of_collection_ids has been deprecated for removal in Hyrax 3.0. ' \
80
- 'use :member_of_collections_attributes instead.')
81
-
82
- collection_ids = [] if collection_ids.empty?
83
- other_collections = collections_without_edit_access(env)
84
-
85
- collections = ::Collection.find(collection_ids)
86
- raise "Tried to assign collections with ids: #{collection_ids}, but none were found" unless
87
- collections
88
-
89
- env.curation_concern.member_of_collections = collections
90
- env.curation_concern.member_of_collections.concat(other_collections)
91
- end
92
-
93
- true
94
- end
95
-
96
- ##
97
- # @deprecated supports old :member_of_collection_ids arguments
98
- def collections_without_edit_access(env)
99
- env.curation_concern.member_of_collections.select { |coll| env.current_ability.cannot?(:edit, coll) }
100
- end
101
57
 
102
58
  # Adds the item to the ordered members so that it displays in the items
103
59
  # along side the FileSets on the show page
@@ -140,17 +96,11 @@ module Hyrax
140
96
  attributes_collection =
141
97
  env.attributes.fetch(:member_of_collections_attributes) { nil }
142
98
 
143
- if attributes_collection
144
- # Determine if the work is being created in one and only one collection.
145
- return unless attributes_collection && attributes_collection.size == 1
99
+ # Determine if the work is being created in one and only one collection.
100
+ return unless attributes_collection && attributes_collection.size == 1
146
101
 
147
- # Extract the collection id from attributes_collection,
148
- collection_id = attributes_collection.first.second['id']
149
- else
150
- collection_ids = env.attributes.fetch(:member_of_collection_ids) { [] }
151
- return unless collection_ids.size == 1
152
- collection_id = collection_ids.first
153
- end
102
+ # Extract the collection id from attributes_collection,
103
+ collection_id = attributes_collection.first.second['id']
154
104
 
155
105
  # Do not apply permissions to work if collection type is configured not to
156
106
  collection = ::Collection.find(collection_id)
@@ -42,13 +42,11 @@ module Hyrax
42
42
  # Browse everything may also return a local file. And although it's in the
43
43
  # url property, it may have spaces, and not be a valid URI.
44
44
  class CreateWithRemoteFilesOrderedMembersActor < CreateWithRemoteFilesActor
45
- attr_reader :ordered_members
46
-
47
45
  # @param [HashWithIndifferentAccess] remote_files
48
46
  # @return [TrueClass]
49
47
  def attach_files(env, remote_files)
50
48
  return true unless remote_files
51
- @ordered_members = env.curation_concern.ordered_members.to_a
49
+ env.store(self, :ordered_members, env.curation_concern.ordered_members.to_a)
52
50
  remote_files.each do |file_info|
53
51
  next if file_info.blank? || file_info[:url].blank?
54
52
  # Escape any space characters, so that this is a legal URI
@@ -60,7 +58,7 @@ module Hyrax
60
58
  auth_header = file_info.fetch(:auth_header, {})
61
59
  create_file_from_url(env, uri, file_info[:file_name], auth_header)
62
60
  end
63
- add_ordered_members(env.user, env.curation_concern)
61
+ add_ordered_members(env)
64
62
  true
65
63
  end
66
64
 
@@ -72,7 +70,7 @@ module Hyrax
72
70
  actor.create_metadata(visibility: env.curation_concern.visibility)
73
71
  actor.attach_to_work(env.curation_concern)
74
72
  fs.save!
75
- ordered_members << fs
73
+ env.retrieve(self, :ordered_members) << fs
76
74
  if uri.scheme == 'file'
77
75
  # Turn any %20 into spaces.
78
76
  file_path = CGI.unescape(uri.path)
@@ -84,9 +82,9 @@ module Hyrax
84
82
  end
85
83
 
86
84
  # Add all file_sets as ordered_members in a single action
87
- def add_ordered_members(user, work)
88
- actor = Hyrax::Actors::OrderedMembersActor.new(ordered_members, user)
89
- actor.attach_ordered_members_to_work(work)
85
+ def add_ordered_members(env)
86
+ actor = Hyrax::Actors::OrderedMembersActor.new(env.retrieve(self, :ordered_members), env.user)
87
+ actor.attach_ordered_members_to_work(env.curation_concern)
90
88
  end
91
89
 
92
90
  class_attribute :file_set_actor_class