hyrax 4.0.0.beta2 → 4.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +126 -53
  3. data/.dassie/Gemfile +1 -1
  4. data/.dassie/app/controllers/catalog_controller.rb +1 -1
  5. data/.dassie/config/initializers/hyrax.rb +4 -0
  6. data/.github/CONTRIBUTING.md +39 -27
  7. data/.github/SUPPORT.md +2 -3
  8. data/.github/workflows/main.yml +4 -4
  9. data/.github/workflows/release.yml +10 -4
  10. data/.koppie/Gemfile +1 -2
  11. data/.koppie/app/controllers/catalog_controller.rb +1 -1
  12. data/.koppie/config/authorities/licenses.yml +7 -7
  13. data/.koppie/config/initializers/file_services.rb +4 -0
  14. data/.koppie/db/schema.rb +2 -2
  15. data/.koppie/yarn.lock +1 -1
  16. data/.regen +1 -1
  17. data/CONTAINERS.md +5 -5
  18. data/CONTRIBUTING.md +2 -2
  19. data/Dockerfile +21 -9
  20. data/README.md +24 -97
  21. data/app/actors/hyrax/actors/create_with_files_actor.rb +1 -1
  22. data/app/assets/stylesheets/hyrax/_catalog.scss +4 -0
  23. data/app/assets/stylesheets/hyrax/_forms.scss +4 -0
  24. data/app/controllers/concerns/hyrax/controller.rb +3 -24
  25. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +1 -0
  26. data/app/controllers/hyrax/admin/strategies_controller.rb +2 -2
  27. data/app/controllers/hyrax/dashboard/collections_controller.rb +1 -1
  28. data/app/controllers/hyrax/downloads_controller.rb +16 -1
  29. data/app/controllers/hyrax/file_sets_controller.rb +9 -2
  30. data/app/controllers/hyrax/my/works_controller.rb +3 -1
  31. data/app/controllers/hyrax/transfers_controller.rb +4 -1
  32. data/app/controllers/hyrax/workflow_actions_controller.rb +3 -2
  33. data/app/forms/hyrax/forms/administrative_set_form.rb +1 -1
  34. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  35. data/app/forms/hyrax/forms/file_set_form.rb +8 -35
  36. data/app/forms/hyrax/forms/pcdm_collection_form.rb +2 -2
  37. data/app/forms/hyrax/forms/pcdm_object_form.rb +46 -0
  38. data/app/forms/hyrax/forms/permission.rb +2 -2
  39. data/app/forms/hyrax/forms/resource_form.rb +19 -44
  40. data/app/forms/hyrax/forms/work_embargo_form.rb +3 -3
  41. data/app/forms/hyrax/forms/work_lease_form.rb +3 -3
  42. data/app/helpers/hyrax/content_block_helper_behavior.rb +1 -1
  43. data/app/helpers/hyrax/hyrax_helper_behavior.rb +1 -1
  44. data/app/helpers/hyrax/iiif_helper.rb +1 -1
  45. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +1 -1
  46. data/app/jobs/characterize_job.rb +3 -2
  47. data/app/jobs/valkyrie_create_derivatives_job.rb +0 -2
  48. data/app/models/collection_branding_info.rb +7 -13
  49. data/app/models/concerns/hyrax/ability.rb +1 -1
  50. data/app/models/concerns/hyrax/collection_behavior.rb +0 -47
  51. data/app/models/concerns/hyrax/solr_document/metadata.rb +1 -0
  52. data/app/models/concerns/hyrax/suppressible.rb +0 -8
  53. data/app/models/file_download_stat.rb +4 -4
  54. data/app/models/hyrax/collection_type.rb +0 -16
  55. data/app/models/hyrax/file_metadata.rb +5 -12
  56. data/app/models/hyrax/file_set.rb +1 -9
  57. data/app/models/hyrax/permission_template.rb +1 -1
  58. data/app/models/hyrax/statistic.rb +4 -4
  59. data/app/models/sipity.rb +27 -6
  60. data/app/presenters/hyrax/collection_presenter.rb +1 -1
  61. data/app/presenters/hyrax/iiif_manifest_presenter.rb +15 -5
  62. data/app/presenters/hyrax/presenter_factory.rb +2 -2
  63. data/app/presenters/hyrax/work_show_presenter.rb +1 -1
  64. data/app/presenters/hyrax/workflow_presenter.rb +1 -1
  65. data/app/search_builders/hyrax/collection_search_builder.rb +1 -0
  66. data/app/search_builders/hyrax/filter_suppressed_with_roles.rb +1 -1
  67. data/app/services/hyrax/admin_set_service.rb +1 -1
  68. data/app/services/hyrax/collections/nested_collection_query_service.rb +2 -2
  69. data/app/services/hyrax/database_migrator.rb +1 -1
  70. data/app/services/hyrax/edit_permissions_service.rb +21 -3
  71. data/app/services/hyrax/restriction_service.rb +1 -1
  72. data/app/services/hyrax/solr_query_service.rb +10 -2
  73. data/app/services/hyrax/solr_service.rb +24 -18
  74. data/app/services/hyrax/thumbnail_path_service.rb +10 -2
  75. data/app/services/hyrax/valkyrie_persist_derivatives.rb +26 -15
  76. data/app/services/hyrax/valkyrie_upload.rb +23 -30
  77. data/app/services/hyrax/visibility_propagator.rb +5 -5
  78. data/app/services/hyrax/visibility_reader.rb +1 -1
  79. data/app/services/hyrax/visibility_writer.rb +1 -1
  80. data/app/services/hyrax/workflow/permission_query.rb +5 -5
  81. data/app/services/hyrax/workflow/status_list_service.rb +1 -1
  82. data/app/validators/hyrax/collection_membership_validator.rb +2 -2
  83. data/app/views/hyrax/base/_attribute_rows.html.erb +2 -0
  84. data/app/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb +1 -1
  85. data/app/views/hyrax/file_sets/_permission.html.erb +1 -1
  86. data/app/views/hyrax/file_sets/edit.html.erb +1 -1
  87. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
  88. data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
  89. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
  90. data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
  91. data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
  92. data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
  93. data/app/views/hyrax/uploads/_js_templates.html.erb +8 -8
  94. data/app/views/hyrax/uploads/_js_templates_branding.html.erb +2 -2
  95. data/app/views/hyrax/users/_vitals.html.erb +4 -4
  96. data/chart/hyrax/Chart.yaml +7 -7
  97. data/chart/hyrax/README.md +5 -0
  98. data/chart/hyrax/templates/_helpers.tpl +14 -6
  99. data/chart/hyrax/templates/cron-embargo.yaml +1 -1
  100. data/chart/hyrax/templates/cron-lease.yaml +1 -1
  101. data/chart/hyrax/templates/deployment-worker.yaml +2 -2
  102. data/chart/hyrax/templates/extra-list.yaml +8 -0
  103. data/chart/hyrax/templates/secrets.yaml +3 -3
  104. data/chart/hyrax/values.yaml +22 -15
  105. data/config/initializers/kaminari_engine_patch.rb +16 -0
  106. data/config/locales/hyrax.de.yml +7 -7
  107. data/config/locales/hyrax.es.yml +7 -7
  108. data/config/locales/hyrax.fr.yml +8 -8
  109. data/config/locales/hyrax.it.yml +7 -7
  110. data/config/locales/hyrax.pt-BR.yml +7 -7
  111. data/config/locales/hyrax.zh.yml +8 -8
  112. data/config/metadata/file_set_metadata.yaml +130 -0
  113. data/documentation/MAINTENANCE.md +77 -0
  114. data/documentation/developing-your-hyrax-based-app.md +2 -2
  115. data/documentation/legacyREADME.md +3 -3
  116. data/hyrax.gemspec +7 -10
  117. data/lib/generators/hyrax/templates/catalog_controller.rb +1 -1
  118. data/lib/hyrax/configuration.rb +16 -0
  119. data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +1 -1
  120. data/lib/hyrax/engine.rb +2 -1
  121. data/lib/hyrax/transactions/container.rb +0 -2
  122. data/lib/hyrax/transactions/steps/save_collection_banner.rb +1 -1
  123. data/lib/hyrax/transactions/steps/save_collection_logo.rb +1 -1
  124. data/lib/hyrax/transactions/transaction.rb +3 -2
  125. data/lib/hyrax/version.rb +1 -1
  126. data/lib/hyrax.rb +0 -1
  127. data/lib/valkyrie/indexing/solr/indexing_adapter.rb +1 -1
  128. data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
  129. data/lib/wings/valkyrie/storage.rb +4 -1
  130. data/samvera-fall-TM3.svg +376 -0
  131. data/template.rb +1 -1
  132. metadata +43 -85
  133. data/app/conversions/power_converters/polymorphic_type.rb +0 -9
  134. data/app/conversions/power_converters/sipity_action.rb +0 -11
  135. data/app/conversions/power_converters/sipity_action_name.rb +0 -10
  136. data/app/conversions/power_converters/sipity_agent.rb +0 -9
  137. data/app/conversions/power_converters/sipity_entity.rb +0 -14
  138. data/app/conversions/power_converters/sipity_role.rb +0 -10
  139. data/app/conversions/power_converters/sipity_workflow_id.rb +0 -17
  140. data/app/conversions/power_converters/sipity_workflow_state.rb +0 -13
  141. data/app/conversions/power_converters.rb +0 -7
data/CONTAINERS.md CHANGED
@@ -5,13 +5,13 @@ Our goal is to provide a practical, reusable reference environment for applicati
5
5
 
6
6
  The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](#docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
7
7
 
8
- There are two options for development environments to run:
8
+ There are two options for development environments to run:
9
9
 
10
10
  - [Dassie](#dassie-internal-test-app-with-activefedora) is the default internal test app that will run an ActiveFedora-based Hyrax web application using Fedora 4 as the backend storage. See [Troubleshooting Dassie](#troubleshooting-dassie) if you encounter any issues.
11
11
  - [Koppie](#koppie-internal-test-app-with-valkyrie-connector-to-postgres) is a newer internal test app that is a Valkyrie-based Hyrax web application that runs with PostGres as backend storage. It does not run ActiveFedora or use Fedora 4. See [Troubleshooting Koppie](#troubleshooting-koppie) if you encounter any issues.
12
12
 
13
13
  <!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
14
- ## Hyrax Engine Development
14
+ ## Hyrax Engine Development
15
15
 
16
16
  We support a `docker-compose`-based development environment for folks working on
17
17
  the Hyrax engine. This environment is substantially more like a Hyrax production
@@ -191,8 +191,8 @@ 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=v3.4.1 # or desired version
195
- git checkout $HYRAX_VERSION
194
+ export HYRAX_VERSION=v4.0.0.rc2 # or desired version
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) .
198
198
 
@@ -229,4 +229,4 @@ helm install -n hyrax --set image.tag=(git rev-parse HEAD) dassie chart/hyrax
229
229
  ```
230
230
 
231
231
  [ghcr]: https://docs.github.com/en/enterprise-cloud@latest/packages/working-with-a-github-packages-registry/working-with-the-container-registry
232
- [samvera-packages]: https://github.com/orgs/samvera/packages
232
+ [samvera-packages]: https://github.com/orgs/samvera/packages
data/CONTRIBUTING.md CHANGED
@@ -45,7 +45,7 @@ further details.
45
45
  ### Reporting Issues
46
46
 
47
47
  * Make sure you have a [GitHub account](https://github.com/signup/free)
48
- * Submit a [Github issue](https://github.com/samvera/{{library}}/issues/) by:
48
+ * Submit a [Github issue](https://github.com/samvera/hyrax/issues/) by:
49
49
  * Clearly describing the issue
50
50
  * Provide a descriptive summary
51
51
  * Explain the expected behavior
@@ -178,4 +178,4 @@ If you are uncertain, bring other contributors into the conversation by assignin
178
178
  * [General GitHub documentation](http://help.github.com/)
179
179
  * [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
180
180
  * [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
181
- * [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
181
+ * [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
data/Dockerfile CHANGED
@@ -1,9 +1,19 @@
1
- ARG RUBY_VERSION=2.7.6
2
- FROM ruby:$RUBY_VERSION-alpine3.15 as hyrax-base
1
+ ARG RUBY_VERSION=3.2.1
2
+
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
11
+
12
+ FROM ruby:$RUBY_VERSION-alpine3.16 as hyrax-base
3
13
 
4
14
  ARG DATABASE_APK_PACKAGE="postgresql-dev"
5
15
  ARG EXTRA_APK_PACKAGES="git"
6
- ARG RUBYGEMS_VERSION=3.3.20
16
+ ARG RUBYGEMS_VERSION=""
7
17
 
8
18
  RUN apk --no-cache upgrade && \
9
19
  apk --no-cache add acl \
@@ -33,6 +43,9 @@ ENV PATH="/app/samvera:$PATH"
33
43
  ENV RAILS_ROOT="/app/samvera/hyrax-webapp"
34
44
  ENV RAILS_SERVE_STATIC_FILES="1"
35
45
 
46
+ COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/
47
+ ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
48
+
36
49
  ENTRYPOINT ["hyrax-entrypoint.sh"]
37
50
  CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
38
51
 
@@ -49,22 +62,21 @@ ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nu
49
62
 
50
63
  FROM hyrax-base as hyrax-worker-base
51
64
 
52
- ENV MALLOC_ARENA_MAX=2
53
-
54
65
  USER root
55
66
  RUN apk --no-cache add bash \
56
67
  ffmpeg \
57
68
  mediainfo \
58
- openjdk11-jre \
69
+ openjdk17-jre \
59
70
  perl
60
71
  USER app
61
72
 
62
73
  RUN mkdir -p /app/fits && \
63
74
  cd /app/fits && \
64
- wget https://github.com/harvard-lts/fits/releases/download/1.5.1/fits-1.5.1.zip -O fits.zip && \
75
+ wget https://github.com/harvard-lts/fits/releases/download/1.6.0/fits-1.6.0.zip -O fits.zip && \
65
76
  unzip fits.zip && \
66
- rm fits.zip && \
67
- chmod a+x /app/fits/fits.sh
77
+ rm fits.zip tools/mediainfo/linux/libmediainfo.so.0 tools/mediainfo/linux/libzen.so.0 && \
78
+ chmod a+x /app/fits/fits.sh && \
79
+ sed -i 's/\(<tool.*TikaTool.*>\)/<!--\1-->/' /app/fits/xml/fits.xml
68
80
  ENV PATH="${PATH}:/app/fits"
69
81
 
70
82
  CMD bundle exec sidekiq
data/README.md CHANGED
@@ -11,25 +11,19 @@ Docs: [![Documentation Status](https://inch-ci.org/github/samvera/hyrax.svg?bran
11
11
  [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./.github/CONTRIBUTING.md)
12
12
  [![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
13
13
 
14
- Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/)
14
+ Jump in: [![Samvera Community Slack](https://img.shields.io/badge/samvera-slack-blueviolet)](https://samvera.slack.com/)
15
15
 
16
16
  ## Table of Contents
17
17
 
18
18
  * [What is Hyrax?](#what-is-hyrax)
19
- * [Feature Documentation](#feature-documentation)
20
- * [Support Policies](#support-policies)
21
- * [Help](#help)
22
- * [Working with Hyrax](#working-with-hyrax)
23
- * [Developing the Hyrax Engine](#developing-the-hyrax-engine)
24
- * [Contributing](#contributing)
25
- * [Release process](#release-process)
26
- * [Developing your Hyrax\-based Application](#developing-your-hyrax-based-application)
27
- * [Deploying your Hyrax\-based Application to production](#deploying-your-hyrax-based-application-to-production)
19
+ * [Getting Help and Asking Questions](#getting-help-and-asking-questions)
20
+ * [How to Run the Code](#how-to-run-the-code)
21
+ * [Contribute](#contribute)
22
+ * [Release Process](#release-process)
23
+ * [Deploy](#deploy)
28
24
  * [Acknowledgments](#acknowledgments)
29
25
  * [License](#license)
30
26
 
31
- <aside>Table of contents created by <a href="https://github.com/ekalinin/github-markdown-toc.go">gh-md-toc</a></aside>
32
-
33
27
  ## What is Hyrax?
34
28
 
35
29
  Hyrax is a [Ruby on Rails Engine](https://guides.rubyonrails.org/engines.html) built by the [Samvera community](https://samvera.org). Hyrax provides a foundation for creating many different digital repository applications.
@@ -44,112 +38,45 @@ Hyrax offers the ability to:
44
38
  * Enable/disable optional features via an administrative dashboard
45
39
  * And more (https://hyrax.samvera.org/about/)
46
40
 
47
- ## Feature Documentation
48
-
49
- * List of features: [Feature Matrix](https://github.com/samvera/hyrax/wiki/Feature-matrix)
50
- * Configuration and enabling features: [Hyrax Management Guide](https://github.com/samvera/hyrax/wiki/Hyrax-Management-Guide)
51
- * Walk-through on using features: [Hyrax Feature Guides](https://samvera.github.io/intro-to.html)
52
- * [Entity Relationship Diagram](./artifacts/entity-relationship-diagram.pdf)
53
- * For general information about Hyrax: [Hyrax Site](https://hyrax.samvera.org/)
54
- * A note about [versions of Hyrax](./documentation/note-about-versions.md)
55
-
56
- ## Support Policies
57
-
58
- * Hyrax 3.x supports the latest browser versions for Chrome, Firefox, Edge, and Safari.
59
-
60
- ## Help
61
-
62
- The Samvera community is here to help. Please see our [support guide](./.github/SUPPORT.md).
63
-
64
- ## Working with Hyrax
65
-
66
- There are two primary Hyrax development concerns:
67
-
68
- 1. Developing the Hyrax engine
69
- 2. Developing your Hyrax-based Application
70
-
71
- ### Developing the Hyrax Engine
72
-
73
- This is where you work on the code-base that will be used by yours and other Hyrax-based applications. We recommend using [Docker and Hyrax's engine development containers](./CONTAINERS.md).
41
+ ## Getting Help and Asking Questions
74
42
 
75
- <aside>
76
- <p><em><strong>Note:</em></strong> This is not the only path for Hyrax-engine development. In the past, <a href="./documentation/legacyREADME.md">we documented extensive steps</a> to install the various dependencies for Hyrax-engine development. There is also a <a href="https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide#quick-start-for-hyrax-development">Quick Start for Hyrax engine development</a> that outlines steps for working on the Hyrax engine.</p>
77
- <p>By moving to Docker, we are encoding the documentation steps for standing up a Hyrax-engine development environment.</p>
78
- </aside>
43
+ More detailed documentation about Hyrax is available on the [Hyrax Github Wiki](https://github.com/samvera/hyrax/wiki) but if you have questions or need help, please email the [Samvera community tech list](https://samvera.atlassian.net/wiki/spaces/samvera/pages/1171226735/Samvera+Community+Email+Lists#Samvera-Tech-(15-20-messages-per-week-on-average)) or stop by the #dev channel in the [Samvera community Slack team](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405211682/Getting+Started+in+the+Samvera+Community#Join-the-Samvera-Slack-workspace). You can also get in touch with the [Hyrax Maintenance Working Group](https://samvera.atlassian.net/wiki/spaces/samvera/pages/496632295/Hyrax+Maintenance+Working+Group), including the Hyrax Product Owner and Hyrax Tech Lead.
79
44
 
80
- ### Installing Analytics
45
+ [Reporting Issues](./.github/SUPPORT.md)
81
46
 
82
- Hyrax supports your choice of either Google Analytics or Matomo. To enable analytics tracking and reporting features, follow the directions below.
47
+ ## How to Run the Code
83
48
 
84
- Enable Analytics Features
49
+ [Run Hyrax Locally Using Docker](./CONTAINERS.md)
85
50
 
86
- Analytics can be enabled and configured using environment variables. Set HYRAX_ANALYTICS to true, set either 'google' or 'matomo' for HYRAX_ANALYTICS_PROVIDER, and set the date you would like reporting to start (ANALYTICS_START_DATE).
51
+ Hyrax can also work running prerequisite dependencies separately. The following describe ways to do this:
52
+ * [Developing Your Hyrax-based Application](./documentation/developing-your-hyrax-based-app.md)
53
+ * [Development setup using Engine Cart and Solr Fedora wrapper](https://github.com/samvera/hyrax/wiki/Development-setup-using-Engine-Cart-and-Solr---Fedora-wrapper)
87
54
 
88
- ```
89
- HYRAX_ANALYTICS=true
90
- HYRAX_ANALYTICS_PROVIDER=google
91
- ANALYTICS_START_DATE=2021-08-21
92
- ```
55
+ ## Contribute
93
56
 
94
- If using google, you'll also need the following ENV variables:
57
+ We'd love to accept your contributions. Please see our [guide to contributing to Hyrax](./.github/CONTRIBUTING.md).
95
58
 
96
- ```
97
- GOOGLE_ANALYTICS_ID=UA-111111-1 # Universal ID (Currently Hyrax Analytics only works with Univeral (UA) accounts)
98
- GOOGLE_OAUTH_APP_NAME=
99
- GOOGLE_OAUTHAPP_VERSION=
100
- GOOGLE_OAUTH_PRIVATE_KEY_PATH= # store the .p12 file in the root of your application
101
- GOOGLE_OAUTH_PRIVATE_KEY_SECRET=
102
- GOOGLE_OAUTH_CLIENT_EMAIL=
103
- ```
59
+ [Installing Analytics](https://github.com/samvera/hyrax/wiki/Hyrax-Management-Guide#installing-analytics)
104
60
 
105
- Add these ENV variables if using Matomo:
106
-
107
- ```
108
- MATOMO_SITE_ID=
109
- MATOMO_BASE_URL=
110
- MATOMO_AUTH_TOKEN=
111
- ```
112
-
113
- #### Analytics Features
114
-
115
- Once analytics is enabled, Hyrax will automatically install the JS tracking code. Page views and downloads of a file set are recorded and sent to the selected analytics provider. Admin users will have access to an expanded dashboard with details about how many vistors viewed a page, and how many visitors downloaded a file. Easily find the top works by views, and most popular file downloads!
116
-
117
- #### Contributing
118
-
119
- We'd love to accept your contributions. Please see our guide to [contributing to Hyrax](./.github/CONTRIBUTING.md).
120
-
121
- Here are possible ways to help:
122
-
123
- * The Hyrax user interface is translated into a number of languages, and many of these translations come from Google Translate. If you are a native or fluent speaker of a non-English language, your help improving these translations are most welcome. (Hyrax currently supports English, Spanish, Chinese, Italian, German, French, and Portuguese.)
124
- * Do you see English in the application where you would expect to see one of the languages above? If so, [file an issue](https://github.com/samvera/hyrax/issues/new) and suggest a translation, please.
125
- * [Contribute a user story](https://github.com/samvera/hyrax/issues/new).
126
- * Help us improve [Hyrax's test coverage](https://coveralls.io/r/samvera/hyrax) or [documentation coverage](https://inch-ci.org/github/samvera/hyrax).
127
- * Refactor away [code smells](https://codeclimate.com/github/samvera/hyrax).
128
-
129
- #### Release process
61
+ ## Release Process
130
62
 
131
63
  See the [release management process](https://github.com/samvera/hyrax/wiki/Release-management-process).
132
64
 
133
- ### Developing your Hyrax-based Application
134
-
135
- For those familiar with Rails, this is where you create your own application (via `rails new`) and add Hyrax as a gem to your `Gemfile`. Your Hyrax-based application is the place for you to create features specific to your Hyrax-based application.
65
+ We also have a [Maintenance Policy](./documentation/MAINTENANCE.md).
136
66
 
137
- For more information, see [our documentation on developing your Hyrax-based application](./documentation/developing-your-hyrax-based-app.md).
138
-
139
- ### Deploying your Hyrax-based Application to production
67
+ ## Deploy
140
68
 
141
69
  Steps to deploy a Hyrax-based application to production will vary depending on your particular ecosystem but here are some methods and things to consider:
142
-
143
- * [Samvera Community Knowledge Base: Running in Production](https://samvera.github.io/service-stack.html)
144
- * [Helm Chart](./CONTAINERS.md#deploying-to-production) (for cloud-based Kubernetes-style deployments)
70
+ * [Hyrax Management Guide](https://github.com/samvera/hyrax/wiki/Hyrax-Management-Guide) (provides guidance for things to keep in mind in production environments)
71
+ * [Helm Chart to deploy Hyrax-based application](./CONTAINERS.md#deploying-to-production) (for cloud-based Kubernetes-style deployments)
145
72
 
146
73
  ## Acknowledgments
147
74
 
148
75
  This software has been developed by and is brought to you by the Samvera community. Learn more at the
149
76
  [Samvera website](http://samvera.org/).
150
77
 
151
- ![Samvera Logo](https://wiki.lyrasis.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2)
78
+ ![Samvera Logo](./samvera-fall-TM3.svg)
152
79
 
153
80
  ## License
154
81
 
155
- Hyrax is available under [the Apache 2.0 license](LICENSE).
82
+ Hyrax is available under [the Apache 2.0 license](LICENSE).
@@ -50,7 +50,7 @@ module Hyrax
50
50
  # @return [TrueClass]
51
51
  def attach_files(files, curation_concern, attributes)
52
52
  return true if files.blank?
53
- AttachFilesToWorkJob.perform_later(curation_concern, files, attributes.to_h.symbolize_keys)
53
+ AttachFilesToWorkJob.perform_later(curation_concern, files, **attributes.to_h.symbolize_keys)
54
54
  true
55
55
  end
56
56
 
@@ -76,6 +76,10 @@
76
76
  color: #fff;
77
77
  }
78
78
 
79
+ .dark-text {
80
+ color: #000
81
+ }
82
+
79
83
  .view-type-group a {
80
84
  > span.caption {
81
85
  display: none;
@@ -38,6 +38,10 @@ legend small {
38
38
  margin-top: 1em;
39
39
  }
40
40
 
41
+ .select2-container .select2-choice > .select2-chosen {
42
+ max-width: 26em;
43
+ }
44
+
41
45
  form {
42
46
  .form-group {
43
47
  align-items: center;
@@ -32,28 +32,6 @@ module Hyrax::Controller
32
32
  super.merge(locale: I18n.locale)
33
33
  end
34
34
 
35
- ##
36
- # @deprecated provides short-term compatibility with Blacklight 6
37
- # @return [Class<Blacklight::SearchBuilder>]
38
- def search_builder_class
39
- return super if defined?(super)
40
- Deprecation.warn("Avoid direct calls to `#search_builder_class`; this" \
41
- " method provides short-term compatibility to" \
42
- " Blacklight 6 clients.")
43
- blacklight_config.search_builder_class
44
- end
45
-
46
- ##
47
- # @deprecated provides short-term compatibility with Blacklight 6
48
- # @return [Blacklight::AbstractRepository]
49
- def repository
50
- return super if defined?(super)
51
- Deprecation.warn("Avoid direct calls to `#repository`; this method" \
52
- " provides short-term compatibility to Blacklight 6 " \
53
- " clients.")
54
- blacklight_config.repository
55
- end
56
-
57
35
  # @note for Blacklight 6/7 compatibility
58
36
  def search_results(*args)
59
37
  return super if defined?(super) # use the upstream if present (e.g. in BL 6)
@@ -63,13 +41,14 @@ module Hyrax::Controller
63
41
 
64
42
  ##
65
43
  # @note for Blacklight 6/7 compatibility
66
- def search_service(**search_params)
44
+ def search_service(*args, **search_params)
45
+ search_params.merge!(args.last) if args.last.is_a?(Hash)
67
46
  return super if defined?(super) && search_params.empty?
68
47
 
69
48
  search_service_class.new(config: blacklight_config,
70
49
  scope: self,
71
50
  user_params: search_params,
72
- search_builder_class: search_builder_class)
51
+ search_builder_class: blacklight_config.search_builder_class)
73
52
  end
74
53
 
75
54
  private
@@ -13,6 +13,7 @@ module Hyrax
13
13
 
14
14
  before_action do
15
15
  blacklight_config.track_search_session = false
16
+ blacklight_config.search_builder_class = search_builder_class
16
17
  end
17
18
 
18
19
  class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class
@@ -7,8 +7,8 @@ module Hyrax
7
7
  end
8
8
 
9
9
  # TODO: we could remove this if we used an isolated engine
10
- def features_url
11
- hyrax.admin_features_path
10
+ def features_url(*args)
11
+ hyrax.admin_features_path(*args)
12
12
  end
13
13
  end
14
14
  end
@@ -513,7 +513,7 @@ module Hyrax
513
513
  form.prepopulate!
514
514
  form
515
515
  else
516
- form_class.new(@collection, current_ability, repository)
516
+ form_class.new(@collection, current_ability, blacklight_config.repository)
517
517
  end
518
518
  end
519
519
 
@@ -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::WorkflowsHelper # Provides #workflow_restriction?
6
7
 
7
8
  def self.default_content_path
8
9
  :original_file
@@ -37,12 +38,26 @@ module Hyrax
37
38
  { type: mime_type_for(file), disposition: 'inline' }
38
39
  end
39
40
 
41
+ 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?)
43
+ @parent ||=
44
+ case file_set
45
+ when Hyrax::Resource
46
+ Hyrax.query_service.find_parents(resource: file_set).first
47
+ else
48
+ file_set.parent
49
+ end
50
+ end
51
+
40
52
  # Customize the :read ability in your Ability class, or override this method.
