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

Smart auto suggest #1154

Draft
wants to merge 79 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7dfa5c2
Use propshaft + cssbundling-rails instead of sprockets
thatbudakguy Jul 30, 2024
da350fc
Use bootstrap 5
thatbudakguy Jul 30, 2024
a73b172
Use blacklight 8 and the GBL blacklight 8 branch
thatbudakguy Jul 30, 2024
3dd8524
Remove an old override
thatbudakguy Jul 30, 2024
5dbafb5
Update Gemfile.lock
thatbudakguy Jul 30, 2024
31c390a
Remove calls to functions removed in BL8
thatbudakguy Jul 30, 2024
5cdd1ef
Remove blacklight base layout override
thatbudakguy Jul 30, 2024
fa9f598
move css to cssbundling-rails
dnoneill Jul 30, 2024
a7db796
Reset styles to GeoBlacklight default
thatbudakguy Jul 30, 2024
03d1e81
Install importmap, stimulus, and turbo
thatbudakguy Jul 30, 2024
68a3aa7
Remove some unused partials
thatbudakguy Jul 30, 2024
a5636d0
Set up the import map
thatbudakguy Jul 30, 2024
73e0031
Remove the old javascripts
thatbudakguy Jul 30, 2024
95aacd0
fix blacklight solr url location
dnoneill Jul 31, 2024
59358ea
Merge pull request #1108 from sul-dlss/bl8-ok-computer-fix
marlo-longley Jul 31, 2024
8d62c92
Add vendorized GBL JS
thatbudakguy Jul 31, 2024
bcbe7f4
Make the catalogcontroller more like GBL5's default
thatbudakguy Aug 1, 2024
9e75185
Remove partials we don't need to use anymore
thatbudakguy Aug 1, 2024
acd1b42
update header to stanford header
dnoneill Jul 30, 2024
42cac5b
use bootstrap.bundle instead of bootstrap
dnoneill Aug 1, 2024
9620476
Merge pull request #1118 from sul-dlss/bl8-1116
thatbudakguy Aug 1, 2024
4e203b1
Merge pull request #1104 from sul-dlss/bl8-header
dnoneill Aug 2, 2024
aac4ab8
add footer
dnoneill Jul 31, 2024
4c4d5ae
Merge pull request #1115 from sul-dlss/bl8-footer
thatbudakguy Aug 5, 2024
b0a7c94
Update ruby.yml
dnoneill Aug 5, 2024
cf29761
fix tests
dnoneill Aug 5, 2024
22b6335
Merge pull request #1123 from sul-dlss/fix-tests
jmartin-sul Aug 5, 2024
3b2a8d8
Use geoblacklight main
edsu Aug 7, 2024
202bc35
Merge pull request #1131 from sul-dlss/use-gbl-main
dnoneill Aug 7, 2024
164983e
remove basemap override
dnoneill Aug 8, 2024
61ab801
Align solr versions
edsu Aug 8, 2024
59a1175
Merge pull request #1139 from sul-dlss/solr-version
thatbudakguy Aug 8, 2024
cca150a
Merge pull request #1134 from sul-dlss/basemap
thatbudakguy Aug 8, 2024
0ba1eb5
move sidebar, update display
dnoneill Aug 7, 2024
1a76663
Merge pull request #1132 from sul-dlss/bl8-sidebar
dnoneill Aug 8, 2024
bb15271
update home page text to figma, add recently added
dnoneill Aug 2, 2024
780ada6
Merge pull request #1120 from sul-dlss/bl8-homepage
thatbudakguy Aug 8, 2024
e800b2a
cd for bl8
dnoneill Aug 8, 2024
767995a
Merge pull request #1140 from sul-dlss/bl8-cd
jmartin-sul Aug 8, 2024
66fb15c
remove local version of component library
dnoneill Aug 8, 2024
204e00b
Merge pull request #1142 from sul-dlss/component-library
jcoyne Aug 8, 2024
dcbca70
Update to the latest version of component library
jcoyne Aug 8, 2024
3f8f64d
Merge pull request #1144 from sul-dlss/jcoyne-patch-1
dnoneill Aug 8, 2024
c08a5f5
remove icons, styling updates
dnoneill Aug 8, 2024
1dc958e
move sidebar to document
dnoneill Aug 9, 2024
d1242e5
Merge pull request #1103 from sul-dlss/bl8-icons
marlo-longley Aug 9, 2024
2c65b10
Merge pull request #1147 from sul-dlss/bl8-sidebar-fix
thatbudakguy Aug 9, 2024
b2c1f91
add box shadow, center titles
dnoneill Aug 8, 2024
8592a4b
Merge pull request #1141 from sul-dlss/bl8-hover
dnoneill Aug 9, 2024
ac43f5a
fix legacy icons, info_format
dnoneill Aug 12, 2024
245730a
Merge pull request #1155 from sul-dlss/bl8-icons-fix
thatbudakguy Aug 12, 2024
4104dc7
update show to be three columns
dnoneill Aug 9, 2024
b4d12c7
Merge pull request #1150 from sul-dlss/bl8-show
dnoneill Aug 12, 2024
3d85014
update the search results view
dnoneill Aug 9, 2024
05a2b65
Update to the latest version of the component library
jcoyne Aug 13, 2024
93abc78
Merge pull request #1149 from sul-dlss/bl8-results-component
dnoneill Aug 13, 2024
4b0a7a9
Merge pull request #1164 from sul-dlss/jcoyne-patch-1
dnoneill Aug 13, 2024
cda3afc
add header icons to show page
dnoneill Aug 12, 2024
9c24abf
add georeferenced alert and unit tests
dnoneill Aug 12, 2024
220feea
update index map colors
dnoneill Aug 13, 2024
1d5c3a1
Merge pull request #1161 from sul-dlss/bl8-georeference-alert
dnoneill Aug 13, 2024
1a73e38
small header icons fixes search page
dnoneill Aug 13, 2024
f5f4be4
move search header into document split
dnoneill Aug 14, 2024
c06a42d
Merge pull request #1169 from sul-dlss/bl8-css-fixes
thatbudakguy Aug 14, 2024
0b4f580
Merge pull request #1167 from sul-dlss/bl8-index-map-colors
thatbudakguy Aug 14, 2024
e34910f
Merge pull request #1160 from sul-dlss/1159-show-icons
thatbudakguy Aug 14, 2024
7f2bb3b
Use container-fluid and set max-width to 1600px
marlo-longley Aug 15, 2024
162eaae
Merge pull request #1173 from sul-dlss/bl8-results-header
dnoneill Aug 15, 2024
6d25636
Merge pull request #1181 from sul-dlss/container-fluid
dnoneill Aug 15, 2024
7860d62
remove hgl
dnoneill Aug 19, 2024
a77bb8b
Merge pull request #1197 from sul-dlss/hgl
thatbudakguy Aug 19, 2024
cdbfb12
Point at CDN versions of stylesheets for dependencies
thatbudakguy Aug 19, 2024
09024a1
Merge pull request #1212 from sul-dlss/style-cdn-deps
dnoneill Aug 20, 2024
4943e12
setting up autocomplete to retrieve search result titles
hudajkhan Aug 3, 2024
64f6cf1
adding configuration options for testing and updates to display and s…
hudajkhan Aug 6, 2024
b7b29f6
handling higlighting display
hudajkhan Aug 6, 2024
0ec3f9e
Adjust suggest configuration and behavior
edsu Aug 11, 2024
74e74a5
using overloaded payload approach
hudajkhan Aug 21, 2024
c09bef6
truncating long suggestion strings
hudajkhan Aug 21, 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
Prev Previous commit
Next Next commit
add georeferenced alert and unit tests
dnoneill committed Aug 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9c24abfd639040daf46ba55a7d27c399a7214e4d
8 changes: 8 additions & 0 deletions app/components/earthworks/alert_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div role="alert" class="alert alert-<%= type %> d-flex shadow-sm align-items-center">
<% if title %><div class="fw-semibold"><%= title %></div><% end %>
<div class="bi <%= icon %> fs-3 me-3 align-self-center
d-flex justify-content-center"></div>
<div class="text-body">
<div><%= body %></div>
</div>
</div>
20 changes: 20 additions & 0 deletions app/components/earthworks/alert_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Earthworks
class AlertComponent < ViewComponent::Base
attr_reader :title, :body, :type, :icon

