• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / 4c391e0e-519a-40cb-8ad3-354445f4ce03

12 Aug 2025 08:47PM UTC coverage: 85.348% (-10.0%) from 95.335%
4c391e0e-519a-40cb-8ad3-354445f4ce03

push

circleci

web-flow
[#5143] Use access restriction note as Aeon ItemInfo1 if available (#5173)

With this commit, if a user visits a record with an access
restrictions note and presses the Reading Room Request
button, they will get to an Aeon form with the 'Restrictions'
field pre-filled with the restriction note.

If the record does not have an access restrictions note,
the field will be pre-filled with 'Reading Room Access Only',
as it has been previously.

Closes #5143

5493 of 6436 relevant lines covered (85.35%)

251.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.37
/app/models/concerns/blacklight/document/cite_proc.rb
1
# frozen_string_literal: true
2

3
## Adds the methods needed for CiteProc citations,
4
# Including MLA, APA, and Chicago
5
module Blacklight::Document::CiteProc
1✔
6
  private
1✔
7

8
    def properties
1✔
9
      props = {}
15✔
10
      props[:id] = id
15✔
11
      props[:edition] = cite_proc_edition if cite_proc_edition
15✔
12
      props[:type] = cite_proc_type if cite_proc_type
15✔
13
      props[:author] = cite_proc_authors if cite_proc_authors
15✔
14
      props[:title] = cite_proc_title if cite_proc_title
15✔
15
      props[:publisher] = cite_proc_publisher if cite_proc_publisher
15✔
16
      props[:'publisher-place'] = cite_proc_publisher_place if cite_proc_publisher_place
15✔
17
      props[:issued] = cite_proc_issued if cite_proc_issued
15✔
18
      props
15✔
19
    end
20

21
    def cite_proc_type
1✔
22
      self[:format]&.first&.downcase
30✔
23
    end
24

25
    def cite_proc_authors
1✔
26
      @cite_proc_authors ||= cleaned_authors&.map do |author|
29✔
27
        if author.include?(', ')
14✔
28
          family, given = author.split(', ')
14✔
29
          CiteProc::Name.new(family:, given:)
14✔
30
        else
31
          CiteProc::Name.new(literal: author)
×
32
        end
33
      end
34
    end
35

36
    # Can remove after https://github.com/pulibrary/bibdata/issues/2646 is completed & re-indexed
37
    def cleaned_authors
1✔
38
      self[:author_citation_display]&.map do |author|
15✔
39
        # remove any parenthetical statements from author, as used for Corporate authors in Marc
40
        author.sub(/ \(.*\)/, '')
14✔
41
      end
42
    end
43

44
    def cite_proc_edition
1✔
45
      @cite_proc_edition ||= begin
30✔
46
        str = self[:edition_display]&.first
15✔
47
        str&.dup&.sub!(/[[:punct:]]?$/, '')
15✔
48
      end
49
    end
50

51
    def cite_proc_title
1✔
52
      @cite_proc_title ||= self[:title_citation_display]&.first
30✔
53
    end
54

55
    def cite_proc_publisher
1✔
56
      @cite_proc_publisher ||= begin
30✔
57
        publisher = self[:pub_citation_display]&.first&.split(': ').try(:[], 1)
15✔
58
        publisher&.gsub(/^<(.*)>$/, '\1')
15✔
59
      end
60
    end
61

62
    def cite_proc_publisher_place
1✔
63
      @cite_proc_publisher_place ||= self[:pub_citation_display]&.first&.split(': ').try(:[], 0)
30✔
64
    end
65

66
    def cite_proc_issued
1✔
67
      @cite_proc_issued ||= self[:pub_date_start_sort]
30✔
68
    end
69
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc