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

Accessibility issues #1447

Closed
wants to merge 11 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $hierarchy-view-collapse-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3
}

.al-hierarchy-highlight > .documentHeader {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would leave this in -- I think it is useful to visually highlight the currently selected item. And now that you have unlinked the current highlighted item, its text color is black so there's no contrast issue to resolve on the highlighted document.

background: $mark-bg;
font-weight: bold;
}

#collection-context {
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/arclight/modules/truncator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@

// "view more"/"view less" text swaps when content is expanded
.view-more {
color: $blue-600;
display: inline;
}

.view-less {
color: $blue-600;
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
%>
<% end %>
<div class="index_title document-title-heading" data-turbo="false">
<%= helpers.link_to_document document, counter: @counter %>
<% if current_target? %>
<%= document.normalized_title %>
<% else %>
<%= helpers.link_to_document document, counter: @counter %>
<% end %>
<% if document.children? %>
<span class="badge badge-pill bg-secondary badge-secondary al-number-of-children-badge"><%= document.number_of_children %><span class="sr-only visually-hidden"><%= t(:'arclight.views.index.number_of_components', count: document.number_of_children) %></span></span>
<% end %>
Expand Down
4 changes: 3 additions & 1 deletion app/components/arclight/group_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<% end %>
<h3><%= helpers.link_to_document document %></h3>
<%= tag.span(document.extent, class: 'al-document-extent badge') if document.extent %>
<%= render Arclight::IndexMetadataFieldComponent.with_collection(presenter.field_presenters.select { |field| !compact? || field.field_config.compact }) %>
<dl>
<%= render Arclight::IndexMetadataFieldComponent.with_collection(presenter.field_presenters.select { |field| !compact? || field.field_config.compact }) %>
</dl>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<%= tag.dd(class: @classes + ['truncator'], data: { controller: 'arclight-truncate' }) do %>
<%= tag.div @field.render, class: 'content', data: { arclight_truncate_target: 'content' } %>
<%= button_tag(type: :button, class: 'btn btn-sm btn-link px-0',
data: { action: 'click->arclight-truncate#trigger' },
aria: { hidden: true }) do %>
data: { action: 'click->arclight-truncate#trigger' }) do %>
<%= tag.span t('arclight.truncation.view_more'), class: 'view-more' %>
<%= tag.span t('arclight.truncation.view_less'), class: 'view-less' %>
<%= tag.span(class: 'icon') %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<div class='breadcrumb-links'>
<%= rendered_breadcrumbs %>
</div>
<dt class="visually-hidden">Collection Context</dt>
<dd>
<div class='breadcrumb-links'>
<%= rendered_breadcrumbs %>
</div>
</dd>
8 changes: 8 additions & 0 deletions app/views/catalog/_document_list.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% # Override to remove id="documents" on div. When documents are grouped it causes duplicate id issues %>
<% # https://github.com/projectblacklight/blacklight/blob/v8.1.0/app/views/catalog/_document_list.html.erb %>
<% # container for all documents in index list view -%>
<% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
<div class="al-document-listings documents-<%= view_config&.key || document_index_view_type %>">
<% document_presenters = documents.map { |doc| document_presenter(doc) } -%>
<%= render view_config.document_component.with_collection(document_presenters, partials: view_config.partials, counter_offset: @response&.start || 0) %>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_group.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% # container for all groups in index view -%>
<div class='al-grouped-results'>
<div id="documents" class='al-grouped-results'>
<%= render (blacklight_config.view_config(document_index_view_type).group_component || Arclight::GroupComponent).with_collection(@response.groups) %>
</div>
6 changes: 3 additions & 3 deletions spec/features/collection_filtering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

click_button 'Search'

expect(page).to have_css('#documents .document', count: 10) # has results
expect(page).to have_css('.al-document-listings .document', count: 10) # has results
expect(page).not_to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992')
end
end
Expand Down Expand Up @@ -52,7 +52,7 @@
click_button 'Search'

expect(page).to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992')
expect(page).to have_css('#documents .document', count: 1) # has results
expect(page).to have_css('.al-document-listings .document', count: 1) # has results
end

it 'allows the user to choose to search all collections' do
Expand All @@ -63,7 +63,7 @@
click_button 'Search'

expect(page).not_to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992')
expect(page).to have_css('#documents .document', count: 10) # has results
expect(page).to have_css('.al-document-listings .document', count: 10) # has results
end
end
end
4 changes: 2 additions & 2 deletions spec/features/collection_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@
it 'clicking contents does not change the session results view context' do
visit search_catalog_path q: '', search_field: 'all_fields'

expect(page).to have_css('#documents.documents-list')
expect(page).not_to have_css('#documents.documents-hierarchy')
expect(page).to have_css('.al-document-listings.documents-list')
expect(page).not_to have_css('.al-document-listings.documents-hierarchy')
end
end
end
Expand Down