hyrax 5.0.4 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.dassie/.env +4 -0
  3. data/.dassie/Gemfile +15 -11
  4. data/.dassie/app/controllers/application_controller.rb +4 -0
  5. data/.dassie/app/helpers/hyrax_helper.rb +4 -0
  6. data/.dassie/app/models/ability.rb +4 -0
  7. data/.dassie/app/models/user.rb +11 -0
  8. data/.dassie/app/views/shared/_footer.html.erb +17 -0
  9. data/.dassie/bin/rails +0 -5
  10. data/.dassie/bin/rake +0 -5
  11. data/.dassie/config/application.rb +2 -1
  12. data/.dassie/config/database.yml +18 -0
  13. data/.dassie/config/environments/development.rb +1 -1
  14. data/.dassie/config/environments/production.rb +5 -3
  15. data/.dassie/config/environments/test.rb +1 -1
  16. data/.dassie/config/fedora.yml +6 -6
  17. data/.dassie/config/initializers/profiler.rb +5 -0
  18. data/.dassie/config/initializers/riiif.rb +20 -18
  19. data/.dassie/config/locales/hyrax.en.yml +1 -1
  20. data/.dassie/config/puma.rb +55 -5
  21. data/.dassie/config/routes.rb +2 -0
  22. data/.dassie/db/migrate/20250328100249_user_roles.rb +20 -0
  23. data/.dassie/db/schema.rb +122 -110
  24. data/.github/workflows/lint-build-test.yml +35 -6
  25. data/.github/workflows/main.yml +4 -4
  26. data/.koppie/.env +1 -1
  27. data/.koppie/Gemfile +13 -10
  28. data/.koppie/app/controllers/application_controller.rb +4 -0
  29. data/.koppie/app/helpers/hyrax_helper.rb +4 -0
  30. data/.koppie/app/models/ability.rb +4 -0
  31. data/.koppie/app/models/user.rb +10 -0
  32. data/.koppie/app/views/shared/_footer.html.erb +17 -0
  33. data/.koppie/bin/rails +0 -5
  34. data/.koppie/bin/rake +0 -5
  35. data/.koppie/config/application.rb +2 -1
  36. data/.koppie/config/database.yml +2 -9
  37. data/.koppie/config/environments/development.rb +10 -1
  38. data/.koppie/config/environments/production.rb +5 -3
  39. data/.koppie/config/environments/test.rb +1 -1
  40. data/.koppie/config/initializers/1_valkyrie.rb +5 -5
  41. data/.koppie/config/initializers/hyrax.rb +20 -17
  42. data/.koppie/config/initializers/profiler.rb +5 -0
  43. data/.koppie/config/initializers/riiif.rb +21 -18
  44. data/.koppie/config/locales/hyrax.en.yml +2 -2
  45. data/.koppie/config/puma.rb +26 -7
  46. data/.koppie/config/routes.rb +2 -0
  47. data/.koppie/db/schema.rb +109 -110
  48. data/Dockerfile +110 -51
  49. data/app/actors/hyrax/actors/add_to_work_actor.rb +1 -1
  50. data/app/actors/hyrax/actors/apply_order_actor.rb +1 -1
  51. data/app/assets/stylesheets/hyrax/_tinymce.scss +6 -0
  52. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +1 -0
  53. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +4 -4
  54. data/app/controllers/hyrax/api/zotero_controller.rb +1 -1
  55. data/app/controllers/hyrax/file_sets_controller.rb +11 -0
  56. data/app/jobs/batch_create_job.rb +2 -2
  57. data/app/models/admin_set.rb +2 -2
  58. data/app/models/concerns/hyrax/permissions/writable.rb +1 -2
  59. data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +1 -0
  60. data/app/models/hyrax/collection_type.rb +4 -4
  61. data/app/models/single_use_link.rb +1 -1
  62. data/app/services/hyrax/listeners.rb +1 -0
  63. data/app/services/hyrax/statistics/term_query.rb +1 -1
  64. data/app/services/hyrax/user_stat_importer.rb +1 -1
  65. data/app/services/hyrax/workflow.rb +8 -0
  66. data/app/validators/hyrax/has_one_title_validator.rb +1 -1
  67. data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
  68. data/bin/db-migrate-seed.sh +1 -1
  69. data/bin/dev-entrypoint.sh +3 -0
  70. data/config/initializers/1_healthz.rb +2 -1
  71. data/config/initializers/ar_test_fixture_monkey_patch.rb +8 -0
  72. data/config/initializers/arel_rails_7_2_monkey_patch.rb +6 -0
  73. data/config/initializers/listeners.rb +4 -2
  74. data/config/initializers/new_framework_defaults_7_2.rb +8 -0
  75. data/docker-compose-dassie.yml +2 -2
  76. data/docker-compose-koppie.yml +2 -2
  77. data/docker-compose-sirenia.yml +3 -3
  78. data/documentation/developing-your-hyrax-based-app.md +6 -6
  79. data/hyrax.gemspec +9 -9
  80. data/lib/generators/hyrax/config_generator.rb +0 -5
  81. data/lib/generators/hyrax/install_generator.rb +1 -6
  82. data/lib/generators/hyrax/templates/.env +1 -1
  83. data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +21 -19
  84. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +21 -19
  85. data/lib/generators/hyrax/templates/db/migrate/20170131142607_add_permission_template_to_sipity_workflow.rb.erb +1 -1
  86. data/lib/generators/hyrax/templates/db/migrate/20170810190549_update_collection_type_column_options.rb.erb +1 -1
  87. data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +1 -1
  88. data/lib/hyrax/configuration.rb +1 -0
  89. data/lib/hyrax/controlled_vocabulary/importer/language.rb +1 -1
  90. data/lib/hyrax/engine.rb +15 -10
  91. data/lib/hyrax/version.rb +1 -1
  92. data/lib/hyrax.rb +4 -0
  93. data/lib/tasks/workflow.rake +1 -2
  94. data/template.rb +6 -1
  95. metadata +49 -44
  96. data/.dassie/bin/spring +0 -17
  97. data/.dassie/config/initializers/mini_magick.rb +0 -6
  98. data/.dassie/config/spring.rb +0 -6
  99. data/.koppie/bin/spring +0 -17
  100. data/.koppie/config/initializers/mini_magick.rb +0 -6
  101. data/.koppie/config/spring.rb +0 -6
  102. data/config/initializers/reform_rails_6_1_monkey_patch.rb +0 -27
  103. data/lib/generators/hyrax/templates/config/initializers/mini_magick.rb +0 -6
