Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into i35 #2153

Merged
merged 51 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6a1e0c5
🎁 Contributions from PALNI/PALCI
ShanaLMoore Sep 11, 2023
6f9b88b
🎁 Contributions from PALNI/PALCI
jeremyf Dec 19, 2023
0166692
Updating translations
jeremyf Dec 19, 2023
d2649f9
🎁 Contribute back work from PALNI/PALCI
jeremyf Dec 19, 2023
17c9192
:gift: Hyrax 5 upgrade (#2047)
kirkkwang Jan 5, 2024
929565b
🤖 Update charts for deploy
kirkkwang Jan 5, 2024
045aa3a
Merge branch 'pals-contribute-back-to-prime' into merge-main-into-pals
jeremyf Jan 8, 2024
27cb0a9
♻️ Account for observed customizations
jeremyf Jan 8, 2024
99a9733
🧹 Appeasing Rubocop
jeremyf Jan 8, 2024
c7bbda6
Remove conflict in controller
jeremyf Jan 8, 2024
9cfca93
knapsack gemfile additions or replacement
orangewolf Jan 8, 2024
747601f
🐛 Add tests for all defined color methods
jeremyf Jan 8, 2024
821cbf2
🐛 Add placement_class for masthead rendering
jeremyf Jan 8, 2024
66d5292
🎁 fixes to unblock deploys
ShanaLMoore Jan 8, 2024
a559908
Removing unneeded file
jeremyf Jan 8, 2024
f2c6b89
Resolving menu structure for site configuration
jeremyf Jan 8, 2024
bcf2547
Merge branch 'update-deploy-for-hyrax-5-upgrade' into i78-deploy-hyra…
ShanaLMoore Jan 8, 2024
b2334fa
Applying changes in main to this work
jeremyf Jan 8, 2024
ead1017
update version to 6.0.0rc1 (#2137)
ShanaLMoore Jan 8, 2024
962b916
Merge branch 'main' into update-deploy-for-hyrax-5-upgrade
ShanaLMoore Jan 8, 2024
5371470
Merge branch 'main' into i78-deploy-hyrax-5-upgrade
ShanaLMoore Jan 8, 2024
cd718f7
Merge pull request #2133 from samvera/update-deploy-for-hyrax-5-upgrade
ShanaLMoore Jan 8, 2024
eb42111
Merge branch 'main' into i78-deploy-hyrax-5-upgrade
ShanaLMoore Jan 8, 2024
0fbde50
Fixing locale_for tests to reflect I18n behavior
jeremyf Jan 8, 2024
5894b93
🐛 Use non-deprecated and non-removed method
jeremyf Jan 8, 2024
a72af34
Merge pull request #2140 from samvera/i78-deploy-hyrax-5-upgrade
ShanaLMoore Jan 8, 2024
bc35b89
Merge branch 'main' into knapsack_gemfile
orangewolf Jan 8, 2024
6b17b5c
Fixing roles service
jeremyf Jan 8, 2024
ad0d56b
Removing file that came along for the ride
jeremyf Jan 8, 2024
577a49d
Merge branch 'main' into merge-main-into-pals
jeremyf Jan 8, 2024
6a23643
working on fixing redis deploy
orangewolf Jan 9, 2024
31fb129
Merge pull request #2145 from samvera/redis-fix
ShanaLMoore Jan 9, 2024
b8d7a2e
🐛 Restore translation
jeremyf Jan 9, 2024
b6f85d2
Merge branch 'main' into merge-main-into-pals
jeremyf Jan 9, 2024
ab3a9b0
Merge branch 'main' into knapsack_gemfile
jeremyf Jan 9, 2024
a880b50
🧹 Revisiting translations
jeremyf Jan 9, 2024
2879a36
🧹 Fix badge status for feature
jeremyf Jan 9, 2024
ff3532e
♻️ Updating Gemfile to reflect pointing to main
jeremyf Jan 9, 2024
6b7ba4b
Add missing logo translation
jeremyf Jan 10, 2024
1738679
Merge pull request #2139 from samvera/knapsack_gemfile
jeremyf Jan 10, 2024
e43ce29
Revert "knapsack gemfile additions or replacement"
jeremyf Jan 10, 2024
040cba4
Merge pull request #2151 from samvera/revert-2139-knapsack_gemfile
jeremyf Jan 10, 2024
703917b
Merge pull request #2150 from samvera/update-knapsack-ref
jeremyf Jan 10, 2024
1a02896
Merge branch 'main' into merge-main-into-pals
jeremyf Jan 10, 2024
b34f43b
Merge pull request #2138 from samvera/merge-main-into-pals
jeremyf Jan 10, 2024
cde504f
🧹 Specify knapsack required branch
jeremyf Jan 10, 2024
391a7a3
Merge pull request #2152 from samvera/add-more-documentation-for-knap…
jeremyf Jan 10, 2024
8fc5dc1
Merge branch 'main' into merge-main-into-i35
jeremyf Jan 10, 2024
64387fb
Appeasing Rubocop
jeremyf Jan 11, 2024
ae2674a
Throwing the hound a bone
jeremyf Jan 11, 2024
193c9f1
Merge branch 'i35-valkyrize-hyku' into merge-main-into-i35
jeremyf Jan 11, 2024
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
20 changes: 19 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ gem 'puma', '~> 5.6' # Use Puma as the app server
gem 'rack-test', '0.7.0', group: %i[test] # rack-test >= 0.71 does not work with older Capybara versions (< 2.17). See #214 for more details
gem 'rails-controller-testing', group: %i[test]
gem 'rdf', '~> 3.2'
gem 'redcarpet' # for Markdown constant
gem 'redis-namespace', '~> 1.10' # Hyrax v5 relies on 1.5; but we'd like to have the #clear method so we need 1.10 or greater.
gem 'redlock', '>= 0.1.2', '< 2.0' # lock redlock per https://github.com/samvera/hyrax/pull/5961
gem 'riiif', '~> 2.0'
Expand Down Expand Up @@ -105,6 +106,23 @@ gem 'webmock', group: %i[test]

# This gem does nothing by default, but is instead a tool to ease developer flow
# and place overrides, themes and deployment code.
gem 'hyku_knapsack', github: 'samvera-labs/hyku_knapsack', branch: 'upstream_main'
#
# When you use a knapsack for Hyku development, which we recommend, you'll want to ensure that your
# local knapsack repository has a `'required_for_knapsack_instances'` branch (which it should by
# default). Due to some tomfoolery, of knapsack, the branch name
# (e.g. `required_for_knapsack_instances`) must be checked out locally in the knapsack environment
# that you use to build Docker.
#
# Why not use `main`? We need a stable SHA for building HykuKnapsack prime
# (e.g. samvera-labs/hyku_knapsack). Why the stable SHA? Because when we bundle a knapsack, the
# Hyku submodule uses the SHA of the locally checked out branch specified in the gem spec. Which
# can create a chicken and egg issue; namely I need to update Hyku with a new SHA for Knapsack, but
# to update Knapsack's submodule reference to Hyku, I need a new SHA for knapsack. Thus, I can never
# use a "regular branch". Instead we need to use a separate more stable for Knapsack.
#
# Thus the hopefully descriptive `required_for_knapsack_instances`.
#
# tl;dr - Have a local `required_for_knapsack_instances` branch on your knapsack repository
gem 'hyku_knapsack', github: 'samvera-labs/hyku_knapsack', branch: 'required_for_knapsack_instances'

# rubocop:enable Layout/LineLength
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ GIT

GIT
remote: https://github.com/samvera-labs/hyku_knapsack.git
revision: 14f688b61afab9ee886f5f7fa26a76a37bced597
branch: upstream_main
revision: 5a7c54cace96881a3963ab2fd881ca6ea3f57372
branch: required_for_knapsack_instances
specs:
hyku_knapsack (0.0.1)
rails (>= 5.2.0)
Expand Down Expand Up @@ -1090,6 +1090,7 @@ GEM
rdf-xsd (3.3.0)
rdf (~> 3.3)
rexml (~> 3.2)
redcarpet (3.6.0)
redic (1.5.3)
hiredis
redis (4.8.1)
Expand Down Expand Up @@ -1469,6 +1470,7 @@ DEPENDENCIES
rails (~> 6.0)!
rails-controller-testing
rdf (~> 3.2)
redcarpet
redis-namespace (~> 1.10)
redlock (>= 0.1.2, < 2.0)
riiif (~> 2.0)
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//= require jquery.fontselect
//= require jquery.dataTables
//= require dataTables.bootstrap4
//= require cropper.min
//= require stat_slider
//= require turbolinks
//= require cocoon
Expand Down
10 changes: 10 additions & 0 deletions app/assets/javascripts/cropper.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/javascripts/fabric.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*= require single_signon
*= require blacklight_advanced_search
*= require blacklight_range_limit
*= require cropper.min
*= require_self
*= require hyku_knapsack/application
*/
9 changes: 9 additions & 0 deletions app/assets/stylesheets/cropper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 130 additions & 1 deletion app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// allows full width if tabs are turned off with feature flipper
.home-content {
display: flex;
justify-content: normal;
padding: 0 20px;
}
.home-tabs-left {
min-width: 50%;
Expand Down Expand Up @@ -418,12 +420,23 @@ a.btn.btn-default.restore-default-color.with-color-hint {
nav.navbar.navbar-default.navbar-static-top .container-fluid .row {
margin-left: 0;
margin-right: 0;

nav.navbar-nav.col-sm-5 {
padding-right: 0;
}
}

//these styles modify the theming for the citations section
div#collapse-citations {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying id selectors with an element.
Avoid using id selectors

text-align: left;
word-wrap: break-word;
}

@media (min-width: 576px) {
.citations-button .download-pdf-button {
max-width: 300px;
}
}

body.public-facing {
.btn {
&.btn-primary,
Expand Down Expand Up @@ -502,3 +515,119 @@ body.public-facing {
vertical-align: middle;
width: 1.5em;
}

// make sure constraints are on only one line, even with markdown
span.constraint-value p, .facet-values p {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying class selectors with an element.
Each selector in a comma sequence should be on its own single line

display: inline-block;
margin-bottom: 0;
}

// make the facet counts appear at the end of the facet panel
.facet-content .panel-body .facet-values p {
display: flex;
justify-content: space-between;
}

// button to remove a filter should be red instead of white
.remove.dropdown-toggle .glyphicon.glyphicon-remove {
color: #c4302b;
}

// style the analytics button to match citations button
#stats {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using id selectors

margin-top: 10px;

@media (min-width: 576px) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media declaration should be preceded by an empty line

max-width: 300px;
}
}

#download-pdf-button {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using id selectors

margin: 10px 0 10px 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorthand form for property margin should be written more concisely as 10px 0 instead of 10px 0 10px 0
Shorthands of length 4 are not allowed. Value was 10px 0 10px 0

}

.catalog_startOverLink {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector catalog_startOverLink should be written in BEM (Block Element Modifier) format

font-size: 1.15em;
font-weight: bold;
}

// collection show page styles

.space-between {
align-items: center;
justify-content: space-between;
}

.hyc-banner {
padding: 15px;
.hyc-bugs .hyc-created-by,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule declaration should be preceded by an empty line

.hyc-bugs .hyc-last-updated,
.hyc-title {
padding: 0;
}

.hyc-item-count {
background: rgba(255, 255, 255, 0.75);
border-radius: 0.5em;
color: #333;
margin: 0;
padding: 10px;
}

.hyc-bugs div,
div {
position: relative;
}
}

// these margin classes can be removed when Hyku is eventually updated to Bootstrap 4 upon upgrading to Hyrax 4.
// These correspond directly to bootstrap 4 classes.

.mb-0 {
margin-bottom: 0;
}

.mt-5 {
margin-top: 3em;
}

.mt-2 {
margin-top: 0.5em;
}

.mb-2 {
margin-bottom: 0.5em;
}

.mb-5 {
margin-bottom: 3em;
}

.mx-3 {
margin-right: 1em;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered margin-left, margin-right

margin-left: 1em;
}

.ml-auto {
margin-left: auto;
}

.py-0 {
padding-bottom: 0;
padding-top: 0;
}

.py-4 {
padding-bottom: 2em;
padding-top: 2em;
}

.d-block {
display: block;
}

// hide iiif-print feature flipper

tr[data-feature="use-iiif-print"] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying attribute selectors with an element.

display: none;
}
6 changes: 6 additions & 0 deletions app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
@import "viewer";

@import "themes/*";

// for catalog search result snippets
.highlight {
background: #ffff00;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

font-weight: 700;
}
8 changes: 5 additions & 3 deletions app/assets/stylesheets/viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
.viewer {
height: 100%;
padding: 10px;
iframe {
// position: absolute;
}
}

#viewer-modal {
Expand All @@ -21,3 +18,8 @@
margin-bottom: 10px;
}
}

.video-embed-viewer {
aspect-ratio: 16 / 9;
width: 100%;
}
27 changes: 27 additions & 0 deletions app/controllers/admin/roles_service_controller.rb
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
17 changes: 17 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module Admin
class UsersController < AdminController
before_action :ensure_admin!, except: [:remove_role]
before_action :load_user, only: [:destroy]

# NOTE: User creation/invitations handled by devise_invitable
Expand All @@ -26,6 +27,22 @@ def activate
end
end

def remove_role
authorize! :edit, User

user = User.find(params[:id])
role = Role.find(params[:role_id])

if user && role && user.roles.include?(role)
user.remove_role(role.name)
flash[:notice] = "Role '#{role.name}' was successfully removed from user #{user.email}."
else
flash[:alert] = "Failed to remove role from user #{user.email}."
end

redirect_back(fallback_location: root_path)
end

private

def load_user
Expand Down
20 changes: 5 additions & 15 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,25 @@ class ApplicationController < ActionController::Base

protected

# rubocop:disable Naming/PredicateName
def is_hidden
# rubocop:enable Naming/PredicateName
def hidden?
current_account.persisted? && !current_account.is_public?
end

# rubocop:disable Naming/PredicateName
def is_api_or_pdf
# rubocop:enable Naming/PredicateName
def api_or_pdf?
request.format.to_s.match('json') ||
params[:print] ||
request.path.include?('api') ||
request.path.include?('pdf')
end

# rubocop:disable Naming/PredicateName
def is_staging
# rubocop:enable Naming/PredicateName
['staging'].include?(Rails.env)
def staging?
Rails.env.staging? # rubocop:disable Rails/UnknownEnv
end

##
# Extra authentication for palni-palci during development phase
def authenticate_if_needed
# Disable this extra authentication in test mode
return true if Rails.env.test?
# rubocop:disable Naming/PredicateName
return unless (is_hidden || is_staging) && !is_api_or_pdf
# rubocop:enable Naming/PredicateName
return unless (hidden? || staging?) && !api_or_pdf?
authenticate_or_request_with_http_basic do |username, password|
username == "samvera" && password == "hyku"
end
Expand Down
6 changes: 4 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ def self.uploaded_field
config.default_solr_params = {
qt: "search",
rows: 10,
qf: IiifPrint.config.metadata_fields.keys.map { |attribute| "#{attribute}_tesim" }
.join(' ') << " title_tesim description_tesim all_text_timv file_set_text_tsimv", # the first space character is necessary!
qf: (
IiifPrint.config.metadata_fields.keys.map { |attribute| "#{attribute}_tesim" } +
["title_tesim", "description_tesim", "all_text_timv", "file_set_text_tsimv"]
).uniq.join(' '),
"hl": true,
"hl.simple.pre": "<span class='highlight'>",
"hl.simple.post": "</span>",
Expand Down
16 changes: 16 additions & 0 deletions app/controllers/flipflop/strategies_controller_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

# OVERRIDE Flipflop v2.7.1 to allow for custom `Action` labels

module Flipflop
module StrategiesControllerDecorator
def enable?
values = StrategiesController::ENABLE_VALUES | ADDITIONAL_ENABLE_VALUES
values.include?(params[:commit])
end

ADDITIONAL_ENABLE_VALUES = FeaturesHelper::FEATURE_ACTION_LABELS.map { |_, v| v[:on] }.to_set.freeze
end
end

Flipflop::StrategiesController.prepend(Flipflop::StrategiesControllerDecorator)
Loading
Loading