41
53
  # Hydra::Ability#download_permissions can't be used in this case because it assumes
42
54
  # that files are in a LDP basic container, and thus, included in the asset's uri.
43
55
  def authorize_download!
44
56
  authorize! :download, params[asset_param_key]
45
- rescue CanCan::AccessDenied
57
+ # Deny access if the work containing this file is restricted by a workflow
58
+ return unless workflow_restriction?(file_set_parent(params[asset_param_key]), ability: current_ability)
59
+ raise Hyrax::WorkflowAuthorizationException
60
+ rescue CanCan::AccessDenied, Hyrax::WorkflowAuthorizationException
46
61
  unauthorized_image = Rails.root.join("app", "assets", "images", "unauthorized.png")
47
62
  send_file unauthorized_image, status: :unauthorized
48
63
  end
@@ -195,7 +195,14 @@ module Hyrax
195
195
  def initialize_edit_form
196
196
  guard_for_workflow_restriction_on!(parent: parent)
197
197
 
198
- @version_list = Hyrax::VersionListPresenter.for(file_set: @file_set)
198
+ case file_set
199
+ when Hyrax::Resource
200
+ @form = Hyrax::Forms::ResourceForm.for(file_set)
201
+ @form.prepopulate!
202
+ else
203
+ @form = form_class.new(file_set)
204
+ end
205
+ @version_list = Hyrax::VersionListPresenter.for(file_set: file_set)
199
206
  @groups = current_user.groups
200
207
  end
201
208
 
@@ -236,7 +243,7 @@ module Hyrax
236
243
  end
237
244
 
238
245
  def single_item_search_service
239
- Hyrax::SearchService.new(config: blacklight_config, user_params: params.except(:q, :page), scope: self, search_builder_class: search_builder_class)
246
+ Hyrax::SearchService.new(config: blacklight_config, user_params: params.except(:q, :page), scope: self, search_builder_class: blacklight_config.search_builder_class)
240
247
  end
241
248
 
242
249
  def wants_to_revert?
@@ -30,7 +30,9 @@ module Hyrax
30
30
  private
31
31
 
32
32
  def collections_service
33
- Hyrax::CollectionsService.new(self)
33
+ cloned = clone
34
+ cloned.params = {}
35
+ Hyrax::CollectionsService.new(cloned)
34
36
  end
35
37
 
36
38
  def search_action_url(*args)
@@ -45,7 +45,10 @@ module Hyrax
45
45
  # any existing edit permissions on the work.
46
46
  def accept
47
47
  @proxy_deposit_request.transfer!(params[:reset])
48
- current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user if params[:sticky]
48
+ if params[:sticky]
49
+ current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user unless
50
+ current_user.can_receive_deposits_from.include? @proxy_deposit_request.sending_user
51
+ end
49
52
  redirect_to hyrax.transfers_path, notice: "Transfer complete"