data/Dockerfile CHANGED
@@ -1,49 +1,98 @@
1
- ARG ALPINE_VERSION=3.19
2
- ARG RUBY_VERSION=3.2.6
3
-
4
- FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION AS hyrax-base
5
-
6
- ARG DATABASE_APK_PACKAGE="postgresql-dev"
7
- ARG EXTRA_APK_PACKAGES="git"
8
- ARG RUBYGEMS_VERSION=""
9
-
10
- RUN apk --no-cache upgrade && \
11
- apk --no-cache add acl \
12
- build-base \
13
- curl \
14
- gcompat \
15
- imagemagick \
16
- imagemagick-heic \
17
- imagemagick-jpeg \
18
- imagemagick-jxl \
19
- imagemagick-pdf \
20
- imagemagick-svg \
21
- imagemagick-tiff \
22
- imagemagick-webp \
23
- jemalloc \
24
- ruby-grpc \
25
- tzdata \
26
- nodejs \
27
- yarn \
28
- zip \
29
- $DATABASE_APK_PACKAGE \
30
- $EXTRA_APK_PACKAGES
1
+ ARG DEBIAN_VERSION=bookworm
2
+ ARG RUBY_VERSION=3.3
3
+
4
+ FROM ruby:$RUBY_VERSION-$DEBIAN_VERSION AS hyrax-base
5
+
6
+ RUN apt-get update && \
7
+ curl -sL "https://deb.nodesource.com/setup_20.x" | bash - && \
8
+ apt-get install -y --no-install-recommends \
9
+ acl \
10
+ build-essential \
11
+ curl \
12
+ exiftool \
13
+ ffmpeg \
14
+ ghostscript \
15
+ git \
16
+ less \
17
+ libgsf-1-dev \
18
+ libimagequant-dev \
19
+ libjemalloc2 \
20
+ libjpeg62-turbo-dev \
21
+ libopenjp2-7-dev \
22
+ libopenjp2-tools \
23
+ libpng-dev \
24
+ libpoppler-cpp-dev \
25
+ libpoppler-dev \
26
+ libpoppler-glib-dev \
27
+ libpoppler-private-dev \
28
+ libpoppler-qt5-dev \
29
+ libreoffice \
30
+ libreoffice-l10n-uk \
31
+ librsvg2-dev \
32
+ libtiff-dev \
33
+ libvips-dev \
34
+ libvips-tools \
35
+ libwebp-dev \
36
+ libxml2-dev \
37
+ lsof \
38
+ mediainfo \
39
+ netcat-openbsd \
40
+ nodejs \
41
+ perl \
42
+ poppler-utils \
43
+ postgresql-client \
44
+ rsync \
45
+ ruby-grpc \
46
+ screen \
47
+ tesseract-ocr \
48
+ tzdata \
49
+ vim \
50
+ zip \
51
+ && \
52
+ npm install --global yarn && \
53
+ apt-get clean && \
54
+ rm -rf /var/lib/apt/lists/* && \
55
+ ln -s /usr/lib/*-linux-gnu/libjemalloc.so.2 /usr/lib/libjemalloc.so.2 && \
56
+ echo "******** Packages Installed *********"
57
+
58
+ RUN bash -x -c "\
59
+ if [ $(dpkg --print-architecture) = 'amd64' ]; then \
60
+ wget https://github.com/ImageMagick/ImageMagick/releases/download/7.1.1-47/ImageMagick-82572af-gcc-x86_64.AppImage -O magick \
61
+ && chmod a+x magick \
62
+ && ./magick --appimage-extract \
63
+ && mv squashfs-root/usr/etc/ImageMagick* /etc \
64
+ && rm -rf squashfs-root/usr/share/doc \
65
+ && cp -rv squashfs-root/usr/* /usr/local \
66
+ && rm -rf magick squashfs-root ; \
67
+ else \
68
+ wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-47.tar.gz \
69
+ && tar xf 7.1.1-47.tar.gz \
70
+ && cd ImageMagick* \
71
+ && ./configure \
72
+ && make install \
73
+ && ldconfig /usr/local/lib \
74
+ && cd $OLDPWD \
75
+ && rm -rf 7.1.1-47.tar.gz ImageMagick* ; \
76
+ fi \
77
+ && identify -version"
31
78
 
32
79
  RUN setfacl -d -m o::rwx /usr/local/bundle && \
33
- gem update --silent --system $RUBYGEMS_VERSION
80
+ gem update --silent --system
34
81
 
35
- RUN addgroup -S --gid 101 app && \
36
- adduser -S -G app -u 1001 -s /bin/sh -h /app app
37
- USER app
82
+ RUN useradd -m -u 1001 -U -s /bin/bash --home-dir /app app && \
83
+ mkdir -p /app/samvera/hyrax-webapp && \
84
+ chown -R app:app /app && \
85
+ echo "export PATH=/app/samvera/hyrax-webapp/bin:${PATH}" >> /etc/bash.bashrc
38
86
 
39
- RUN mkdir -p /app/samvera/hyrax-webapp
87
+ USER app
40
88
  WORKDIR /app/samvera/hyrax-webapp
41
89
 
42
- COPY --chown=1001:101 ./bin/*.sh /app/samvera/
90
+ COPY --chown=1001 ./bin/*.sh /app/samvera/
43
91
  ENV PATH="/app/samvera:$PATH" \
44
92
  RAILS_ROOT="/app/samvera/hyrax-webapp" \
45
93
  RAILS_SERVE_STATIC_FILES="1" \
46
- LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
94
+ LD_PRELOAD="/usr/lib/libjemalloc.so.2" \
95
+ MALLOC_CONF="dirty_decay_ms:1000,narenas:2,background_thread:true"
47
96
 
48
97
  ENTRYPOINT ["hyrax-entrypoint.sh"]
49
98
  CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
@@ -54,22 +103,23 @@ FROM hyrax-base AS hyrax
54
103
  ARG APP_PATH=.
55
104
  ARG BUNDLE_WITHOUT="development test"
56
105
 
57
- ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
106
+ ONBUILD COPY --chown=1001 $APP_PATH /app/samvera/hyrax-webapp
58
107
  ONBUILD RUN bundle install --jobs "$(nproc)"
59
- ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
108
+ ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
109
+ ARG BUILD_GITSHA
110
+ ARG BUILD_TIMESTAMP
111
+ ENV BUILD_GITSHA=$BUILD_GITSHA \
112
+ BUILD_TIMESTAMP=$BUILD_TIMESTAMP
60
113
 
61
114
 
62
115
  FROM hyrax-base AS hyrax-worker-base
63
-
64
116
  USER root
65
- RUN apk --no-cache add bash \
66
- ffmpeg \
67
- mediainfo \
68
- openjdk17-jre \
69
- perl
70
- USER app
71
117
 
72
- RUN mkdir -p /app/fits && \
118
+ RUN apt update && \
119
+ apt install -y --no-install-recommends default-jre-headless && \
120
+ apt-get clean && \
121
+ rm -rf /var/lib/apt/lists/* && \
122
+ mkdir -p /app/fits && \
73
123
  cd /app/fits && \
74
124
  wget https://github.com/harvard-lts/fits/releases/download/1.6.0/fits-1.6.0.zip -O fits.zip && \
75
125
  unzip fits.zip && \
@@ -88,7 +138,11 @@ ARG BUNDLE_WITHOUT="development test"
88
138
 
89
139
  ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
90
140
  ONBUILD RUN bundle install --jobs "$(nproc)"
91
- ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
141
+ ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
142
+ ARG BUILD_GITSHA
143
+ ARG BUILD_TIMESTAMP
144
+ ENV BUILD_GITSHA=$BUILD_GITSHA \
145
+ BUILD_TIMESTAMP=$BUILD_TIMESTAMP
92
146
 
93
147
 
94
148
  FROM hyrax-worker-base AS hyrax-engine-dev
@@ -97,8 +151,9 @@ USER app
97
151
  ARG BUNDLE_WITHOUT=
98
152
  ENV HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
99
153
 
100
- COPY --chown=1001:101 .dassie /app/samvera/hyrax-webapp
101
- COPY --chown=1001:101 . /app/samvera/hyrax-engine
154
+ COPY --chown=1001 .dassie /app/samvera/hyrax-webapp
155
+ COPY --chown=1001 .koppie /app/samvera/hyrax-koppie
156
+ COPY --chown=1001 . /app/samvera/hyrax-engine
102
157
 
103
158
  RUN bundle -v && \
104
159
  BUNDLE_GEMFILE=Gemfile.dassie bundle install --jobs "$(nproc)" && yarn && \
@@ -106,4 +161,8 @@ RUN bundle -v && \
106
161
  yarn cache clean
107
162
 
108
163
  ENTRYPOINT ["dev-entrypoint.sh"]
109
- CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
164
+ CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
165
+ ARG BUILD_GITSHA
166
+ ARG BUILD_TIMESTAMP
167
+ ENV BUILD_GITSHA=$BUILD_GITSHA \
168
+ BUILD_TIMESTAMP=$BUILD_TIMESTAMP
@@ -69,7 +69,7 @@ module Hyrax
69
69
  end
70
70
 
71
71
  def add_permissions_error(work)
72
- work.errors[:in_works_ids] << "Works can only be related to each other if user has ability to edit both."
72
+ work.errors.add(:in_works_ids, "Works can only be related to each other if user has ability to edit both.")
73
73
  end
74
74
  end
75
75
  end
@@ -41,7 +41,7 @@ module Hyrax
41
41
  env.curation_concern.ordered_members << work
42
42
  env.curation_concern.save!
43
43
  else
44
- env.curation_concern.errors[:ordered_member_ids] << "Works can only be related to each other if user has ability to edit both."
44
+ env.curation_concern.errors.add(:ordered_member_ids, "Works can only be related to each other if user has ability to edit both.")
45
45
  end
46
46
  end
47
47
  end
@@ -12,3 +12,9 @@
12
12
  .home_marketing_text #content_block_external_key {
13
13
  color: black;
14
14
  }
15
+
16
+ // Prevents text from being clipped in Tiny MCE bottom status bar and drop-down style menu (Issue #6789)
17
+ .tox .tox-statusbar { overflow: visible !important; }
18
+ .tox .tox-tbtn--bespoke .tox-tbtn__select-label { overflow: visible !important; }
19
+ .tox .tox-tbtn { overflow: visible !important; }
20
+ .tox-tinymce { overflow: visible !important; }
@@ -360,6 +360,7 @@ module Hyrax
360
360
  # that they have not removed from the upload widget.
361
361
  uploaded_files = params.fetch(:uploaded_files, [])
362
362
  selected_files = params.fetch(:selected_files, {}).values
363
+ .map { |f| f.permit(:expires, :file_name, :url, {}) }
363
364
  browse_everything_urls = uploaded_files &
364
365
  selected_files.map { |f| f[:url] }
365
366
 
@@ -21,14 +21,14 @@ module Hyrax
21
21
 
22
22
  def after_destroy_error
23
23
  if source.admin_set?
24
- @permission_template_access.errors[:base] <<
25
- t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants')
24
+ @permission_template_access.errors.add(:base,
25
+ t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants'))
26
26
  redirect_to hyrax.edit_admin_admin_set_path(source_id,
27
27
  anchor: 'participants'),
28
28
  alert: @permission_template_access.errors.full_messages.to_sentence
29
29
  else
30
- @permission_template_access.errors[:base] <<
31
- t('hyrax.dashboard.collections.form.permission_update_errors.sharing')
30
+ @permission_template_access.errors.add(:base,
31
+ t('hyrax.dashboard.collections.form.permission_update_errors.sharing'))
32
32
  redirect_to hyrax.edit_dashboard_collection_path(source_id,
33
33
  anchor: 'sharing'),
34
34
  alert: @permission_template_access.errors.full_messages.to_sentence
@@ -14,7 +14,7 @@ module Hyrax
14
14
  session[:request_token] = request_token
15
15
  current_user.zotero_token = request_token
16
16
  current_user.save
17
- redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url)
17
+ redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url), allow_other_host: true
18
18
  rescue OAuth::Unauthorized
19
19
  redirect_to root_url, alert: 'Invalid Zotero client key pair'
20
20
  end
@@ -9,6 +9,10 @@ module Hyrax
9
9
 
10
10
  before_action :authenticate_user!, except: [:show, :citation, :stats]
11
11
  load_and_authorize_resource class: Hyrax.config.file_set_class
12
+ # If Hyrax.config.file_set_class is set to ::FileSet, the load above will force-cast
13
+ # the instance as a ::FileSet, even if it is a Hyrax::FileSet. Re-cast it back to
14
+ # prevent method errors and nil objects later
15
+ before_action :cast_file_set
12
16
  before_action :build_breadcrumbs, only: [:show, :edit, :stats]
13
17
  before_action do
14
18
  blacklight_config.track_search_session = false
@@ -159,6 +163,13 @@ module Hyrax
159
163
  attrs
160
164
  end
161
165
 
166
+ def cast_file_set
167
+ return unless @file_set.class == ::FileSet
168
+ # We can tell if a Hyrax::FileSet was improperly cast because this AF method will
169
+ # return nil since its parent is not a ActiveFedora work.
170
+ @file_set = @file_set.valkyrie_resource if @file_set.parent&.id.nil?
171
+ end
172
+
162
173
  def parent(file_set: curation_concern)
163
174
  @parent ||=
164
175
  case file_set
@@ -32,8 +32,8 @@ class BatchCreateJob < Hyrax::ApplicationJob
32
32
  title = [titles[upload_id]] if titles[upload_id]
33
33
  resource_type = Array.wrap(resource_types[upload_id]) if resource_types[upload_id]
34
34
  job_attributes = job_attributes.merge(uploaded_files: [upload_id],
35
- title: title,
36
- resource_type: resource_type)
35
+ title: title,
36
+ resource_type: resource_type)
37
37
  child_operation = Hyrax::Operation.create!(user: user,
38
38
  operation_type: "Create Work",
39
39
  parent: operation)
@@ -105,13 +105,13 @@ class AdminSet < ActiveFedora::Base
105
105
 
106
106
  def check_if_empty
107
107
  return true if members.empty?
108
- errors[:base] << I18n.t('hyrax.admin.admin_sets.delete.error_not_empty')
108
+ errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_not_empty'))
109
109
  throw :abort
110
110
  end
111
111
 
112
112
  def check_if_not_default_set
113
113
  return true unless Hyrax::AdminSetCreateService.default_admin_set?(id: id)
114
- errors[:base] << I18n.t('hyrax.admin.admin_sets.delete.error_default_set')
114
+ errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_default_set'))
115
115
  throw :abort
116
116
  end
117
117
  end
@@ -23,8 +23,7 @@ module Hyrax
23
23
  valid = true
24
24
  paranoid_edit_permissions.each do |validation|
25
25
  next unless validation[:condition].call(self)
26
- errors[validation[:key]] ||= []
27
- errors[validation[:key]] << validation[:message]
26
+ errors.add(validation[:key], validation[:message])
28
27
  valid = false
29
28
  end
30
29
  valid
@@ -22,6 +22,7 @@ module Hyrax
22
22
  instance_variables.each do |ivar|
23
23
  next if ivar == :@name
24
24
  next if ivar == :@klass
25
+ next if ivar == :@uncountable
25
26
  instance_variable_set(ivar, legacy_model.model_name.send(ivar[1..-1]))
26
27
  end
27
28
  end
@@ -163,26 +163,26 @@ module Hyrax
163
163
 
164
164
  def ensure_no_collections
165
165
  return true unless collections?
166
- errors[:base] << I18n.t('hyrax.admin.collection_types.errors.not_empty')
166
+ errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.not_empty'))
167
167
  throw :abort
168
168
  end
169
169
 
170
170
  def ensure_no_settings_changes_for_admin_set_type
171
171
  return true unless admin_set? && collection_type_settings_changed? && exists_for_machine_id?(ADMIN_SET_MACHINE_ID)
172
- errors[:base] << I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_admin_sets')
172
+ errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_admin_sets'))
173
173
  throw :abort
174
174
  end
175
175
 
176
176
  def ensure_no_settings_changes_for_user_collection_type
177
177
  return true unless user_collection? && collection_type_settings_changed? && exists_for_machine_id?(USER_COLLECTION_MACHINE_ID)
178
- errors[:base] << I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_user_collections')
178
+ errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_user_collections'))
179
179
  throw :abort
180
180
  end
181
181
 
182
182
  def ensure_no_settings_changes_if_collections_exist
183
183
  return true unless collections?
184
184
  return true unless collection_type_settings_changed?
185
- errors[:base] << I18n.t('hyrax.admin.collection_types.errors.no_settings_change_if_not_empty')
185
+ errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_if_not_empty'))
186
186
  throw :abort
187
187
  end
188
188
 
@@ -31,7 +31,7 @@ class SingleUseLink < ActiveRecord::Base
31
31
  end
32
32
 
33
33
  def cannot_be_destroyed
34
- errors[:base] << "Single Use Link has already been used" if destroyed?
34
+ errors.add(:base, "Single Use Link has already been used") if destroyed?
35
35
  end
36
36
 
37
37
  def set_defaults
@@ -20,6 +20,7 @@ module Hyrax
20
20
  autoload :ACLIndexListener
21
21
  autoload :ActiveFedoraACLIndexListener
22
22
  autoload :BatchNotificationListener
23
+ autoload :FileListener
23
24
  autoload :FileMetadataListener
24
25
  autoload :FileSetLifecycleListener
25
26
  autoload :FileSetLifecycleNotificationListener
@@ -59,7 +59,7 @@ module Hyrax
59
59
  end
60
60
 
61
61
  # Allows us to create a Flot charts pie-graph
62
- def as_json(opts)
62
+ def as_json(opts = nil)
63
63
  @data.as_json(opts)
64
64
  end
65
65
  end
@@ -49,7 +49,7 @@ module Hyrax
49
49
 
50
50
  def process_files(stats, user, start_date)
51
51
  file_ids_for_user(user).each do |file_id|
52
- file = ::FileSet.find(file_id)
52
+ file = Hyrax.query_service.find_by(id: file_id)
53
53
  view_stats = extract_stats_for(object: file, from: FileViewStat, start_date: start_date, user: user)
54
54
  stats = tally_results(view_stats, :views, stats) if view_stats.present?
55
55
  delay
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ module Workflow
4
+ extend ActiveSupport::Autoload
5
+
6
+ autoload :WorkflowFactory
7
+ end
8
+ end
@@ -4,7 +4,7 @@ module Hyrax
4
4
  class HasOneTitleValidator < ActiveModel::Validator
5
5
  def validate(record)
6
6
  return unless record.title.reject(&:empty?).empty?
7
- record.errors[:title] << "You must provide a title"
7
+ record.errors.add(:title, "You must provide a title")
8
8
  end
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  <div class="viewer-wrapper">
2
- <iframe aria-label="image view"
2
+ <iframe title="image view"
3
3
  src="<%= universal_viewer_base_url %>#?manifest=<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>&config=<%= universal_viewer_config_url %>"
4
4
  allowfullscreen="true"
5
5
  frameborder="0"
@@ -2,7 +2,7 @@
2
2
  set -e
3
3
 
4
4
  service-wait.sh "$DB_HOST:$DB_PORT"
5
- bundle exec rails db:create
5
+ bundle exec rails db:prepare
6
6
  bundle exec rails db:migrate
7
7
 
8
8
  if [ "$FCREPO_HOST" ]; then
@@ -12,6 +12,9 @@ cp -Rn /usr/local/bundle/* /app/bundle/ruby/$RUBY_MAJOR.0
12
12
  bundle install
13
13
  yarn install
14
14
 
15
+ # Precompile assets if running in production (Nurax)
16
+ [ "$RAILS_ENV" = "production" ] && bundle exec rake assets:precompile
17
+
15
18
  db-migrate-seed.sh
16
19
 
17
20
  # Run the command
@@ -9,7 +9,8 @@
9
9
  # application's `Gemfile`.
10
10
  #
11
11
  # @see https://github.com/sportngin/okcomputer/
12
- begin
12
+
13
+ Rails.application.reloader.to_prepare do
13
14
  OkComputer.mount_at = 'healthz'
14
15
 
15
16
  require 'hyrax/health_checks'
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module ActiveRecord
3
+ module TestFixtures
4
+ def fixture_path
5
+ fixture_paths[0]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ class Arel::Table
3
+ def table_name
4
+ name
5
+ end
6
+ end
@@ -2,8 +2,10 @@
2
2
 
3
3
  Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraACLIndexListener.new) unless Hyrax.config.disable_wings
4
4
 
5
- Hyrax.publisher.default_listeners.each do |listener|
6
- Hyrax.publisher.subscribe(listener)
5
+ Rails.application.reloader.to_prepare do
6
+ Hyrax.publisher.default_listeners.each do |listener|
7
+ Hyrax.publisher.subscribe(listener)
8
+ end
7
9
  end
8
10
 
9
11
  # Publish events from old style Hyrax::Callbacks to trigger the listeners
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Any options set here are to override Rails 7.2 configuration defaults
4
+
5
+ # These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
6
+ # by default when using certain Rails methods
7
+ Rails.application.config.action_view.button_to_generates_button_tag = false
8
+ Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
@@ -6,7 +6,7 @@ services:
6
6
  args:
7
7
  - EXTRA_APK_PACKAGES=git less
8
8
  - BUNDLE_GEMFILE=Gemfile.dassie
9
- image: samvera/hyrax-dev
9
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
10
10
  command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
11
11
  stdin_open: true
12
12
  tty: true
@@ -40,7 +40,7 @@ services:
40
40
  - hyrax
41
41
 
42
42
  worker:
43
- image: samvera/hyrax-dev
43
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
44
44
  entrypoint: worker-entrypoint.sh
45
45
  command: sh -c 'bundle exec sidekiq'
46
46
  user: root
@@ -8,7 +8,7 @@ services:
8
8
  args:
9
9
  - EXTRA_APK_PACKAGES=git less
10
10
  - BUNDLE_GEMFILE=Gemfile.koppie
11
- image: samvera/hyrax-dev
11
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
12
12
  command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
13
13
  stdin_open: true
14
14
  tty: true
@@ -43,7 +43,7 @@ services:
43
43
  - koppie
44
44
 
45
45
  worker:
46
- image: samvera/hyrax-dev
46
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
47
47
  entrypoint: worker-entrypoint.sh
48
48
  command: sh -c 'bundle exec sidekiq'
49
49
  user: root
@@ -8,7 +8,7 @@ services:
8
8
  args:
9
9
  - EXTRA_APK_PACKAGES=git less
10
10
  - BUNDLE_GEMFILE=Gemfile.koppie
11
- image: samvera/hyrax-dev
11
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
12
12
  command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
13
13
  stdin_open: true
14
14
  tty: true
@@ -46,7 +46,7 @@ services:
46
46
  - sirenia
47
47
 
48
48
  worker:
49
- image: samvera/hyrax-dev
49
+ image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
50
50
  entrypoint: worker-entrypoint.sh
51
51
  command: sh -c 'bundle exec sidekiq'
52
52
  user: root
@@ -109,7 +109,7 @@ services:
109
109
  - sirenia
110
110
 
111
111
  fcrepo:
112
- image: fcrepo/fcrepo:6.5.1-RC3-tomcat9
112
+ image: fcrepo/fcrepo:6.5.1-tomcat9
113
113
  environment:
114
114
  - >-
115
115
  CATALINA_OPTS=-Dfcrepo.home=/fcrepo-home -Djava.awt.headless=true -Dfile.encoding=UTF-8
@@ -32,7 +32,7 @@ You can also try [Running Hyrax-based application in local VM](https://github.co
32
32
  During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
33
33
 
34
34
  This document contains instructions specific to setting up an app with __Hyrax
35
- v5.0.4__. If you are looking for instructions on installing a different
35
+ v5.1.0__. If you are looking for instructions on installing a different
36
36
  version, be sure to select the appropriate branch or tag from the drop-down
37
37
  menu above.
38
38
 
@@ -46,7 +46,7 @@ Prerequisites are required for both creating a Hyrax\-based app and contributing
46
46
  Hyrax requires the following software to work:
47
47
 
48
48
  1. [Solr](http://lucene.apache.org/solr/) version >= 5.x (tested up to 8.11.1, which includes the log4j library update)
49
- 1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 (if not using the Valkyrie Postgres adapter)
49
+ 1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 && < 5 (if using legacy ActiveFedora) or >= 6.5.1 (if using the Valkyrie Fedora adapter)
50
50
  1. A SQL RDBMS ([PostgreSQL](https://www.postgresql.org) recommended)
51
51
  1. [Redis](http://redis.io/), a key-value store
52
52
  1. [ImageMagick](http://www.imagemagick.org/) with JPEG-2000 support
@@ -102,7 +102,7 @@ Once ffmpeg has been installed, enable transcoding by setting `config.enable_ffm
102
102
 
103
103
  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).
104
104
 
105
- Hyrax supports Ruby 3.2. When starting a new project, we recommend using the latest Ruby 3.2 version.
105
+ Hyrax supports Ruby 3.3. When starting a new project, we recommend using the latest Ruby 3.3 version.
106
106
 
107
107
  ## Redis
108
108
 
@@ -112,11 +112,11 @@ Starting up Redis will depend on your operating system, and may in fact already
112
112
 
113
113
  ## Rails
114
114
 
115
- Hyrax requires Rails 6. We recommend the latest Rails 6.1 release.
115
+ Hyrax requires Rails 7. We recommend the latest Rails 7.2 release.
116
116
 
117
117
  ```
118
118
  # If you don't already have Rails at your disposal...
119
- gem install rails -v 6.1.7.7
119
+ gem install rails -v 7.2.2.1
120
120
  ```
121
121
 
122
122
  ### JavaScript runtime
@@ -148,7 +148,7 @@ Generate a new Rails application using the template.
148
148
  **NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
149
149
 
150
150
  ```shell
151
- HYRAX_SKIP_WINGS=true rails _6.1.7.7_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.4/template.rb
151
+ HYRAX_SKIP_WINGS=true rails _7.2.2.1_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.1.0-beta1/template.rb
152
152
  ```
153
153
 
154
154
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including: