-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contribute back the following features: - scientist-softserv/palni-palci#445 - scientist-softserv/palni-palci#659 - scientist-softserv/palni-palci#740 - scientist-softserv/palni-palci#748 - scientist-softserv/palni-palci#823 - scientist-softserv/palni-palci#843 - scientist-softserv/palni-palci#844 - scientist-softserv/palni-palci#911 Which were resolved via the following PRs: - scientist-softserv/palni-palci#920 - scientist-softserv/palni-palci#704 - scientist-softserv/palni-palci#706 - scientist-softserv/palni-palci#790 - scientist-softserv/palni-palci#867 - scientist-softserv/palni-palci#874 - scientist-softserv/palni-palci#893 - scientist-softserv/palni-palci#898 - scientist-softserv/palni-palci#824 - scientist-softserv/palni-palci#923 - scientist-softserv/palni-palci#939 - scientist-softserv/palni-palci#922 - scientist-softserv/palni-palci#926 - scientist-softserv/palni-palci#927 - scientist-softserv/palni-palci#928 - scientist-softserv/palni-palci#929 - scientist-softserv/palni-palci#930 - scientist-softserv/palni-palci#931 - scientist-softserv/palni-palci#943 - scientist-softserv/palni-palci#945 - scientist-softserv/palni-palci#954 Co-authored-by: Lea Ann Bradford <ltrammer@gmail.com> Co-authored-by: LaRita Robinson <larita@scientist.com> Co-authored-by: Kirk Wang <kirk.wang@scientist.com> Co-authored-by: Shana Moore <shana@scientist.com>
- Loading branch information
1 parent
9a6fe0e
commit 707b447
Showing
44 changed files
with
738 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class RolesServiceController < ApplicationController | ||
layout 'hyrax/dashboard' | ||
|
||
def index | ||
authorize! :update, RolesService | ||
add_breadcrumb t(:'hyrax.controls.home'), root_path | ||
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path | ||
add_breadcrumb t(:'hyrax.admin.sidebar.roles_service_jobs'), main_app.admin_roles_service_jobs_path | ||
end | ||
|
||
# post "admin/roles_service/:job_name_key | ||
def update_roles | ||
authorize! :update, RolesService | ||
job = RolesService.valid_jobs.fetch(params[:job_name_key]) | ||
|
||
job.perform_later | ||
|
||
respond_to do |wants| | ||
wants.html { redirect_to main_app.admin_roles_service_jobs_path, notice: "#{job} has been submitted." } | ||
wants.json { render json: { notice: "#{job} has been submitted." }, status: :ok } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/controllers/hyrax/my/collections_controller_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
module Hyrax | ||
module My | ||
module CollectionsControllerDecorator | ||
def configure_facets | ||
configure_blacklight do |config| | ||
# clear facets copied from the CatalogController | ||
config.sort_fields.clear | ||
# Collections don't seem to have a date_uploaded_dtsi nor date_modified_dtsi | ||
# we can at least use the system_modified_dtsi instead of date_modified_dtsi | ||
# but we will omit date_uploaded_dtsi | ||
config.add_sort_field "system_modified_dtsi desc", label: "date modified \u25BC" | ||
config.add_sort_field "system_modified_dtsi asc", label: "date modified \u25B2" | ||
config.add_sort_field "system_create_dtsi desc", label: "date created \u25BC" | ||
config.add_sort_field "system_create_dtsi asc", label: "date created \u25B2" | ||
config.add_sort_field "depositor_ssi asc, title_ssi asc", label: "depositor (A-Z)" | ||
config.add_sort_field "depositor_ssi desc, title_ssi desc", label: "depositor (Z-A)" | ||
config.add_sort_field "creator_ssi asc, title_ssi asc", label: "creator (A-Z)" | ||
config.add_sort_field "creator_ssi desc, title_ssi desc", label: "creator (Z-A)" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Hyrax::My::CollectionsController.singleton_class.send(:prepend, Hyrax::My::CollectionsControllerDecorator) | ||
Hyrax::My::CollectionsController.configure_facets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
## | ||
# OVERRIDE Hyrax 3.5.0; when Hyrax hits v4.0.0 we can remove this. | ||
# @see https://github.com/samvera/hyrax/pull/5972 | ||
# OVERRIDE Hyrax 3.6.0 to add custom sort fields while in the dashboard for works | ||
|
||
module Hyrax | ||
module My | ||
module WorksControllerDecorator | ||
def collections_service | ||
cloned = clone | ||
cloned.params = {} | ||
Hyrax::CollectionsService.new(cloned) | ||
def configure_facets | ||
configure_blacklight do |config| | ||
# clear facets copied from the CatalogController | ||
config.sort_fields.clear | ||
config.add_sort_field "date_uploaded_dtsi desc", label: "date uploaded \u25BC" | ||
config.add_sort_field "date_uploaded_dtsi asc", label: "date uploaded \u25B2" | ||
config.add_sort_field "date_modified_dtsi desc", label: "date modified \u25BC" | ||
config.add_sort_field "date_modified_dtsi asc", label: "date modified \u25B2" | ||
config.add_sort_field "system_create_dtsi desc", label: "date created \u25BC" | ||
config.add_sort_field "system_create_dtsi asc", label: "date created \u25B2" | ||
config.add_sort_field "depositor_ssi asc, title_ssi asc", label: "depositor (A-Z)" | ||
config.add_sort_field "depositor_ssi desc, title_ssi desc", label: "depositor (Z-A)" | ||
config.add_sort_field "creator_ssi asc, title_ssi asc", label: "creator (A-Z)" | ||
config.add_sort_field "creator_ssi desc, title_ssi desc", label: "creator (Z-A)" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Hyrax::My::WorksController.prepend(Hyrax::My::WorksControllerDecorator) | ||
Hyrax::My::WorksController.singleton_class.send(:prepend, Hyrax::My::WorksControllerDecorator) | ||
Hyrax::My::WorksController.configure_facets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# frozen_sting_literal: true | ||
|
||
module VideoEmbedFormBehavior | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
self.terms += %i[video_embed] | ||
end | ||
|
||
def secondary_terms | ||
super.sort! | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module VideoEmbedBehavior | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
validates :video_embed, | ||
format: { | ||
with: %r{(http://|https://)(www\.)?(player\.vimeo\.com|youtube\.com/embed)}, | ||
message: lambda do |_object, _data| | ||
I18n.t('errors.messages.valid_embed_url', default: 'must be a valid YouTube or Vimeo Embed URL.') | ||
end | ||
}, | ||
if: :video_embed? | ||
|
||
property :video_embed, predicate: ::RDF::URI("https://atla.com/terms/video_embed"), multiple: false do |index| | ||
index.as :stored_searchable | ||
end | ||
end | ||
|
||
def video_embed? | ||
video_embed.present? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.