50
53
  end
51
54
 
@@ -9,7 +9,8 @@ module Hyrax
9
9
  # @return [Hyrax::Resource]
10
10
  attr_reader :curation_concern
11
11
 
12
- load_resource class: Hyrax::Resource, instance_name: :curation_concern
12
+ resource_klass = Hyrax.config.use_valkyrie? ? Hyrax::Resource : ActiveFedora::Base
13
+ load_resource class: resource_klass, instance_name: :curation_concern
13
14
  before_action :authenticate_user!
14
15
 
15
16
  def update
@@ -39,7 +40,7 @@ module Hyrax
39
40
 
40
41
  def after_update_response
41
42
  respond_to do |wants|
42
- wants.html { redirect_to [main_app, curation_concern], notice: "The #{curation_concern.human_readable_type} has been updated." }
43
+ wants.html { redirect_to [main_app, curation_concern], notice: "The #{curation_concern.class.human_readable_type} has been updated." }
43
44
  wants.json { render 'hyrax/base/show', status: :ok, location: polymorphic_path([main_app, curation_concern]) }
44
45
  end
45
46
  end
@@ -8,7 +8,7 @@ module Hyrax
8
8
  class AdministrativeSetForm < Valkyrie::ChangeSet
9
9
  ##
10
10
  # @api private