def initialize(body:, type:, title: nil)
super
@title = title
@body = body
@type = type
@icon = match_icon
end

def match_icon
icon_mapping = { 'info' => 'bi-info-circle-fill', 'warning' => 'bi-exclamation-triangle-fill',
'danger' => 'bi-exclamation-triangle-fill', 'sucess' => 'bi-check-circle-fill',
'note' => 'bi-exclamation-circle-fill' }
icon_mapping[type]
end
end
end
3 changes: 3 additions & 0 deletions app/views/layouts/catalog_result.html.erb
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
</section>

<section class="col-lg-5">
<% if (@document.file_format.include?('JPEG') || @document.item_viewer.iiif) && !@document[Settings.FIELDS[:GEOREFERENCED]] %>
<%= render Earthworks::AlertComponent.new(type: 'info', body: t('earthworks.show.no_georeference_message')) %>
<% end %>
<%= render Geoblacklight::ViewerContainerComponent.new(document: @document) %>
<%= render Geoblacklight::AttributeTableComponent.new(document: @document) %>
<%= render Geoblacklight::IndexMapInspectComponent.new(document: @document) %>
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -10,3 +10,5 @@ en:
maps:
header: Scanned maps
description: Need copy for this ... contains over %{sets} maps...
show:
no_georeference_message: 'This map is not georeferenced.'
24 changes: 24 additions & 0 deletions spec/features/georeference_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'rails_helper'

