blacklight 6.19.2 → 6.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/config/routes.rb +1 -1
- data/lib/blacklight/engine.rb +6 -2
- data/spec/routing/catalog_routing_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 469ca5ef4136d32bb5afe11a51dc7eeec97c6b0eded26f0e2d1a9c607fa175a1
|
4
|
+
data.tar.gz: 7061a8348a91417bffdacb4f7f508e3f1cba134d754ca1cbbe33743229e09e31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6427d562139eb605f5bd5e53d61a9f13abb2a1c35430fc20e21fc8e3a3035f8b7c6c2a9f8b72449db2a6478410a64cd1031ed7e17e42611ceb3be0ebe1b65fa9
|
7
|
+
data.tar.gz: c0a27859a10d9c1a97bc2f16794d000b407704146f543aec1acd77fe714626e4ce6cc8e2d93be9d7d066ddb4bccf2faaf84107d5dc9e9266f69c3fcb9bec8566
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.20.0
|
data/config/routes.rb
CHANGED
@@ -7,7 +7,7 @@ Blacklight::Engine.routes.draw do
|
|
7
7
|
put "saved_searches/save/:id", :to => "saved_searches#save", :as => "save_search"
|
8
8
|
delete "saved_searches/forget/:id", :to => "saved_searches#forget", :as => "forget_search"
|
9
9
|
post "saved_searches/forget/:id", :to => "saved_searches#forget"
|
10
|
-
post "/catalog/:id/track", to: 'catalog#track', as: 'track_search_context'
|
10
|
+
post "/catalog/:id/track", to: 'catalog#track', as: 'track_search_context', constraints: { id: Blacklight::Engine.config.routes.identifier_constraint }
|
11
11
|
|
12
12
|
resources :suggest, only: :index, defaults: { format: 'json' }
|
13
13
|
end
|
data/lib/blacklight/engine.rb
CHANGED
@@ -7,7 +7,7 @@ module Blacklight
|
|
7
7
|
require 'twitter-typeahead-rails'
|
8
8
|
|
9
9
|
# BlacklightHelper is needed by all helpers, so we inject it
|
10
|
-
# into action view base here.
|
10
|
+
# into action view base here.
|
11
11
|
initializer 'blacklight.helpers' do |app|
|
12
12
|
ActionView::Base.send :include, BlacklightHelper
|
13
13
|
end
|
@@ -43,8 +43,12 @@ module Blacklight
|
|
43
43
|
'Cricket' => 'mms.mycricket.com'
|
44
44
|
}
|
45
45
|
|
46
|
+
config.routes = OpenStruct.new
|
47
|
+
# Set identifier_constraint to enforce a format for the document identifiers
|
48
|
+
config.routes.identifier_constraint = /[\w-]+/
|
49
|
+
|
46
50
|
config.bookmarks_http_method = :post
|
47
|
-
|
51
|
+
|
48
52
|
config.email_regexp = defined?(Devise) ? Devise.email_regexp : /\A[^@\s]+@[^@\s]+\z/
|
49
53
|
end
|
50
54
|
end
|
@@ -21,6 +21,22 @@ describe "Routing" do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
describe 'tracking' do
|
25
|
+
context 'when the routing constraint is set to allow periods' do
|
26
|
+
before do
|
27
|
+
if Rails.version < '5.2.0'
|
28
|
+
skip 'requires https://github.com/rails/rails/pull/22435'
|
29
|
+
end
|
30
|
+
allow(Blacklight::Engine.config.routes).to receive(:identifier_constraint).and_return(%r{[^/]+})
|
31
|
+
Rails.application.reload_routes!
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'routes to #track' do
|
35
|
+
expect(post('/catalog/gallica.bnf.fr/track')).to route_to('catalog#track', id: 'gallica.bnf.fr')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
24
40
|
|
25
41
|
describe "solr_document_path for SolrDocument", :test => true do
|
26
42
|
it "routes correctly" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2019-
|
20
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|