11
- AdminSetMembersPopulator = lambda do |_options|
11
+ AdminSetMembersPopulator = lambda do |**_options|
12
12
  self.member_ids =
13
13
  if model.new_record
14
14
  []
@@ -4,7 +4,7 @@ module Hyrax::Forms
4
4
  include HydraEditor::Form
5
5
  include HydraEditor::Form::Permissions
6
6
 
7
- delegate :depositor, :permissions, to: :model
7
+ delegate :depositor, :permissions, :human_readable_type, to: :model
8
8
 
9
9
  self.required_fields = [:title, :creator, :license]
10
10
 
@@ -3,44 +3,17 @@
3
3
  module Hyrax
4
4
  module Forms
5
5
  ##
6
- # @api public
7
- class FileSetForm < Hyrax::ChangeSet
6
+ # A form for +Hyrax::FileSet+s.
7
+ class FileSetForm < Hyrax::Forms::ResourceForm
8
8
  include Hyrax::FormFields(:core_metadata)
9
9
 
10
- class << self
11
- ##
12
- # @return [Array<Symbol>] list of required field names as symbols
13
- def required_fields
14
- definitions
15
- .select { |_, definition| definition[:required] }
16
- .keys.map(&:to_sym)
17
- end
18
- end
10
+ # The fields in +:file_set_metadata+ were hardcoded into this form in a
11
+ # previous version of Hyrax, but ideally in the future this metadata will
12
+ # be configurable.
13
+ include Hyrax::FormFields(:file_set_metadata)
19
14
 