describe 'Show page' do
context 'when gbl_georeferenced_b is not set' do
it 'have georeference alert' do
visit solr_document_path 'stanford-dt131hw5005'
expect(page).to have_content 'This map is not georeferenced.'
end
end

context 'when gbl_georeferenced_b is set to true' do
it 'does not have georeference alert' do
visit solr_document_path 'princeton-02870w62c'
expect(page).to have_no_content 'This map is not georeferenced.'
end
end

context 'when page is a non iiif page' do
it 'does not have georeference alert' do
visit solr_document_path 'mit-001145244'
expect(page).to have_no_content 'This map is not georeferenced.'
end
end
end
3 changes: 2 additions & 1 deletion spec/fixtures/solr_documents/public_iiif_princeton.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"dct_subject_sm": ["New York (State)‒Maps", "New Jersey‒Maps"],
"dct_title_s": "The provinces of New York and New Jersey, with part of Pensilvania, and the Province of Quebec : drawn by Major Holland, Surveyor General, of the Northern District in America. Corrected and improved, from the original materials, by Governr. Pownall, Member of Parliament, 1776",
"dct_creator_sm": ["Rogers, Henry Darwin", "Pownall, Thomas"],
"dct_references_s": "{\"http://schema.org/url\":\"http://arks.princeton.edu/ark:/88435/02870w62c\",\"http://schema.org/thumbnailUrl\":\"http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/full/50,/0/default.jpg\",\"http://iiif.io/api/image\":\"http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/info.json\"}",
"dct_references_s": "{\"http://schema.org/url\":\"http://arks.princeton.edu/ark:/88435/02870w62c\",\"http://schema.org/thumbnailUrl\":\"https://iiif-cloud.princeton.edu/iiif/2/6c%2F52%2F12%2F6c5212e81bc845f59bb1cdc740a88bad%2Fintermediate_file/full/50,/0/default.jpg\",\"http://iiif.io/api/image\":\"https://iiif-cloud.princeton.edu/iiif/2/6c%2F52%2F12%2F6c5212e81bc845f59bb1cdc740a88bad%2Fintermediate_file/info.json\"}",
"dct_spatial_sm": ["New York (State)", "New Jersey", "Pennsylvania"],
"dct_temporal_sm": ["1778"],
"dct_issued_s": "1778",
@@ -24,5 +24,6 @@
"gbl_indexYear_im": [1778],
"gbl_resourceClass_sm": ["Datasets"],
"gbl_resourceType_sm": ["Raster data"],
"gbl_georeferenced_b": true,
"gbl_mdVersion_s": "Aardvark"
}