From e829cb690f7dade18ea2fe316a3e3665b1895ab0 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Tue, 17 Dec 2024 14:22:25 -0700 Subject: [PATCH 1/8] having skip links inherit completely, with one CSS override --- app/assets/stylesheets/modules/spotlight_overrides.scss | 6 ++++++ app/components/skip_link_component.rb | 9 --------- app/controllers/catalog_controller.rb | 1 - 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 app/components/skip_link_component.rb diff --git a/app/assets/stylesheets/modules/spotlight_overrides.scss b/app/assets/stylesheets/modules/spotlight_overrides.scss index 9f4d8d2a6..598f1f9cb 100644 --- a/app/assets/stylesheets/modules/spotlight_overrides.scss +++ b/app/assets/stylesheets/modules/spotlight_overrides.scss @@ -220,3 +220,9 @@ h5, z-index: 1; } } + +// This allows for the skip links to appear above the header +// instead of overlapping with the header. +#skip-link { + position: relative !important; +} diff --git a/app/components/skip_link_component.rb b/app/components/skip_link_component.rb deleted file mode 100644 index c1126d50c..000000000 --- a/app/components/skip_link_component.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# Draws the skip links for screen readers -class SkipLinkComponent < Blacklight::SkipLinkComponent - # This is only needed until we are using https://github.com/projectblacklight/blacklight/pull/3461 - def link_classes - 'visually-hidden-focusable rounded-bottom py-2 px-3' - end -end diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 9ad8dbdc7..d856ccf1e 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -39,7 +39,6 @@ class CatalogController < ApplicationController # For browse category search to work it must be nil config.json_solr_path = nil config.header_component = HeaderComponent - config.skip_link_component = SkipLinkComponent config.exhibit_navbar_component = ExhibitNavbarComponent config.index.search_bar_component = ExhibitSearchBarComponent config.index.dropdown_component = DropdownComponent From 428c18a7a19de417a432edb999c1bee1a7844c05 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Tue, 17 Dec 2024 14:31:06 -0700 Subject: [PATCH 2/8] removing unneeded test --- spec/components/skip_link_component_spec.rb | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 spec/components/skip_link_component_spec.rb diff --git a/spec/components/skip_link_component_spec.rb b/spec/components/skip_link_component_spec.rb deleted file mode 100644 index 464b6a64b..000000000 --- a/spec/components/skip_link_component_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe SkipLinkComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end From 8bfb6210f06282e3fec33ef992c0ef1ce54751e2 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Wed, 18 Dec 2024 16:10:30 -0700 Subject: [PATCH 3/8] reverting --- app/components/skip_link_component | 5 +++++ app/components/skip_link_component.html.erb | 8 ++++++++ app/controllers/catalog_controller.rb | 1 + 3 files changed, 14 insertions(+) create mode 100644 app/components/skip_link_component diff --git a/app/components/skip_link_component b/app/components/skip_link_component new file mode 100644 index 000000000..dec18deb3 --- /dev/null +++ b/app/components/skip_link_component @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +# Overriding the skip link component to use the component library classes +class SkipLinkComponent < Blacklight::SkipLinkComponent +end diff --git a/app/components/skip_link_component.html.erb b/app/components/skip_link_component.html.erb index 195b2e778..2462628fc 100644 --- a/app/components/skip_link_component.html.erb +++ b/app/components/skip_link_component.html.erb @@ -1,5 +1,13 @@ +<<<<<<< HEAD +======= + +>>>>>>> 8ffccd0e (reverting) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index d856ccf1e..9ad8dbdc7 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -39,6 +39,7 @@ class CatalogController < ApplicationController # For browse category search to work it must be nil config.json_solr_path = nil config.header_component = HeaderComponent + config.skip_link_component = SkipLinkComponent config.exhibit_navbar_component = ExhibitNavbarComponent config.index.search_bar_component = ExhibitSearchBarComponent config.index.dropdown_component = DropdownComponent From b282109506975552ed9704b920a876ce2ff81d49 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Wed, 18 Dec 2024 16:19:52 -0700 Subject: [PATCH 4/8] no overriding of link classes needed --- app/components/skip_link_component.html.erb | 10 +--------- .../{skip_link_component => skip_link_component.rb} | 0 2 files changed, 1 insertion(+), 9 deletions(-) rename app/components/{skip_link_component => skip_link_component.rb} (100%) diff --git a/app/components/skip_link_component.html.erb b/app/components/skip_link_component.html.erb index 2462628fc..02ff71bcc 100644 --- a/app/components/skip_link_component.html.erb +++ b/app/components/skip_link_component.html.erb @@ -1,13 +1,5 @@ -<<<<<<< HEAD -======= - ->>>>>>> 8ffccd0e (reverting) + \ No newline at end of file diff --git a/app/components/skip_link_component b/app/components/skip_link_component.rb similarity index 100% rename from app/components/skip_link_component rename to app/components/skip_link_component.rb From 7f965152b25eb4f483da2fc6d59a0da9816c6a40 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Wed, 18 Dec 2024 17:01:31 -0700 Subject: [PATCH 5/8] changing to relative positioning should be sufficient --- app/components/skip_link_component.html.erb | 2 +- app/components/skip_link_component.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/skip_link_component.html.erb b/app/components/skip_link_component.html.erb index 02ff71bcc..b41f81cc9 100644 --- a/app/components/skip_link_component.html.erb +++ b/app/components/skip_link_component.html.erb @@ -1,4 +1,4 @@ -