Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gem 'blacklight_range_limit', '~> 8.5'
gem 'bolognese', '>= 1.9.10'
gem 'bootstrap', '~> 4.6'
gem 'bootstrap-datepicker-rails'
gem 'bulkrax', '~> 9.4'
gem 'bulkrax', github: 'samvera/bulkrax', branch: 'bulkrax-mappings-ui'
gem 'byebug', group: %i[development test]
gem 'capybara', group: %i[test]
gem 'capybara-screenshot', '~> 1.0', group: %i[test]
Expand Down
40 changes: 23 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ GIT
iiif_manifest (> 0.5)
rails (>= 5.1, < 8.0)

GIT
remote: https://github.com/samvera/bulkrax.git
revision: 2bac6feffd8bcf282a6076c5e60723b8dc18816a
branch: bulkrax-mappings-ui
specs:
bulkrax (9.4.0)
bagit (~> 0.6.0)
coderay
denormalize_fields
iso8601 (~> 0.9.0)
kaminari
language_list (~> 1.2, >= 1.2.1)
libxml-ruby (~> 5.0)
loofah (>= 2.2.3)
marcel
oai (>= 0.4, < 2.x)
rack (>= 2.0.6)
rails (>= 5.1.6, < 8.0.0)
rdf (>= 2.0.2, < 4.0)
rubyzip
simple_form

GIT
remote: https://github.com/samvera/hyrax.git
revision: 03ec05c112421670b9d8bfd190beab642e736e77
Expand Down Expand Up @@ -379,22 +401,6 @@ GEM
signet (~> 0.8)
typhoeus
builder (3.3.0)
bulkrax (9.4.0)
bagit (~> 0.6.0)
coderay
denormalize_fields
iso8601 (~> 0.9.0)
kaminari
language_list (~> 1.2, >= 1.2.1)
libxml-ruby (~> 5.0)
loofah (>= 2.2.3)
marcel
oai (>= 0.4, < 2.x)
rack (>= 2.0.6)
rails (>= 5.1.6, < 8.0.0)
rdf (>= 2.0.2, < 4.0)
rubyzip
simple_form
byebug (12.0.0)
cancancan (3.6.1)
capybara (3.40.0)
Expand Down Expand Up @@ -1667,7 +1673,7 @@ DEPENDENCIES
bolognese (>= 1.9.10)
bootstrap (~> 4.6)
bootstrap-datepicker-rails
bulkrax (~> 9.4)
bulkrax!
byebug
capybara
capybara-screenshot (~> 1.0)
Expand Down
33 changes: 33 additions & 0 deletions app/controllers/admin/field_mappings_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

module Admin
class FieldMappingsController < ::Bulkrax::FieldMappingsController
before_action -> { authorize! :manage, Site }

helper_method :edit_field_mappings_path, :field_mappings_path

def edit_field_mappings_path(**opts)
main_app.edit_admin_field_mappings_path(**opts)
end

def field_mappings_path(**opts)
main_app.admin_field_mappings_path(**opts)
end

protected

def load_mappings
Bulkrax.field_mappings.deep_dup
end

def save_mappings(hash)
account = Site.account
account.bulkrax_field_mappings = hash.to_json
account.save!
end

def default_mappings
Hyku.default_bulkrax_field_mappings.deep_dup
end
end
end
3 changes: 3 additions & 0 deletions app/views/hyrax/dashboard/sidebar/_configuration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<%= menu.nav_link('/admin/work_types/edit', class: "nav-link", title: t('hyku.admin.work_types')) do %>
<span class="fa fa-address-book"></span> <span class="sidebar-action-text"><%= t('hyku.admin.work_types') %></span>
<% end %>
<%= menu.nav_link(main_app.edit_admin_field_mappings_path, class: "nav-link", title: t('hyku.admin.field_mappings')) do %>
<span class="fa fa-exchange"></span> <span class="sidebar-action-text"><%= t('hyku.admin.field_mappings') %></span>
<% end %>
<% end %>
<% end %>
</li>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ en:
work_depositor: Can deposit Works into any Admin Set in this tenant. Can read, edit, and manage Embargoes / Leases for Works belonging to them
work_editor: Can create, read, edit, and approve any Work in this tenant, as well as move Works between Admin Sets and manage Embargoes and Leases
title: Administration
field_mappings: Bulkrax Field Mappings
work_types: Available Work Types
footer:
admin_login: Administrator login
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
namespace :admin do
resource :account, only: %i[edit update]
resource :work_types, only: %i[edit update]
resource :field_mappings, only: %i[edit update]
resources :users, only: [:index, :destroy] do
post 'activate', on: :member
delete 'remove_role/:role_id', on: :member, to: 'users#remove_role', as: :remove_role
Expand Down
Loading