bulkrax 9.3.1 → 9.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b359cd61d4a2f7f0b9984016e6e40bf6a39395cecfcaa93e7f065ba513d39f12
4
- data.tar.gz: 8893b098537305f6d5c9d41dd4e297f3bcaed65a8ec74a0b07624401a1a4c0e2
3
+ metadata.gz: 12b212c61299bd31b4cdf78e54895a068097af7f5c5c30d50c495fa81c98583c
4
+ data.tar.gz: 661c7618a2192917b675c07c4313405f68c4c087eec82b3b4acb0be4418a37c0
5
5
  SHA512:
6
- metadata.gz: 69504c4c72a64693255812b1f1664282ef5c8f21f65f6b24b4f8165fe9021e3bfc1da5ab4a8e7c8fd46cb24b80cfa5c2c8677458ad10c5abdaaf3a0d314eaa59
7
- data.tar.gz: 304dd6bb7fd04eaebb57fde86c1128d880eec3eff9caba0b897db52a4525f9c5e86b25dd8b86d7832a8cfa4914e6c874f309cbcc9a0922ce985696d82c90f5df
6
+ metadata.gz: f559bbefefc1b8aed77af9853b7e9cd02fde566614990c05738dc70769ae45d340912fc945dc79eb0ff4a68783867bfda37b75a4cff087511740a0c7e7db7020
7
+ data.tar.gz: a9ed1877ed0aa0e36cedc66bd753126f338b8a21a4e4439ce5cdf3b45ea7c13e9e1d2fd6367796e7f63a8d22d9c088a3f97d0bac5450a2cd8d7914d09c7913e7
@@ -108,7 +108,7 @@ module Bulkrax
108
108
  def self.add_child_to_parent_work(parent:, child:)
109
109
  parent = self.find(parent.id)
110
110
  return true if parent.member_ids.include?(child.id)
111
- parent.member_ids << child.id
111
+ parent.member_ids += [child.id]
112
112
  Hyrax.persister.save(resource: parent)
113
113
  end
114
114
 
@@ -116,7 +116,7 @@ module Bulkrax
116
116
  # The resource added to a collection can be either a work or another collection.
117
117
  def self.add_resource_to_collection(collection:, resource:, user:)
118
118
  resource = self.find(resource.id)
119
- resource.member_of_collection_ids << collection.id
119
+ resource.member_of_collection_ids += [collection.id]
120
120
  save!(resource: resource, user: user)
121
121
  end
122
122
 
@@ -189,6 +189,7 @@ module Bulkrax
189
189
 
190
190
  # save record if members were added
191
191
  if @parent_record_members_added
192
+ Bulkrax.object_factory.save!(resource: parent_record, user: user)
192
193
  reloaded_parent = Bulkrax.object_factory.find(parent_record.id)
193
194
  Bulkrax.object_factory.update_index(resources: [reloaded_parent])
194
195
  Bulkrax.object_factory.publish(event: 'object.membership.updated', object: reloaded_parent, user: @user)
@@ -429,7 +429,9 @@ module Bulkrax
429
429
  private
430
430
 
431
431
  def map_file_sets(file_sets)
432
+ # rubocop:disable Rails/Presence
432
433
  file_sets.map { |fs| filename(fs).to_s if filename(fs).present? }.compact
434
+ # rubocop:enable Rails/Presence
433
435
  end
434
436
  end
435
437
  end
@@ -2,12 +2,13 @@
2
2
 
3
3
  module Bulkrax
4
4
  class Status < ApplicationRecord
5
- belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message error_class], if: :latest? }
6
- belongs_to :runnable, polymorphic: true
7
-
8
5
  if Rails.version < '7.1'
6
+ belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message error_class], if: :latest? }
7
+ belongs_to :runnable, polymorphic: true
9
8
  serialize :error_backtrace, Array
10
9
  else