20
- property :creator, required: true
21
- property :license, required: true
22
-
23
- property :based_near
24
- property :contributor
25
- property :date_created
26
- property :description
27
- property :identifier
28
- property :keyword
29
- property :language
30
- property :publisher
31
- property :related_url
32
- property :subject
33
-
34
- property :permissions, virtual: true
35
- property :visibility, default: VisibilityIntention::PRIVATE
36
-
37
- # virtual properties for embargo/lease;
38
- property :embargo_release_date, virtual: true
39
- property :visibility_after_embargo, virtual: true
40
- property :visibility_during_embargo, virtual: true
41
- property :lease_expiration_date, virtual: true
42
- property :visibility_after_lease, virtual: true
43
- property :visibility_during_lease, virtual: true
15
+ property :representative_id, type: Valkyrie::Types::String
16
+ property :thumbnail_id, type: Valkyrie::Types::String
44
17
  end
45
18
  end
46
19
  end
@@ -8,7 +8,7 @@ module Hyrax
8
8
  class PcdmCollectionForm < Valkyrie::ChangeSet # rubocop:disable Metrics/ClassLength
9
9
  include Hyrax::FormFields(:core_metadata)
10
10
 
11
- BannerInfoPrepopulator = lambda do |_options|
11
+ BannerInfoPrepopulator = lambda do |**_options|
12
12
  self.banner_info ||= begin
13
13
  banner_info = CollectionBrandingInfo.where(collection_id: id.to_s, role: "banner")
14
14
  banner_file = File.split(banner_info.first.local_path).last unless banner_info.empty?
@@ -19,7 +19,7 @@ module Hyrax
19
19
  end
20
20
  end
21
21
 
22
- LogoInfoPrepopulator = lambda do |_options|
22
+ LogoInfoPrepopulator = lambda do |**_options|
23
23
  self.logo_info ||= begin
24
24
  logos_info = CollectionBrandingInfo.where(collection_id: id.to_s, role: "logo")
25
25
 
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyrax
4
+ module Forms
5
+ ##
6
+ # A form for PCDM objects: resources which have collection relationships and
7
+ # generally resemble +Hyrax::Work+.
8
+ class PcdmObjectForm < Hyrax::Forms::ResourceForm
9
+ include Hyrax::FormFields(:core_metadata)
10
+
11
+ property :on_behalf_of
12
+ property :proxy_depositor
13
+
14
+ # pcdm relationships
15
+ property :admin_set_id, prepopulator: proc { |_opts| self.admin_set_id = Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id.to_s }
16
+ property :member_ids, default: [], type: Valkyrie::Types::Array
17
+ property :member_of_collection_ids, default: [], type: Valkyrie::Types::Array
18
+ property :member_of_collections_attributes, virtual: true, populator: :in_collections_populator
19
+ validates_with CollectionMembershipValidator
20
+
21
+ property :representative_id, type: Valkyrie::Types::String
22
+ property :thumbnail_id, type: Valkyrie::Types::String
23
+ property :rendering_ids, default: [], type: Valkyrie::Types::Array
24
+
25
+ # backs the child work search element;
26
+ # @todo: look for a way for the view template not to depend on this
27
+ property :find_child_work, default: nil, virtual: true
28
+
29
+ private
30
+
31
+ def in_collections_populator(fragment:, **_options)
32
+ adds = []
33
+ deletes = []
34
+ fragment.each do |_, h|
35
+ if h["_destroy"] == "true"
36
+ deletes << Valkyrie::ID.new(h["id"])
37
+ else
38
+ adds << Valkyrie::ID.new(h["id"])
39
+ end
40
+ end
41
+
42
+ self.member_of_collection_ids = ((member_of_collection_ids + adds) - deletes).uniq
43
+ end
44
+ end
45
+ end
46
+ end
@@ -9,8 +9,8 @@ module Hyrax
9
9
  # names. we provide these as virtual fields and prepopulate these from
10
10
  # `Hyrax::Permission`.
11
11
  class Permission < Hyrax::ChangeSet
12
- property :agent_name, virtual: true, prepopulator: ->(_opts) { self.agent_name = model.agent }
13
- property :access, virtual: true, prepopulator: ->(_opts) { self.access = model.mode }
12
+ property :agent_name, virtual: true, prepopulator: proc { |_opts| self.agent_name = model.agent }
13
+ property :access, virtual: true, prepopulator: proc { |_opts| self.access = model.mode }
14
14
 
15
15
  ##
16
16
  # @note support a {#to_hash} method for compatibility with