From dd41326d5ff9747475c45f92a9cb0c5a63095311 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Wed, 8 Dec 2021 12:53:35 -0800 Subject: [PATCH 001/201] WIP: try a minimal upgrade to Blacklight 7 gratefully, this is working well enough to load the hyrax homepage. forcing a build via CI. --- .dassie/Gemfile | 2 +- app/assets/javascripts/hyrax.js | 2 -- hyrax.gemspec | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.dassie/Gemfile b/.dassie/Gemfile index 9a21478b89..8bd28fb9e1 100644 --- a/.dassie/Gemfile +++ b/.dassie/Gemfile @@ -52,7 +52,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') -gem 'bootstrap-sass', '~> 3.0' +gem 'bootstrap', '~> 4.0' gem 'devise' gem 'devise-guests', '~> 0.6' gem 'jquery-rails' diff --git a/app/assets/javascripts/hyrax.js b/app/assets/javascripts/hyrax.js index 0f800bbcaa..392a93a22b 100644 --- a/app/assets/javascripts/hyrax.js +++ b/app/assets/javascripts/hyrax.js @@ -16,8 +16,6 @@ // Popover requires that tooltip be loaded first //= require bootstrap/popover //= require bootstrap/tab -// Affix is used for the file manager -//= require bootstrap/affix //= require select2 //= require fixedsticky diff --git a/hyrax.gemspec b/hyrax.gemspec index d3037cab67..3aa10bced0 100644 --- a/hyrax.gemspec +++ b/hyrax.gemspec @@ -34,8 +34,8 @@ SUMMARY spec.add_dependency 'active-fedora', '~> 13.1', '>= 13.1.2' spec.add_dependency 'almond-rails', '~> 0.1' spec.add_dependency 'awesome_nested_set', '~> 3.1' - spec.add_dependency 'blacklight', '~> 6.14' - spec.add_dependency 'blacklight-gallery', '~> 0.7' + spec.add_dependency 'blacklight', '~> 7.0' + spec.add_dependency 'blacklight-gallery', '~> 1.0' spec.add_dependency 'breadcrumbs_on_rails', '~> 3.0' spec.add_dependency 'browse-everything', '>= 0.16', '< 2.0' spec.add_dependency 'carrierwave', '~> 1.0' @@ -53,7 +53,7 @@ SUMMARY spec.add_dependency 'hydra-derivatives', '~> 3.3' spec.add_dependency 'hydra-editor', '~> 5.0', ">= 5.0.4" spec.add_dependency 'hydra-file_characterization', '~> 1.1.2' - spec.add_dependency 'hydra-head', '~> 11.0', ">= 11.0.1" + spec.add_dependency 'hydra-head', '~> 12.0' spec.add_dependency 'hydra-works', '>= 0.16' spec.add_dependency 'iiif_manifest', '>= 0.3', '< 2.0' spec.add_dependency 'jquery-datatables-rails', '~> 3.4' From 18dcfe01990899e1a6e8e829f61d505a6c92b7a1 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Wed, 8 Dec 2021 13:10:52 -0800 Subject: [PATCH 002/201] remove legacy Blacklight::Utils check following instructions here: https://github.com/projectblacklight/blacklight/wiki/Update-to-Blacklight-7.0.1 Blacklight::Utils is removed, and this `needs_attr_accessible` check is for legacy Rails support. it's not needed anymore. --- .dassie/app/models/user.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/.dassie/app/models/user.rb b/.dassie/app/models/user.rb index 6d7735866c..dcf9c1cd6b 100644 --- a/.dassie/app/models/user.rb +++ b/.dassie/app/models/user.rb @@ -5,9 +5,6 @@ class User < ApplicationRecord include Hyrax::User include Hyrax::UserUsageStats - if Blacklight::Utils.needs_attr_accessible? - attr_accessible :email, :password, :password_confirmation - end # Connects this user object to Blacklights Bookmarks. include Blacklight::User # Include default devise modules. Others available are: From c98ca2c205c51713ffebf5fb3fa5f9f058f9e436 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Wed, 8 Dec 2021 13:16:06 -0800 Subject: [PATCH 003/201] remove Blacklight 6.0 skip_after_action this callback was removed in blacklight 7, so we don't need to skip it anymore. --- .dassie/app/controllers/application_controller.rb | 4 +--- lib/generators/hyrax/install_generator.rb | 10 ---------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.dassie/app/controllers/application_controller.rb b/.dassie/app/controllers/application_controller.rb index 8b869ca89d..d0ea39d9e2 100644 --- a/.dassie/app/controllers/application_controller.rb +++ b/.dassie/app/controllers/application_controller.rb @@ -2,13 +2,11 @@ class ApplicationController < ActionController::Base helper Openseadragon::OpenseadragonHelper # Adds a few additional behaviors into the application controller include Blacklight::Controller - skip_after_action :discard_flash_if_xhr include Hydra::Controller::ControllerBehavior # Adds Hyrax behaviors into the application controller include Hyrax::Controller include Hyrax::ThemedLayoutController - with_themed_layout '1_column' - + with_themed_layout '1_column' end diff --git a/lib/generators/hyrax/install_generator.rb b/lib/generators/hyrax/install_generator.rb index 5eab910f33..8232b470d3 100644 --- a/lib/generators/hyrax/install_generator.rb +++ b/lib/generators/hyrax/install_generator.rb @@ -184,15 +184,5 @@ def riiif_image_server def universalviewer_files rake('hyrax:universal_viewer:install') end - - # Blacklight::Controller will by default add an after_action filter to discard all flash messages on xhr requests. - # This has caused problems when we perform a post-redirect-get cycle using xhr and turbolinks. - # This injector will modify the generated ApplicationController to skip this action. - # TODO: This may be removed in Blacklight 7.x, so we'll likely need to remove this after updating. - def inject_skip_blacklilght_flash_discarding - insert_into_file "app/controllers/application_controller.rb", after: "include Blacklight::Controller\n" do - " skip_after_action :discard_flash_if_xhr\n" - end - end end end From 69a636a90008a729a0e2d1dadaaa5752ca204c55 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Thu, 9 Dec 2021 15:33:55 -0800 Subject: [PATCH 004/201] don't skip --- .dassie/app/controllers/catalog_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/.dassie/app/controllers/catalog_controller.rb b/.dassie/app/controllers/catalog_controller.rb index 364047613e..38d54c11bf 100644 --- a/.dassie/app/controllers/catalog_controller.rb +++ b/.dassie/app/controllers/catalog_controller.rb @@ -5,8 +5,6 @@ class CatalogController < ApplicationController # This filter applies the hydra access controls before_action :enforce_show_permissions, only: :show - # Allow all search options when in read-only mode - skip_before_action :check_read_only def self.uploaded_field "system_create_dtsi" From a7e4ccdb7c4f6568514ca743bba4fecca0282f56 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Thu, 9 Dec 2021 12:56:59 -0800 Subject: [PATCH 005/201] update blacklight view and helper code Blacklight::SearchHelper was removed, and its functionality relocated to `#search_service`. update layouts per https://github.com/projectblacklight/blacklight/wiki/Update-to-Blacklight-7.0.1 step 7. hyrax has its own `flash_msg` partial, so we don't redirect to the new blacklight path. --- app/controllers/hyrax/homepage_controller.rb | 1 - app/controllers/hyrax/single_use_links_controller.rb | 3 +-- app/presenters/hyrax/admin/repository_object_presenter.rb | 2 -- app/services/hyrax/collection_member_service.rb | 1 - app/services/hyrax/collections/search_service.rb | 1 - app/services/hyrax/statistics/depositors/summary.rb | 2 -- app/views/layouts/hyrax.html.erb | 2 +- app/views/layouts/hyrax/dashboard.html.erb | 2 +- 8 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/controllers/hyrax/homepage_controller.rb b/app/controllers/hyrax/homepage_controller.rb index 70068b08aa..3026214ee8 100644 --- a/app/controllers/hyrax/homepage_controller.rb +++ b/app/controllers/hyrax/homepage_controller.rb @@ -2,7 +2,6 @@ class Hyrax::HomepageController < ApplicationController # Adds Hydra behaviors into the application controller include Blacklight::SearchContext - include Blacklight::SearchHelper include Blacklight::AccessControls::Catalog class_attribute :presenter_class diff --git a/app/controllers/hyrax/single_use_links_controller.rb b/app/controllers/hyrax/single_use_links_controller.rb index 522eac273d..583e692730 100644 --- a/app/controllers/hyrax/single_use_links_controller.rb +++ b/app/controllers/hyrax/single_use_links_controller.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true module Hyrax class SingleUseLinksController < ApplicationController - include Blacklight::SearchHelper class_attribute :show_presenter self.show_presenter = Hyrax::SingleUseLinkPresenter before_action :authenticate_user! @@ -45,7 +44,7 @@ def authorize_user! end def asset_show_path - polymorphic_path([main_app, fetch(params[:id]).last]) + polymorphic_path([main_app, search_service.fetch(params[:id]).last]) end end end diff --git a/app/presenters/hyrax/admin/repository_object_presenter.rb b/app/presenters/hyrax/admin/repository_object_presenter.rb index 71fdfb1c3a..898ad3bc53 100644 --- a/app/presenters/hyrax/admin/repository_object_presenter.rb +++ b/app/presenters/hyrax/admin/repository_object_presenter.rb @@ -2,8 +2,6 @@ module Hyrax module Admin class RepositoryObjectPresenter - include Blacklight::SearchHelper - def as_json(*) counts.map do |k, v| { label: I18n.translate(k, scope: 'hyrax.admin.stats.repository_objects.series'), diff --git a/app/services/hyrax/collection_member_service.rb b/app/services/hyrax/collection_member_service.rb index a6acc3886a..c0c103ca8b 100644 --- a/app/services/hyrax/collection_member_service.rb +++ b/app/services/hyrax/collection_member_service.rb @@ -5,7 +5,6 @@ module Hyrax # Returns a list of solr documents for collections the item is a part of class CollectionMemberService include Blacklight::Configurable - include Blacklight::SearchHelper attr_reader :item, :current_ability diff --git a/app/services/hyrax/collections/search_service.rb b/app/services/hyrax/collections/search_service.rb index beb3f476bd..1355f3f129 100644 --- a/app/services/hyrax/collections/search_service.rb +++ b/app/services/hyrax/collections/search_service.rb @@ -3,7 +3,6 @@ module Hyrax module Collections class SearchService include Blacklight::Configurable - include Blacklight::SearchHelper def initialize(session, user_key) @session = session diff --git a/app/services/hyrax/statistics/depositors/summary.rb b/app/services/hyrax/statistics/depositors/summary.rb index 48322fc7c9..68d089c895 100644 --- a/app/services/hyrax/statistics/depositors/summary.rb +++ b/app/services/hyrax/statistics/depositors/summary.rb @@ -5,8 +5,6 @@ module Depositors ## # Gather information about the depositors who have contributed to the repository class Summary - include Blacklight::SearchHelper - # @api public # @param [Time] start_date optionally specify the start date to gather the stats from # @param [Time] end_date optionally specify the end date to gather the stats from diff --git a/app/views/layouts/hyrax.html.erb b/app/views/layouts/hyrax.html.erb index 873091585d..0b966faf65 100644 --- a/app/views/layouts/hyrax.html.erb +++ b/app/views/layouts/hyrax.html.erb @@ -28,6 +28,6 @@ <%= content_for?(:content) ? yield(:content) : yield %> <%= render 'shared/footer' %> - <%= render 'shared/ajax_modal' %> + <%= render 'shared/modal' %> diff --git a/app/views/layouts/hyrax/dashboard.html.erb b/app/views/layouts/hyrax/dashboard.html.erb index 7233a623df..4e34481dc5 100644 --- a/app/views/layouts/hyrax/dashboard.html.erb +++ b/app/views/layouts/hyrax/dashboard.html.erb @@ -33,6 +33,6 @@ - <%= render 'shared/ajax_modal' %> + <%= render 'shared/modal' %> From 08229f826e5105f5d3e0fcdc33e7adc111484a94 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Wed, 8 Dec 2021 13:54:28 -0800 Subject: [PATCH 006/201] WorkStatusSearchBuilder Blacklight 7 compatibility it's not clear why `facet.field` isn't in the solr_parameters anymore. we need to investigate this change in Blacklight 7 and determine if the `suppressed_bsi` field should still get injected. maybe this whole builder can now be removed? what's the story? in the meanwhile, at least this doesn't error on NilClass NoMethodError. --- .../hyrax/stats/work_status_search_builder.rb | 2 +- .../stats/work_status_search_builder_spec.rb | 20 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/search_builders/hyrax/stats/work_status_search_builder.rb b/app/search_builders/hyrax/stats/work_status_search_builder.rb index ac6a9d815c..4305b7a9ac 100644 --- a/app/search_builders/hyrax/stats/work_status_search_builder.rb +++ b/app/search_builders/hyrax/stats/work_status_search_builder.rb @@ -9,7 +9,7 @@ class WorkStatusSearchBuilder < ::SearchBuilder # zero to just get the facet information # @param solr_parameters the current solr parameters def include_suppressed_facet(solr_parameters) - solr_parameters[:"facet.field"].concat([IndexesWorkflow.suppressed_field]) + solr_parameters[:"facet.field"] = solr_parameters.fetch(:"facet.field", []).concat([IndexesWorkflow.suppressed_field]) solr_parameters[:'facet.missing'] = true # we only want the facet counts not the actual data diff --git a/spec/search_builders/hyrax/stats/work_status_search_builder_spec.rb b/spec/search_builders/hyrax/stats/work_status_search_builder_spec.rb index 1016663a23..ee21302bbb 100644 --- a/spec/search_builders/hyrax/stats/work_status_search_builder_spec.rb +++ b/spec/search_builders/hyrax/stats/work_status_search_builder_spec.rb @@ -1,33 +1,29 @@ # frozen_string_literal: true RSpec.describe Hyrax::Stats::WorkStatusSearchBuilder do + subject(:instance) { described_class.new(context) } + let(:context) do double(blacklight_config: CatalogController.blacklight_config, current_ability: ability) end + let(:ability) do instance_double(Ability, admin?: true) end - let(:instance) { described_class.new(context) } describe "#query" do - subject { instance.query } - it "sets required parameters" do - expect(subject['facet.field']).to eq ["suppressed_bsi"] - expect(subject['facet.missing']).to eq true - expect(subject['rows']).to eq 0 + expect(instance.query['facet.field']).to eq ["suppressed_bsi"] + expect(instance.query['facet.missing']).to eq true + expect(instance.query['rows']).to eq 0 end end describe "#only_works?" do - subject { instance.send(:only_works?) } - - it { is_expected.to be true } + it { expect(instance.send(:only_works?)).to be true } end describe "::default_processor_chain" do - subject { described_class.default_processor_chain } - - it { is_expected.to include(:filter_models) } + it { expect(described_class.default_processor_chain).to include(:filter_models) } end end From bf86045e205ccd29c0d1cb2ea705422e2114a015 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Mon, 20 Dec 2021 16:09:40 -0800 Subject: [PATCH 007/201] Update *_for_non_admins builders for Blacklight 7 projectblacklight/blacklight#2457 changed the behaviour of Blacklight::Solr::Request instances to not initialize their parameters to []. Since the *_for_non_admins builders presently simply return if the current user is an admin, these parameters are never set and remain nil during these tests. --- .../dashboard/collections_search_builder_spec.rb | 11 ++++++----- .../hyrax/dashboard/works_search_builder_spec.rb | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb b/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb index 7ed0e5e81b..1bdaf88a49 100644 --- a/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb +++ b/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb @@ -30,21 +30,22 @@ end describe "#show_only_managed_collections_for_non_admins" do - subject { builder.show_only_managed_collections_for_non_admins(solr_params) } - let(:solr_params) { Blacklight::Solr::Request.new } + before do + builder.show_only_managed_collections_for_non_admins(solr_params) + end + it "has filter that excludes depositor" do - subject expect(solr_params[:fq]).to eq ["(-_query_:\"{!raw f=depositor_ssim}#{user.user_key}\" OR -(_query_:\"{!raw f=has_model_ssim}AdminSet\" AND _query_:\"{!raw f=creator_ssim}#{user.user_key}\"))"] end context "as admin" do + # Overrides the user sent to builder via context, above. let(:user) { create(:user, groups: 'admin') } it "does nothing" do - subject - expect(solr_params[:fq]).to eq [] + expect(solr_params[:fq].to_a).to eq [] end end end diff --git a/spec/search_builders/hyrax/dashboard/works_search_builder_spec.rb b/spec/search_builders/hyrax/dashboard/works_search_builder_spec.rb index 547f5bc543..4cb86820e0 100644 --- a/spec/search_builders/hyrax/dashboard/works_search_builder_spec.rb +++ b/spec/search_builders/hyrax/dashboard/works_search_builder_spec.rb @@ -24,21 +24,22 @@ end describe "#show_only_managed_works_for_non_admins" do - subject { builder.show_only_managed_works_for_non_admins(solr_params) } - let(:solr_params) { Blacklight::Solr::Request.new } + before do + builder.show_only_managed_works_for_non_admins(solr_params) + end + it "has filter that excludes depositor" do - subject expect(solr_params[:fq]).to eq ["-_query_:\"{!raw f=depositor_ssim}#{user.user_key}\""] end context "as admin" do + # Overrides the user sent to builder via context, above. let(:user) { create(:user, groups: 'admin') } it "does nothing" do - subject - expect(solr_params[:fq]).to eq [] + expect(solr_params[:fq].to_a).to eq [] end end end From d1ff7a9741cbfe942fc955dfea8eb2e94aa6ce35 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Mon, 13 Dec 2021 14:20:26 -0800 Subject: [PATCH 008/201] SingleResult: Adjust params the Blacklight 7 way --- app/search_builders/hyrax/single_result.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/search_builders/hyrax/single_result.rb b/app/search_builders/hyrax/single_result.rb index 072a12040f..ce6b223879 100644 --- a/app/search_builders/hyrax/single_result.rb +++ b/app/search_builders/hyrax/single_result.rb @@ -8,7 +8,7 @@ module SingleResult end def find_one(solr_parameters) - solr_parameters[:fq] << "{!raw f=id}#{blacklight_params.fetch(:id)}" + solr_parameters.append_filter_query("{!raw f=id}#{blacklight_params.fetch(:id)}") end end end From c4de2b035946539f41ae039c7bea6be5b240fcd6 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Thu, 9 Dec 2021 16:19:38 -0800 Subject: [PATCH 009/201] bring some Hyrax services in-line with Blacklight 7 --- app/search_builders/hyrax/deposit_search_builder.rb | 2 +- app/search_builders/hyrax/stats/work_status_search_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/search_builders/hyrax/deposit_search_builder.rb b/app/search_builders/hyrax/deposit_search_builder.rb index 9ba418a3d4..599fbeaa04 100644 --- a/app/search_builders/hyrax/deposit_search_builder.rb +++ b/app/search_builders/hyrax/deposit_search_builder.rb @@ -6,7 +6,7 @@ class DepositSearchBuilder < ::SearchBuilder # zero to just get the facet information # @param solr_parameters the current solr parameters def include_depositor_facet(solr_parameters) - solr_parameters[:"facet.field"].concat([DepositSearchBuilder.depositor_field]) + solr_parameters.append_facet_fields(DepositSearchBuilder.depositor_field) # default facet limit is 10, which will only show the top 10 users. # As we want to show all user deposits, so set the facet.limit to the diff --git a/app/search_builders/hyrax/stats/work_status_search_builder.rb b/app/search_builders/hyrax/stats/work_status_search_builder.rb index 4305b7a9ac..8e5a0b8814 100644 --- a/app/search_builders/hyrax/stats/work_status_search_builder.rb +++ b/app/search_builders/hyrax/stats/work_status_search_builder.rb @@ -9,7 +9,7 @@ class WorkStatusSearchBuilder < ::SearchBuilder # zero to just get the facet information # @param solr_parameters the current solr parameters def include_suppressed_facet(solr_parameters) - solr_parameters[:"facet.field"] = solr_parameters.fetch(:"facet.field", []).concat([IndexesWorkflow.suppressed_field]) + solr_parameters.append_facet_fields(IndexesWorkflow.suppressed_field) solr_parameters[:'facet.missing'] = true # we only want the facet counts not the actual data From b37f5e755becaf66104c0e6953c94689d0a4d47b Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Mon, 13 Dec 2021 15:35:57 -0800 Subject: [PATCH 010/201] use realistic values to test `_index_list_default` template --- .../_index_list_default.html.erb_spec.rb | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/spec/views/catalog/_index_list_default.html.erb_spec.rb b/spec/views/catalog/_index_list_default.html.erb_spec.rb index 173fcb1da7..e7b0ee1b80 100644 --- a/spec/views/catalog/_index_list_default.html.erb_spec.rb +++ b/spec/views/catalog/_index_list_default.html.erb_spec.rb @@ -1,45 +1,33 @@ # frozen_string_literal: true RSpec.describe 'catalog/_index_list_default', type: :view do let(:attributes) do - { 'creator_tesim' => [''], - 'depositor_tesim' => [''], - 'proxy_depositor_ssim' => [''], - 'description_tesim' => [''], - 'date_uploaded_dtsi' => 'a date', - 'date_modified_dtsi' => 'a date', - 'rights_statement_tesim' => [''], - 'embargo_release_date_dtsi' => 'a date', - 'lease_expiration_date_dtsi' => 'a date', + { 'creator_tesim' => ['Test creator_tesim'], + 'depositor_tesim' => ['Test depositor_tesim'], + 'proxy_depositor_ssim' => ['Test proxy_depositor_ssim'], + 'description_tesim' => ['Test description_tesim'], + 'date_uploaded_dtsi' => Time.zone.today.to_s, + 'date_modified_dtsi' => Time.zone.today.to_s, + 'embargo_release_date_dtsi' => Time.zone.today.to_s, + 'lease_expiration_date_dtsi' => Time.zone.today.to_s, 'has_model_ssim' => 'GenericWork' } end let(:document) { SolrDocument.new(attributes) } - let(:presenter) { double } - before do - allow(view).to receive(:index_presenter).and_return(presenter) - allow(presenter).to receive(:field_value) { |field| "Test #{field.field}" } + it "displays metadata" do render 'catalog/index_list_default', document: document - end - it "displays metadata" do expect(rendered).not_to include 'Title:' expect(rendered).to include 'Creator:' expect(rendered).to include 'Test creator_tesim' expect(rendered).to include 'Description:' expect(rendered).to include 'Test description_tesim' expect(rendered).to include 'Date Uploaded:' - expect(rendered).to include 'Test date_uploaded_dtsi' expect(rendered).to include 'Date Modified:' - expect(rendered).to include 'Test date_modified_dtsi' expect(rendered).to include 'Depositor:' expect(rendered).to include 'Test proxy_depositor_ssim' expect(rendered).to include 'Owner:' expect(rendered).to include 'Test depositor_tesim' - expect(rendered).to include 'Rights Statement:' - expect(rendered).to include 'Test rights_statement_tesim' expect(rendered).to include 'Embargo release date:' - expect(rendered).to include 'Test embargo_release_date_dtsi' expect(rendered).to include 'Lease expiration date:' - expect(rendered).to include 'Test lease_expiration_date_dtsi' end end From 58be3bd36d654937f158c6311bc3185d974d5356 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 17 Dec 2021 13:06:25 -0800 Subject: [PATCH 011/201] Build `Hyrax::SearchService` off of Blacklight 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our `SearchService` was originally essentially backported BL7 code. I don’t think it’s safe to remove completely (yet), but I at least deferred what I could to the Blacklight 7 implementation. Removing the rest may be a project for a later time. --- app/services/hyrax/search_service.rb | 82 +--------------------------- 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/app/services/hyrax/search_service.rb b/app/services/hyrax/search_service.rb index 3c866d64b3..3d21f55a91 100644 --- a/app/services/hyrax/search_service.rb +++ b/app/services/hyrax/search_service.rb @@ -1,66 +1,9 @@ # frozen_string_literal: true module Hyrax - ## - # Returns search results from the repository. - # - # @note Adapted from Blacklight 7 - class SearchService - def initialize(config:, user_params: nil, search_builder_class: config.search_builder_class, **context) - @blacklight_config = config - @user_params = user_params || {} - @search_builder_class = search_builder_class - @context = context - end - - # The blacklight_config + controller are accessed by the search_builder - attr_reader :blacklight_config, :context - - def search_builder - search_builder_class.new(self) - end - - # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity - # a solr query method - # @yield [search_builder] optional block yields configured SearchBuilder, caller can modify or create new SearchBuilder to be used. Block should return SearchBuilder to be used. - # @return [Blacklight::Solr::Response] the solr response object - def search_results - builder = search_builder.with(user_params) - builder.page = user_params[:page] if user_params[:page] - builder.rows = (user_params[:per_page] || user_params[:rows]) if user_params[:per_page] || user_params[:rows] - - builder = yield(builder) if block_given? - response = repository.search(builder) - - if response.grouped? && grouped_key_for_results - [response.group(grouped_key_for_results), []] - elsif response.grouped? && response.grouped.length == 1 - [response.grouped.first, []] - else - [response, response.documents] - end - end - # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity - - # retrieve a document, given the doc id - # @param [Array{#to_s},#to_s] id - # @return [Blacklight::Solr::Response, Blacklight::SolrDocument] the solr response object and the first document - def fetch(id = nil, extra_controller_params = {}) - if id.is_a? Array - fetch_many(id, extra_controller_params) - else - fetch_one(id, extra_controller_params) - end - end - + class SearchService < Blacklight::SearchService private - attr_reader :search_builder_class, :user_params, :search_state - - def repository - blacklight_config.repository || blacklight_config.repository_class.new(blacklight_config) - end - def scope @context[:scope] end @@ -83,28 +26,5 @@ def respond_to_missing?(method_name, include_private = false) def current_ability @current_ability || @context[:current_ability] end - - ## - # Retrieve a set of documents by id - # @param [Array] ids - # @param [HashWithIndifferentAccess] extra_controller_params - def fetch_many(ids, extra_controller_params) - extra_controller_params ||= {} - - query = search_builder - .with(user_params) - .where(blacklight_config.document_model.unique_key => ids) - .merge(blacklight_config.fetch_many_document_params) - .merge(extra_controller_params) - - solr_response = repository.search(query) - - [solr_response, solr_response.documents] - end - - def fetch_one(id, extra_controller_params) - solr_response = repository.find id, extra_controller_params - [solr_response, solr_response.documents.first] - end end end From c6774f7e4a860086c7abc6aef3e9d242cfe0e03a Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 17 Dec 2021 13:13:27 -0800 Subject: [PATCH 012/201] FileSetSearchBuilder spec: make params a Request --- spec/search_builders/hyrax/file_set_search_builder_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/search_builders/hyrax/file_set_search_builder_spec.rb b/spec/search_builders/hyrax/file_set_search_builder_spec.rb index 49d4a6a04c..94eb928e6a 100644 --- a/spec/search_builders/hyrax/file_set_search_builder_spec.rb +++ b/spec/search_builders/hyrax/file_set_search_builder_spec.rb @@ -4,7 +4,7 @@ let(:ability) { double('ability') } let(:context) { FakeSearchBuilderScope.new } let(:user) { double('user') } - let(:solr_params) { { fq: [] } } + let(:solr_params) { Blacklight::Solr::Request.new({ fq: [] }) } subject { described_class.new(context) } From 235bf187ccb1caa479fb5644d1d53ad265f355a7 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Tue, 14 Dec 2021 16:55:13 -0800 Subject: [PATCH 013/201] replace correct Blacklight layout string in app generation --- lib/generators/hyrax/install_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/hyrax/install_generator.rb b/lib/generators/hyrax/install_generator.rb index 8232b470d3..90cd776505 100644 --- a/lib/generators/hyrax/install_generator.rb +++ b/lib/generators/hyrax/install_generator.rb @@ -45,7 +45,7 @@ def run_required_generators end def replace_blacklight_layout - gsub_file 'app/controllers/application_controller.rb', /layout 'blacklight'/, + gsub_file 'app/controllers/application_controller.rb', /layout :determine_layout.+$/, "include Hyrax::ThemedLayoutController\n with_themed_layout '1_column'\n" end From ff64bdc9be596061691e02fcb4e5ddf1b096a2be Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Thu, 9 Dec 2021 12:11:25 -0800 Subject: [PATCH 014/201] =?UTF-8?q?=E2=9D=97Initial=20Bootstrap=204=20Migr?= =?UTF-8?q?ation=E2=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is BROKEN and SOLELY a variable rename in order to get the SCSS files to actually compile (e·g during assets:precompile). There is likely a LOT more work to be done here and none of these variable renames have been checked to see if they are actually good and proper. On the plus side, the site actually has styling now. --- .dassie/app/assets/stylesheets/hyrax.scss | 2 -- app/assets/javascripts/hyrax.js | 12 +++------ .../_bootstrap-default-overrides.scss | 8 +++--- app/assets/stylesheets/hyrax/_batch-edit.scss | 12 ++++----- .../hyrax/_browse_everything_overrides.scss | 2 +- .../stylesheets/hyrax/_collections.scss | 4 +-- app/assets/stylesheets/hyrax/_featured.scss | 2 +- .../stylesheets/hyrax/_file-listing.scss | 2 +- .../stylesheets/hyrax/_file_manager.scss | 26 +++++++++---------- .../stylesheets/hyrax/_file_upload.scss | 8 +++--- .../stylesheets/hyrax/_fixedsticky.scss | 2 +- app/assets/stylesheets/hyrax/_footer.scss | 6 ++--- .../stylesheets/hyrax/_form-progress.scss | 4 +-- app/assets/stylesheets/hyrax/_form.scss | 6 ++--- app/assets/stylesheets/hyrax/_header.scss | 7 +---- app/assets/stylesheets/hyrax/_home-page.scss | 16 ++++++------ app/assets/stylesheets/hyrax/_hyrax.scss | 2 +- .../stylesheets/hyrax/_select_work_type.scss | 4 +-- app/assets/stylesheets/hyrax/_styles.scss | 2 +- app/assets/stylesheets/hyrax/_users.scss | 4 +-- app/assets/stylesheets/hyrax/_variables.scss | 21 ++++++++++++++- app/assets/stylesheets/hyrax/_work-show.scss | 16 ++++++------ app/assets/stylesheets/hyrax/dashboard.scss | 20 +++++++------- app/assets/stylesheets/hyrax/sidebar.scss | 2 +- lib/generators/hyrax/templates/hyrax.scss | 2 -- 25 files changed, 98 insertions(+), 94 deletions(-) diff --git a/.dassie/app/assets/stylesheets/hyrax.scss b/.dassie/app/assets/stylesheets/hyrax.scss index a43b967551..2fa3ea7ca2 100644 --- a/.dassie/app/assets/stylesheets/hyrax.scss +++ b/.dassie/app/assets/stylesheets/hyrax.scss @@ -4,10 +4,8 @@ *= require_self */ -@import "bootstrap-sprockets"; @import "bootstrap-default-overrides"; @import 'bootstrap'; -@import 'blacklight/blacklight'; @import "font-awesome"; @import "blacklight_gallery/gallery"; @import "blacklight_gallery/masonry"; diff --git a/app/assets/javascripts/hyrax.js b/app/assets/javascripts/hyrax.js index 392a93a22b..f2e4795d40 100644 --- a/app/assets/javascripts/hyrax.js +++ b/app/assets/javascripts/hyrax.js @@ -7,15 +7,9 @@ //= require jquery-ui/effects/effect-highlight //= require jquery-ui/widgets/sortable -//= require bootstrap/alert -//= require bootstrap/button -//= require bootstrap/collapse -//= require bootstrap/dropdown -//= require bootstrap/modal -//= require bootstrap/tooltip -// Popover requires that tooltip be loaded first -//= require bootstrap/popover -//= require bootstrap/tab +//= require jquery3 +//= require popper +//= require bootstrap //= require select2 //= require fixedsticky diff --git a/app/assets/stylesheets/_bootstrap-default-overrides.scss b/app/assets/stylesheets/_bootstrap-default-overrides.scss index 623311f24d..2b35491f09 100644 --- a/app/assets/stylesheets/_bootstrap-default-overrides.scss +++ b/app/assets/stylesheets/_bootstrap-default-overrides.scss @@ -1,8 +1,8 @@ // Brand colors -$brand-danger: #d33a35 !default; -$brand-success: #387f38 !default; -$brand-info: #2c76c7 !default; -$brand-warning: #565653 !default; +$danger: #d33a35 !default; +$success: #387f38 !default; +$info: #2c76c7 !default; +$warning: #565653 !default; // Overrides for accessibility compliance // Testing: WAVE evaluation tool: http://wave.webaim.org/ diff --git a/app/assets/stylesheets/hyrax/_batch-edit.scss b/app/assets/stylesheets/hyrax/_batch-edit.scss index 876820a051..2d4f2d8f6d 100644 --- a/app/assets/stylesheets/hyrax/_batch-edit.scss +++ b/app/assets/stylesheets/hyrax/_batch-edit.scss @@ -1,6 +1,6 @@ .help-icon { - @extend .glyphicon; - @extend .glyphicon-question-sign; + @extend .glyphicon !optional; // FIXME: not supported in bootstrap 4 + @extend .glyphicon-question-sign !optional; // FIXME: not supported in bootstrap 4 @extend .large-icon; top: 5px; } @@ -14,13 +14,13 @@ } #hide_addl_descriptions { - margin-bottom: $padding-large-vertical; + margin-bottom: $input-btn-padding-y-lg; } .glyphicon-chevron-right-helper.collapsed .chevron { - @extend .glyphicon-chevron-right; + @extend .glyphicon-chevron-right !optional; // FIXME: not supported in bootstrap 4 } .glyphicon-chevron-right-helper .chevron { - @extend .glyphicon; - @extend .glyphicon-chevron-down; + @extend .glyphicon !optional; // FIXME: not supported in bootstrap 4 + @extend .glyphicon-chevron-down !optional; // FIXME: not supported in bootstrap 4 } diff --git a/app/assets/stylesheets/hyrax/_browse_everything_overrides.scss b/app/assets/stylesheets/hyrax/_browse_everything_overrides.scss index 1d7dadc6bb..1e44677197 100644 --- a/app/assets/stylesheets/hyrax/_browse_everything_overrides.scss +++ b/app/assets/stylesheets/hyrax/_browse_everything_overrides.scss @@ -1,4 +1,4 @@ -@import "browse_everything/browse_everything"; +@import "browse_everything/browse_everything_bootstrap4"; #browse-everything { top: 10%; diff --git a/app/assets/stylesheets/hyrax/_collections.scss b/app/assets/stylesheets/hyrax/_collections.scss index d87d571034..85ea38972f 100644 --- a/app/assets/stylesheets/hyrax/_collections.scss +++ b/app/assets/stylesheets/hyrax/_collections.scss @@ -88,7 +88,7 @@ header { } .dropdown-menu .edit_collection { - margin-top: 2 * $padding-large-vertical; + margin-top: 2 * $input-btn-padding-y-lg; } div.view-type { @@ -404,7 +404,7 @@ button.branding-banner-remove:hover { padding-bottom: 40px; .sharing-row-form { - margin-bottom: $padding-large-vertical; + margin-bottom: $input-btn-padding-y-lg; } } diff --git a/app/assets/stylesheets/hyrax/_featured.scss b/app/assets/stylesheets/hyrax/_featured.scss index 6654ca313e..c3db4f28fb 100644 --- a/app/assets/stylesheets/hyrax/_featured.scss +++ b/app/assets/stylesheets/hyrax/_featured.scss @@ -27,7 +27,7 @@ ol#featured_works { } .main { - padding: $padding-small-vertical; + padding: $custom-select-padding-y-sm; } .featured-label { diff --git a/app/assets/stylesheets/hyrax/_file-listing.scss b/app/assets/stylesheets/hyrax/_file-listing.scss index 0eb0e0b312..3606ff2aa9 100644 --- a/app/assets/stylesheets/hyrax/_file-listing.scss +++ b/app/assets/stylesheets/hyrax/_file-listing.scss @@ -2,7 +2,7 @@ div.facets h3 { font-size: 1.4em; } h4 .small { - color: $navbar-default-toggle-icon-bar-bg; + color: $navbar-light-active-color; } @media screen and (max-width: 961px) { diff --git a/app/assets/stylesheets/hyrax/_file_manager.scss b/app/assets/stylesheets/hyrax/_file_manager.scss index 1e17fdb333..a5fd1c815f 100644 --- a/app/assets/stylesheets/hyrax/_file_manager.scss +++ b/app/assets/stylesheets/hyrax/_file_manager.scss @@ -20,23 +20,23 @@ ul { list-style-type: none; &.grid li { - @extend .col-xs-4; + @extend .col-4; .thumbnail { height: 150px; - @extend .col-xs-12; + @extend .col-12; img { max-height: 140px; } } .spacer { - @extend .col-xs-12; + @extend .col-12; } .attributes { - @extend .col-xs-12; + @extend .col-12; } .member_resource_options { - @extend .col-xs-12; + @extend .col-12; float: none; input[type=radio] { margin-left: 1px; @@ -53,21 +53,21 @@ } } li { - @extend .col-xs-12; + @extend .col-12; .text { display: inline-block; } .thumbnail { - @extend .col-xs-3; + @extend .col-3; } .spacer { - @extend .col-xs-3; + @extend .col-3; } .attributes { - @extend .col-xs-6; + @extend .col-6; } .member_resource_options { - @extend .col-xs-12; + @extend .col-12; float: none; span.radio:first-of-type { margin-top: 50px; @@ -113,18 +113,18 @@ } } #file-manager-tools { - @media (max-width: $screen-md-min) { + @media (max-width: map-get($grid-breakpoints, "lg")) { &.affix { position: inherit; } } - @media (min-width: $screen-md-min) { + @media (min-width: map-get($grid-breakpoints, "lg")) { &.affix { top: -50px; width: 235px; } } - @media (min-width: $screen-lg-min) { + @media (min-width: map-get($grid-breakpoints, "xl")) { &.affix { width: 285px; } diff --git a/app/assets/stylesheets/hyrax/_file_upload.scss b/app/assets/stylesheets/hyrax/_file_upload.scss index 2fc1d7e664..24308e1d2a 100644 --- a/app/assets/stylesheets/hyrax/_file_upload.scss +++ b/app/assets/stylesheets/hyrax/_file_upload.scss @@ -1,16 +1,16 @@ .dropzone { border: 1px dashed $gray-light; font-weight: bold; - height: $padding-large-vertical * 5; - line-height: $padding-large-vertical * 5; + height: $input-btn-padding-y * 5; + line-height: $input-btn-padding-y * 5; text-align: center; transition: all 0.3s ease-out; &.in { background-color: lighten($gray-base, 98%); font-size: larger; - height: $padding-large-vertical * 20; - line-height: $padding-large-vertical * 20; + height: $input-btn-padding-y * 20; + line-height: $input-btn-padding-y * 20; } &.hover { diff --git a/app/assets/stylesheets/hyrax/_fixedsticky.scss b/app/assets/stylesheets/hyrax/_fixedsticky.scss index fc2da901ba..76422a86ad 100755 --- a/app/assets/stylesheets/hyrax/_fixedsticky.scss +++ b/app/assets/stylesheets/hyrax/_fixedsticky.scss @@ -1,4 +1,4 @@ -@media (min-width: $screen-sm-min) { +@media (min-width: map-get($grid-breakpoints, "md")) { .fixedsticky { position: -webkit-sticky; position: -moz-sticky; diff --git a/app/assets/stylesheets/hyrax/_footer.scss b/app/assets/stylesheets/hyrax/_footer.scss index e6deda8e77..62479f4b64 100644 --- a/app/assets/stylesheets/hyrax/_footer.scss +++ b/app/assets/stylesheets/hyrax/_footer.scss @@ -5,7 +5,7 @@ html { } body { - margin-bottom: $footer-height + $footer-top-margin; + margin-bottom: calc(#{$footer-height} + #{$footer-top-margin}); &.dashboard { margin-bottom: 0; @@ -24,10 +24,10 @@ body { width: 100%; } -@media (max-width: $screen-sm) { +@media (max-width: map-get($grid-breakpoints, "md")) { // make more room in the footer for mobile devices body { - margin-bottom: 2 * $footer-height + $footer-top-margin; + margin-bottom: calc(#{2 * $footer-height} + #{$footer-top-margin}); } .site-footer { height: 2 * $footer-height; diff --git a/app/assets/stylesheets/hyrax/_form-progress.scss b/app/assets/stylesheets/hyrax/_form-progress.scss index c539c4ce00..687095953c 100644 --- a/app/assets/stylesheets/hyrax/_form-progress.scss +++ b/app/assets/stylesheets/hyrax/_form-progress.scss @@ -1,10 +1,10 @@ -@media (min-width: $screen-xs-min) { +@media (min-width: map-get($grid-breakpoints, "sm")) { .fixedsticky { margin-top: 1em; } } -@media (min-width: $screen-sm-min) { +@media (min-width: map-get($grid-breakpoints, "md")) { .fixedsticky { margin-top: 0; top: 0; /* Required to get consistent results in Safari and Chrome */ diff --git a/app/assets/stylesheets/hyrax/_form.scss b/app/assets/stylesheets/hyrax/_form.scss index 7808753cfa..9481f0b162 100644 --- a/app/assets/stylesheets/hyrax/_form.scss +++ b/app/assets/stylesheets/hyrax/_form.scss @@ -10,8 +10,8 @@ td.status { span { @extend .label; @extend .badge; - &.on { @extend .label-success; } - &.off { @extend .label-default; } + &.on { @extend .badge-success; } + &.off { @extend .badge-secondary; } } } @@ -20,7 +20,7 @@ td.toggle { @extend .btn; @extend .btn-sm; &.active { @extend .btn-primary; } - &:not(.active) { @extend .btn-default; } + &:not(.active) { @extend .btn-secondary; } } } diff --git a/app/assets/stylesheets/hyrax/_header.scss b/app/assets/stylesheets/hyrax/_header.scss index a6410798f4..ece67cf37c 100644 --- a/app/assets/stylesheets/hyrax/_header.scss +++ b/app/assets/stylesheets/hyrax/_header.scss @@ -3,18 +3,13 @@ } #masthead { - z-index: $zindex-navbar + 1; + z-index: 1; } header > .navbar { margin-bottom: 0; } -.navbar + .navbar, -.navbar + .image-masthead { - margin-top: -1 * $navbar-margin-bottom; -} - .searchbar-right { margin-right: 0; } diff --git a/app/assets/stylesheets/hyrax/_home-page.scss b/app/assets/stylesheets/hyrax/_home-page.scss index 59f7efacb1..d1799ca14e 100644 --- a/app/assets/stylesheets/hyrax/_home-page.scss +++ b/app/assets/stylesheets/hyrax/_home-page.scss @@ -8,8 +8,8 @@ } .image-masthead { - border-bottom: 1px solid $navbar-default-border; - margin-bottom: $padding-large-vertical * 2.5; + border-bottom: 1px solid $nav-divider-color; + margin-bottom: $navbar-padding-y * 2.5; position: relative; .background-container { @@ -78,13 +78,13 @@ .home-content { .nav { - margin-bottom: $padding-large-vertical * 2; + margin-bottom: $navbar-padding-y * 2; } // Give some separation between the Works and Collections columns, which stack up vertically on mobile @media screen and (max-width: 640px) { > div { - margin-bottom: $padding-large-vertical * 3; + margin-bottom: $navbar-padding-y * 3; } } } @@ -101,11 +101,11 @@ } .home-share-work { - margin-bottom: $padding-large-vertical * 4; - margin-top: $padding-large-vertical * 2; + margin-bottom: $navbar-padding-y * 4; + margin-top: $navbar-padding-y * 2; .terms-of-use { - margin-top: $padding-large-vertical; + margin-top: $navbar-padding-y; } } @@ -137,7 +137,7 @@ div#announcement { ol.list-group.list-group-striped { li:nth-of-type(odd) { - background: $table-bg-accent; + background: $table-accent-bg; } li:nth-of-type(even) { diff --git a/app/assets/stylesheets/hyrax/_hyrax.scss b/app/assets/stylesheets/hyrax/_hyrax.scss index 7aa2116bea..19a47b6868 100644 --- a/app/assets/stylesheets/hyrax/_hyrax.scss +++ b/app/assets/stylesheets/hyrax/_hyrax.scss @@ -1,4 +1,3 @@ -@import 'hydra-editor/multi_value_fields'; @import 'hyrax/variables', 'hyrax/file_sets', 'hyrax/settings', 'hyrax/header', 'hyrax/styles', 'hyrax/file-listing', 'hyrax/browse_everything_overrides', 'hyrax/nestable', 'hyrax/collections', 'hyrax/collection_types', @@ -10,6 +9,7 @@ 'hyrax/footer', 'hyrax/select_work_type', 'hyrax/users', 'hyrax/dashboard', 'hyrax/sidebar', 'hyrax/controlled_vocabulary', 'hyrax/accessibility', 'hyrax/recent', 'hyrax/viewer', 'hyrax/breadcrumbs'; +@import 'hydra-editor/multi_value_fields'; @import 'typeahead'; @import 'sharing_buttons'; diff --git a/app/assets/stylesheets/hyrax/_select_work_type.scss b/app/assets/stylesheets/hyrax/_select_work_type.scss index 9bec056a38..ff9b04fbe1 100644 --- a/app/assets/stylesheets/hyrax/_select_work_type.scss +++ b/app/assets/stylesheets/hyrax/_select_work_type.scss @@ -4,7 +4,7 @@ } .modal-title { - font-size: $font-size-h3; + font-size: $h3-font-size; } } @@ -49,7 +49,7 @@ width: 80%; .work-type-title { - font-size: $font-size-h4; + font-size: $h4-font-size; margin-top: 0; } } diff --git a/app/assets/stylesheets/hyrax/_styles.scss b/app/assets/stylesheets/hyrax/_styles.scss index 3d1804d7ee..08b9e46883 100644 --- a/app/assets/stylesheets/hyrax/_styles.scss +++ b/app/assets/stylesheets/hyrax/_styles.scss @@ -1,5 +1,5 @@ .input-group { - margin-bottom: $padding-large-vertical; + margin-bottom: $input-padding-y-lg; } .breadcrumbs { diff --git a/app/assets/stylesheets/hyrax/_users.scss b/app/assets/stylesheets/hyrax/_users.scss index 2afc889562..3ee2771b09 100644 --- a/app/assets/stylesheets/hyrax/_users.scss +++ b/app/assets/stylesheets/hyrax/_users.scss @@ -1,7 +1,7 @@ // Styles for the user index and show page .views-downloads-dashboard { - padding-left: $padding-large-horizontal; + padding-left: $input-btn-padding-x-lg; } .panel-user { @@ -10,7 +10,7 @@ #user_info { dt { - margin-top: $padding-small-vertical; + margin-top: $input-btn-padding-y-sm; } } diff --git a/app/assets/stylesheets/hyrax/_variables.scss b/app/assets/stylesheets/hyrax/_variables.scss index 98b4c05081..1e4fa5bf49 100644 --- a/app/assets/stylesheets/hyrax/_variables.scss +++ b/app/assets/stylesheets/hyrax/_variables.scss @@ -1,3 +1,22 @@ +// hydra-editor Bootstrap 3.0 compatibility +$border-radius-base: $border-radius; + +// greys +$gray-base: $black; +$gray: $gray-600; +$gray-darker: $gray-900; +$gray-lighter: $gray-200; + +// brand colours +$brand-primary: $primary; +$brand-secondary: $secondary; +$brand-success: $success; +$brand-info: $info; +$brand-warning: $warning; +$brand-danger: $danger; +$brand-light: $light; +$brand-dark: $dark; + $masthead-image-blur: 1px !default; $navbar-transparent-color: $gray !default; @@ -13,6 +32,6 @@ $title-height: 75px !default; $marketing-text-color: $gray-darker !important; $marketing-text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1) !important; -$footer-top-margin: 3 * $padding-small-vertical !default; +$footer-top-margin: 3 * $pagination-padding-y-sm !default; $footer-dashboard-top-margin: 0 !default; $footer-height: 118px !default; diff --git a/app/assets/stylesheets/hyrax/_work-show.scss b/app/assets/stylesheets/hyrax/_work-show.scss index 220af5077f..86c2d8bad6 100644 --- a/app/assets/stylesheets/hyrax/_work-show.scss +++ b/app/assets/stylesheets/hyrax/_work-show.scss @@ -6,7 +6,7 @@ .no-preview, .social-media { - padding: $panel-body-padding; + padding: $card-img-overlay-padding; } header > h1 .label { @@ -15,7 +15,7 @@ header > h1 .label { } .citations { - padding: $panel-body-padding; + padding: $card-img-overlay-padding; } .ensure-wrapped { @@ -50,8 +50,8 @@ ul.tabular { color: #808080; font-size: 24px; font-weight: 500; - margin-bottom: $padding-large-vertical; - margin-top: $padding-large-vertical * 2; + margin-bottom: $input-btn-padding-y; + margin-top: $input-btn-padding-y * 2; } .work-type { @@ -67,15 +67,15 @@ ul.tabular { // Button row which sits below the title, and above panel content for a page .button-row-top-two-column { - margin-bottom: $padding-large-vertical; - margin-top: $padding-large-vertical; + margin-bottom: $btn-block-spacing-y; + margin-top: $btn-block-spacing-y; @media screen and (max-width: 767px) { > div { text-align: center; &:first-child { - padding-bottom: $padding-small-vertical; + padding-bottom: $btn-padding-y-sm; } } } @@ -83,7 +83,7 @@ ul.tabular { } .work-title-wrapper { - margin-bottom: $padding-large-vertical * 2; + margin-bottom: $input-btn-padding-y * 2; .title-with-badges { align-items: center; diff --git a/app/assets/stylesheets/hyrax/dashboard.scss b/app/assets/stylesheets/hyrax/dashboard.scss index 715ce66fd8..3ac82e066c 100644 --- a/app/assets/stylesheets/hyrax/dashboard.scss +++ b/app/assets/stylesheets/hyrax/dashboard.scss @@ -37,7 +37,7 @@ $admin-panel-border-color: #dedede !default; body.dashboard { background-color: $body-background-color; - padding-top: $navbar-height; + padding-top: $navbar-brand-height + 2 * $navbar-padding-y; @media only screen and (max-width : 767px) { padding-top: 0; @@ -103,19 +103,19 @@ body.dashboard { margin-top: 0; h1 { - font-size: $font-size-h2; - margin-left: $padding-xs-horizontal; - margin-top: $padding-base-vertical; + font-size: $h2-font-size; + margin-left: $table-cell-padding-sm; + margin-top: $input-btn-padding-y; .fa { color: $gray; - margin-right: $padding-xs-horizontal; + margin-right: $table-cell-padding-sm; } } .btn { - margin-bottom: $padding-base-vertical; + margin-bottom: $input-btn-padding-y; } } @@ -126,7 +126,7 @@ body.dashboard { } .constraints-container { - padding: $panel-heading-padding; + padding: $card-spacer-y $card-spacer-x; .start-over { padding: 4px 6px; @@ -141,9 +141,9 @@ body.dashboard { } .list-filters { - background-color: $panel-default-heading-bg; + background-color: $card-cap-bg; margin-bottom: 20px; - padding: $panel-heading-padding; + padding: $card-spacer-y $card-spacer-x; .btn-group > .facet-values { display: none; @@ -246,7 +246,7 @@ body.dashboard { } .panel.panel-default.labels { - border-top: 1px solid $panel-default-border; + border-top: 1px solid $card-border-color; margin-bottom: 0; } diff --git a/app/assets/stylesheets/hyrax/sidebar.scss b/app/assets/stylesheets/hyrax/sidebar.scss index 8b3f42e1f8..b62b9fbbae 100644 --- a/app/assets/stylesheets/hyrax/sidebar.scss +++ b/app/assets/stylesheets/hyrax/sidebar.scss @@ -107,7 +107,7 @@ $gutter-width: $grid-gutter-width/2; white-space: nowrap; } li .fa { - margin-right: $padding-base-horizontal; + margin-right: $input-btn-padding-x; } } diff --git a/lib/generators/hyrax/templates/hyrax.scss b/lib/generators/hyrax/templates/hyrax.scss index a43b967551..2fa3ea7ca2 100644 --- a/lib/generators/hyrax/templates/hyrax.scss +++ b/lib/generators/hyrax/templates/hyrax.scss @@ -4,10 +4,8 @@ *= require_self */ -@import "bootstrap-sprockets"; @import "bootstrap-default-overrides"; @import 'bootstrap'; -@import 'blacklight/blacklight'; @import "font-awesome"; @import "blacklight_gallery/gallery"; @import "blacklight_gallery/masonry"; From 09a49d6d68b691fa16d141d2edfbbbfff20294ec Mon Sep 17 00:00:00 2001 From: kibigo! Date: Thu, 16 Dec 2021 14:56:20 -0800 Subject: [PATCH 015/201] Update attempt for navbars re: Bootstrap 4 --- app/assets/stylesheets/hyrax/_home-page.scss | 5 ++++ app/assets/stylesheets/hyrax/_styles.scss | 2 +- app/views/_controls.html.erb | 30 +++++++++----------- app/views/_masthead.html.erb | 25 +++++++--------- app/views/_user_util_links.html.erb | 20 ++++++------- app/views/catalog/_search_form.html.erb | 10 +++---- app/views/shared/_appearance_styles.html.erb | 16 +++++------ app/views/shared/_footer.html.erb | 2 +- 8 files changed, 53 insertions(+), 57 deletions(-) diff --git a/app/assets/stylesheets/hyrax/_home-page.scss b/app/assets/stylesheets/hyrax/_home-page.scss index d1799ca14e..7db0f882ba 100644 --- a/app/assets/stylesheets/hyrax/_home-page.scss +++ b/app/assets/stylesheets/hyrax/_home-page.scss @@ -44,7 +44,12 @@ margin-bottom: 0; .navbar-nav { + align-self: stretch; + a { + display: flex; + align-items: center; + height: 100%; color: $navbar-transparent-link-color; text-transform: uppercase; diff --git a/app/assets/stylesheets/hyrax/_styles.scss b/app/assets/stylesheets/hyrax/_styles.scss index 08b9e46883..163837edcf 100644 --- a/app/assets/stylesheets/hyrax/_styles.scss +++ b/app/assets/stylesheets/hyrax/_styles.scss @@ -63,7 +63,7 @@ label.disabled { display: flex; } -.navbar-default { +.navbar { .navbar-nav { li { a { diff --git a/app/views/_controls.html.erb b/app/views/_controls.html.erb index 7d0995e696..d1b853d18f 100644 --- a/app/views/_controls.html.erb +++ b/app/views/_controls.html.erb @@ -1,19 +1,15 @@ -