Skip to content

Commit

Permalink
GBL Admin: latest work
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Dec 7, 2023
1 parent 8353259 commit efeca2d
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ gem 'bootstrap', '~> 4.0'
gem 'popper_js'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'geoblacklight', '~> 4.1'
gem 'geoblacklight_admin', '~> 0.3'
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "feature/bulk-actions-sti"
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"

Expand Down
76 changes: 41 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,42 @@ GIT
rails (>= 5.2, < 7.1)
statesman (~> 10.0.0)

GIT
remote: https://github.com/geobtaa/geoblacklight_admin.git
revision: d139c5e92480a25c28212dabd5233c7165522dfa
branch: feature/bulk-actions-sti
specs:
geoblacklight_admin (0.3.2)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
devise_invitable (~> 2.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.0)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 14.0)
pg (~> 1.4)
qa (~> 5.0)
rails (>= 6.1, < 7.1)
ruby-progressbar
simple_form (~> 5.0)
sprockets (< 4)
statesman (~> 10.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -96,7 +132,7 @@ GEM
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activerecord-import (1.5.0)
activerecord-import (1.5.1)
activerecord (>= 4.2)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
Expand Down Expand Up @@ -328,36 +364,6 @@ GEM
mime-types
rails (>= 6.1, < 7.1)
rgeo-geojson
geoblacklight_admin (0.3.2)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
devise_invitable (~> 2.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.0)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 14.0)
pg (~> 1.4)
qa (~> 5.0)
rails (>= 6.1, < 7.1)
ruby-progressbar
simple_form (~> 5.0)
sprockets (< 4)
statesman (~> 10.0)
geocoder (1.8.2)
git (1.11.0)
rchardet (~> 1.8)
Expand Down Expand Up @@ -507,7 +513,7 @@ GEM
rails (>= 5.2.0)
orm_adapter (0.5.0)
ostruct (0.5.5)
pagy (6.1.0)
pagy (6.2.0)
paper_trail (14.0.0)
activerecord (>= 6.0)
request_store (~> 1.4)
Expand All @@ -530,14 +536,14 @@ GEM
public_suffix (3.1.1)
puma (5.6.7)
nio4r (~> 2.0)
qa (5.10.0)
qa (5.11.0)
activerecord-import
deprecation
faraday (< 3.0, != 2.0.0)
geocoder
ldpath
nokogiri (~> 1.6)
rails (>= 5.0, < 7.1)
rails (>= 5.0, < 7.2)
rdf
racc (1.7.1)
rack (2.2.8)
Expand Down Expand Up @@ -791,7 +797,7 @@ DEPENDENCIES
foreman
geoblacklight (~> 4.1)
geoblacklight-icons!
geoblacklight_admin (~> 0.3)
geoblacklight_admin!
geoblacklight_sidecar_images!
haml
handlebars_assets (~> 0.23.0)
Expand Down
19 changes: 18 additions & 1 deletion app/controllers/admin/advanced_search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ class AdvancedSearchController < ApplicationController
config.advanced_search[:url_key] ||= 'advanced'
config.advanced_search[:query_parser] ||= 'edismax'
config.advanced_search[:form_solr_parameters] ||= {}
config.advanced_search[:form_solr_parameters]['facet.field'] ||= [Settings.FIELDS.PROVIDER, Settings.FIELDS.B1G_CODE, Settings.FIELDS.MEMBER_OF, Settings.FIELDS.IS_PART_OF, Settings.FIELDS.RESOURCE_CLASS, Settings.FIELDS.RESOURCE_TYPE, Settings.FIELDS.SUBJECT, Settings.FIELDS.THEME, Settings.FIELDS.FORMAT, Settings.FIELDS.SUPPRESSED, Settings.FIELDS.B1G_CHILD_RECORD, Settings.FIELDS.GEOREFERENCED]
config.advanced_search[:form_solr_parameters]['facet.field'] ||= [
Settings.FIELDS.PROVIDER,
Settings.FIELDS.B1G_DATE_ACCESSIONED,
Settings.FIELDS.B1G_CODE,
Settings.FIELDS.MEMBER_OF,
Settings.FIELDS.IS_PART_OF,
Settings.FIELDS.RESOURCE_CLASS,
Settings.FIELDS.RESOURCE_TYPE,
Settings.FIELDS.SUBJECT,
Settings.FIELDS.THEME,
Settings.FIELDS.FORMAT,
Settings.FIELDS.SUPPRESSED,
Settings.FIELDS.B1G_CHILD_RECORD,
Settings.FIELDS.GEOREFERENCED
]
config.advanced_search[:form_solr_parameters]['facet.query'] ||= ''
config.advanced_search[:form_solr_parameters]['facet.limit'] ||= -1
config.advanced_search[:form_solr_parameters]['facet.sort'] ||= 'index'
Expand Down Expand Up @@ -128,6 +142,9 @@ class AdvancedSearchController < ApplicationController

