iiif_print 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1fb1a28565daaa498895ea28019b1a5d9cb16e01558872b4840e19ab002fb07
4
- data.tar.gz: 76a5d7afeda6cb264d2a77e31ff0e60be1c8d2a416917907a4d848e3b8975e63
3
+ metadata.gz: 512bd4a70c6b11e94a4d82fb786264bb124c4ca38ca33549d34e3bcb6d0e37bc
4
+ data.tar.gz: 0b363334d97c0a97bc5b4ed8685c9be41f9ab7124e027af6a1334f2f53f6e86c
5
5
  SHA512:
6
- metadata.gz: '08d25b39fccf79fe3b147b35dd8eb7fff99ac9d66bb91426ea4c1b98a16009b539f48283850225725f8ebd1d62876f3d30ff61508722f09def19eb02b67f4b63'
7
- data.tar.gz: ef3c25dca1cdc1ab648d90ec303ad56df9a26fc6df4358e610154634eccd934b64295d99c2611fd454b8321d761f7aca9bcde4263495ac2fdfc58cca8447bc61
6
+ metadata.gz: 4e31e9b19c7ca850977bc1a04c912a98d49116d1b780e7ecdde7be43abbe447e44eceb20bc18be0d038887257b0432fc15ae79d20609ec9dfdea75e8946a82cc
7
+ data.tar.gz: b9639133a35990cabfe146fb13866e9a948e418a48a36962de3d10a70b52794f2466de9e789d851b778d91fa165659f4b90560759aee0b421313d9326ef2329d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /app/samvera/hyrax-webapp
3
3
  specs:
4
- iiif_print (3.1.1)
4
+ iiif_print (3.1.2)
5
5
  blacklight_iiif_search (>= 1.0, < 3.0)
6
6
  derivative-rodeo (~> 0.5)
7
7
  hyrax (>= 2.5, < 6)
@@ -26,7 +26,7 @@ module IiifPrint
26
26
  return { q: 'nil:nil' } unless q
27
27
 
28
28
  {
29
- q: "#{q} AND has_model_ssim:FileSet AND (#{iiif_config[:object_relation_field]}:\"#{parent_document.id}\" OR id:\"#{parent_document.id}\")",
29
+ q: "(#{q}) AND has_model_ssim:FileSet AND (#{iiif_config[:object_relation_field]}:\"#{parent_document.id}\" OR id:\"#{parent_document.id}\")",
30
30
  rows: rows,
31
31
  page: page
32
32
  }
@@ -36,8 +36,9 @@ module IiifPrint
36
36
 
37
37
  query_terms = sanitized_query.split(' ')
38
38
 
39
+ terms_pattern = Regexp.union(query_terms)
39
40
  matches = coords_json['coords'].select do |k, _v|
40
- k.downcase =~ /(#{query_terms.join('|')})/
41
+ k.downcase.match?(terms_pattern)
41
42
  end
42
43
  return default_coords if matches.blank?
43
44
 
@@ -113,16 +114,16 @@ module IiifPrint
113
114
 
114
115
  ##
115
116
  # This method is a workaround to compensate for overriding the solr_params method in
116
- # BlacklightIiifSearch::IiifSearch. In the override, the solr_params method adds an additional filter to the query
117
- # to include either the object_relation_field OR the parent document's id and removes the :f parameter from the
118
- # query. This resulted in the query split here returning more than the actual query term.
117
+ # BlacklightIiifSearch::IiifSearch. In the override, the solr_params method wraps the user's query in
118
+ # parentheses and adds filters for the FileSet model and the object_relation_field OR the parent document's id.
119
+ # This extracts the user's query from inside those parentheses so the filters are not treated as search terms.
119
120
  #
120
121
  # @see IiifPrint::IiifSearchDecorator#solr_params
121
- # @return [Regexp] A regular expression to find the last AND and everything after it
122
+ # @return [Regexp] A regular expression capturing the user's query
122
123
  # @example
123
- # 'foo AND (is_page_of_ssim:\"123123\" OR id:\"123123\")' #=> 'foo'
124
+ # '(foo) AND has_model_ssim:FileSet AND (is_page_of_ssim:\"123123\" OR id:\"123123\")' #=> 'foo'
124
125
  def additional_query_terms_regex
125
- /(.*)(?= AND (\(.+\)|\w+)$)/
126
+ /\A\((.*)\) AND has_model_ssim/m
126
127
  end
127
128
 
128
129
  ##
@@ -96,7 +96,7 @@ module IiifPrint
96
96
  # of finding child works by title.
97
97
  # rubocop:disable Lint/UnusedMethodArgument, Metrics/AbcSize, Metrics/MethodLength
98
98
  def self.destroy_children_split_from(file_set:, work:, model:, user:)
99
- all_child_works = Hyrax.custom_queries.find_child_works(resource: work)
99
+ all_child_works = Hyrax.custom_queries.find_child_works(resource: work).to_a
100
100
  return if all_child_works.blank?
101
101
  # look first for children by the file set id they were split from
102
102
  children = all_child_works.select { |m| m.split_from_pdf_id == file_set.id }
@@ -1,3 +1,3 @@
1
1
  module IiifPrint
2
- VERSION = '3.1.1'.freeze
2
+ VERSION = '3.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iiif_print
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Upton
@@ -11,10 +11,9 @@ authors:
11
11
  - Kirk Wang
12
12
  - LaRita Robinson
13
13
  - Jeremy Friesen
14
- autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
- date: 2026-06-23 00:00:00.000000000 Z
16
+ date: 1980-01-02 00:00:00.000000000 Z
18
17
  dependencies:
19
18
  - !ruby/object:Gem::Dependency
20
19
  name: blacklight_iiif_search
@@ -497,7 +496,6 @@ homepage: https://github.com/notch8/iiif_print/
497
496
  licenses:
498
497
  - Apache-2.0
499
498
  metadata: {}
500
- post_install_message:
501
499
  rdoc_options: []
502
500
  require_paths:
503
501
  - lib
@@ -512,8 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
512
510
  - !ruby/object:Gem::Version
513
511
  version: '0'
514
512
  requirements: []
515
- rubygems_version: 3.3.20
516
- signing_key:
513
+ rubygems_version: 3.6.7
517
514
  specification_version: 4
518
515
  summary: IiifPrint is a gem (Rails "engine") for Hyrax-based digital repository applications
519
516
  to support displaying parent/child works in the same viewer (Universal Viewer) and