10
+ belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message error_class], if: :latest? }, optional: true
11
+ belongs_to :runnable, polymorphic: true, optional: true
11
12
  serialize :error_backtrace, coder: YAML, type: Array
12
13
  end
13
14
 
@@ -1,24 +1,28 @@
1
- <li class="h5 nav-item"><%= t('hyrax.admin.sidebar.repository_objects') %></li>
1
+ <%# Conditionally override Hyrax's partial if we can't use the sidebar insertion of the menu options %>
2
+ <% use_hyrax_partial = defined?(::Hyrax::DashboardController) && ::Hyrax::DashboardController.respond_to?(:sidebar_partials) %>
3
+ <% hyrax_partial_path = use_hyrax_partial ? Hyrax::Engine.root.join('app/views/hyrax/dashboard/sidebar/_repository_content.html.erb') : nil %>
2
4
 
3
- <%= menu.nav_link(hyrax.my_collections_path,
4
- class: "nav-link",
5
- onclick: "dontChangeAccordion(event);",
6
- also_active_for: hyrax.dashboard_collections_path,
7
- title: t('hyrax.admin.sidebar.collections')) do %>
8
- <span class="fa fa-folder-open" aria-hidden="true"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.collections') %></span>
9
- <% end %>
5
+ <% if use_hyrax_partial && hyrax_partial_path && File.exist?(hyrax_partial_path) %>
6
+ <%= render inline: File.read(hyrax_partial_path), type: :erb, locals: { menu: menu } %>
7
+ <% else %>
8
+ <%# Original Bulkrax partial content below %>
9
+ <li class="h5 nav-item"><%= t('hyrax.admin.sidebar.repository_objects') %></li>
10
+ <%= menu.nav_link(hyrax.my_collections_path,
11
+ class: "nav-link",
12
+ onclick: "dontChangeAccordion(event);",
13
+ also_active_for: hyrax.dashboard_collections_path,
14
+ title: t('hyrax.admin.sidebar.collections')) do %>
15
+ <span class="fa fa-folder-open" aria-hidden="true"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.collections') %></span>
16
+ <% end %>
10
17
 
11
- <%= menu.nav_link(hyrax.my_works_path,
12
- class: "nav-link",
13
- onclick: "dontChangeAccordion(event);",
14
- also_active_for: hyrax.dashboard_works_path,
15
- title: t('hyrax.admin.sidebar.works')) do %>
16
- <span class="fa fa-file" aria-hidden="true"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.works') %></span>
17
- <% end %>
18
+ <%= menu.nav_link(hyrax.my_works_path,
19
+ class: "nav-link",
20
+ onclick: "dontChangeAccordion(event);",
21
+ also_active_for: hyrax.dashboard_works_path,
22
+ title: t('hyrax.admin.sidebar.works')) do %>
23
+ <span class="fa fa-file" aria-hidden="true"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.works') %></span>
24
+ <% end %>
18
25
 
19
- <% if ::Hyrax::DashboardController&.respond_to?(:sidebar_partials) %>
20
- <%= render 'hyrax/dashboard/sidebar/menu_partials', menu: menu, section: :repository_content %>
21
- <% else %>
22
26
  <% if current_ability.can_import_works? %>
23
27
  <%= menu.nav_link(bulkrax.importers_path) do %>
24
28
  <span class="fa fa-cloud-upload" aria-hidden="true"></span> <span class="sidebar-action-text"><%= t('bulkrax.admin.sidebar.importers') %></span>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulkrax
4
- VERSION = '9.3.1'
4
+ VERSION = '9.3.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulkrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.1
4
+ version: 9.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Kaufman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-07 00:00:00.000000000 Z
11
+ date: 2025-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -527,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
527
527
  - !ruby/object:Gem::Version
528
528
  version: '0'
529
529
  requirements: []
530
- rubygems_version: 3.4.10
530
+ rubygems_version: 3.5.3
531
531
  signing_key:
532
532
  specification_version: 4
533
533
  summary: Import and export tool for Hyrax and Hyku