# ADVANCED SEARCH
#
# B1G Date Accessioned
config.add_facet_field Settings.FIELDS.B1G_DATE_ACCESSIONED, label: 'Date Accessioned', limit: 1000

# Code
config.add_facet_field Settings.FIELDS.B1G_CODE, label: 'Code', limit: 1000

Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class ApiController < ApplicationController
# Publication State
config.add_facet_field Settings.FIELDS.B1G_PUBLICATION_STATE, :label => 'Publication State', :limit => 8, collapse: false

# Import ID
config.add_facet_field Settings.FIELDS.B1G_IMPORT_ID, label: "Import ID", show: false

# Resouce Class
config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: 'Resource Class', limit: 8

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ class CatalogController < ApplicationController
:start => 0,
'q.alt' => '*:*',
'fl' => '*,score,[explain]',
'bf' => ["if(exists(#{Settings.FIELDS.B1G_CHILD_RECORD}),0,100)^0.5"],
'fq' => ["#{Settings.FIELDS.B1G_PUBLICATION_STATE}:published"]
'bf' => ["if(exists(#{Settings.FIELDS.B1G_CHILD_RECORD}),0,100)^0.5"]
}

config.default_per_page = 10 # Works!
Expand Down Expand Up @@ -157,6 +156,7 @@ class CatalogController < ApplicationController
# filter_class - Defines how to add/remove facet from query
# label - Defines the label used in contstraints container
config.add_facet_field 'solr_bboxtype', item_presenter: Geoblacklight::BboxItemPresenter, filter_class: Geoblacklight::BboxFilterField, filter_query_builder: Geoblacklight::BboxFilterQuery, within_boost: Settings.BBOX_WITHIN_BOOST, overlap_boost: Settings.OVERLAP_RATIO_BOOST, overlap_field: Settings.FIELDS.OVERLAP_FIELD, label: 'Bounding Box'
config.add_facet_field Settings.FIELDS.B1G_IMPORT_ID, label: "Import ID", show: false

# Item Relationship Facets
# * Not displayed to end user (show: false)
Expand Down
1 change: 1 addition & 0 deletions app/models/search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class SearchBuilder < Blacklight::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior
include BlacklightAdvancedSearch::AdvancedSearchBuilder
include B1gDateRangeQueryConcern::RangeLimitBuilder
include GeoblacklightAdmin::PublicationStateSearchBehavior

self.default_processor_chain += [:add_advanced_parse_q_to_solr, :add_advanced_search_to_solr]

Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ FIELDS:
:B1G_LANGUAGE: 'b1g_language_sm'
:B1G_MEDIATOR: 'b1g_dct_mediator_sm'
:B1G_PUBLICATION_STATE: 'b1g_publication_state_s'
:B1G_IMPORT_ID: 'b1g_geom_import_id_ssi'

GEOMONITOR_TOLERANCE: 0.8
#GOOGLE_ANALYTICS_ID: 'UA-XXXXX-X'
Expand Down

0 comments on commit efeca2d

Please sign in to comment.