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

pulibrary / orangelight / 0e37073d-109c-440c-949f-49d2aa86311b

18 Aug 2025 09:05PM UTC coverage: 0.482% (-94.9%) from 95.343%
0e37073d-109c-440c-949f-49d2aa86311b

push

circleci

web-flow
Replace per_page_options_for_select with custom component to avoid deprecation issue (#5186)

* Start creating new component to address deprecaton warning

* Replace per_page_options_for_select with custom component to avoid deprecation issue

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

---------

Co-authored-by: Ryan Jensen <rj1044@princeton.edu>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

0 of 33 new or added lines in 1 file covered. (0.0%)

9374 existing lines in 213 files now uncovered.

47 of 9753 relevant lines covered (0.48%)

0.01 hits per line

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

0.0
/app/models/requests/submissions/digitize_item.rb
1
# frozen_string_literal: true
UNCOV
2
require 'faraday'
×
3

UNCOV
4
module Requests::Submissions
×
UNCOV
5
  class DigitizeItem < Service
×
UNCOV
6
    def initialize(submission, service_type: 'digitize')
×
UNCOV
7
      super
×
UNCOV
8
      @service_types = { digitize: { cited_pages: '', note: 'Digitization Request' },
×
UNCOV
9
                         annex_edd: { cited_pages: 'Annex EDD', note: 'Digitization Request Forrestal Annex Item' },
×
UNCOV
10
                         marquand_edd: { cited_pages: 'Marquand EDD', note: 'Digitization Request Marquand Item' },
×
UNCOV
11
                         clancy_edd: { cited_pages: 'Marquand Clancy EDD', note: 'Digitization Request Marquand Item at Clancy' },
×
UNCOV
12
                         clancy_unavailable_edd: { cited_pages: 'Marquand Clancy UNAVAIL EDD', note: 'Digitization Request Marquand Item at Clancy (Unavailable)' } }
×
UNCOV
13
    end
×
14

15
    # rubocop:disable Naming/PredicateMethod
UNCOV
16
    def handle
×
UNCOV
17
      params = @service_types[service_type.to_sym]
×
UNCOV
18
      items = @submission.filter_items_by_service(service_type)
×
UNCOV
19
      items.each do |item|
×
UNCOV
20
        item_status = handle_item(item:, **params)
×
UNCOV
21
        if item_status.present?
×
UNCOV
22
          item["transaction_number"] = item_status["TransactionNumber"].to_s
×
UNCOV
23
          @sent << item_status if item_status.present?
×
UNCOV
24
        end
×
UNCOV
25
      end
×
UNCOV
26
      return false if @errors.present?
×
UNCOV
27
    end
×
28
    # rubocop:enable Naming/PredicateMethod
29

UNCOV
30
    def submitted
×
31
      @sent
×
UNCOV
32
    end
×
33

UNCOV
34
    private
×
35

UNCOV
36
      def handle_item(item:, note:, cited_pages:)
×
UNCOV
37
        client = Requests::IlliadTransactionClient.new(patron: @submission.patron, metadata_mapper: Requests::IlliadMetadata::ArticleExpress.new(patron: @submission.patron, bib: @submission.bib, item:, note:, cited_pages:))
×
UNCOV
38
        transaction = client.create_request
×
UNCOV
39
        errors << { type: 'digitize', bibid: @submission.bib, item:, user_name: @submission.user_name, barcode: @submission.user_barcode, error: "Invalid Illiad Patron" } if transaction.blank?
×
UNCOV
40
        if transaction == "DISAVOWED"
×
UNCOV
41
          errors << { type: 'digitize', bibid: @submission.bib, item:, user_name: @submission.user_name, barcode: @submission.user_barcode, error: "You no longer have an active account and may not make digitization requests." }
×
UNCOV
42
          transaction = nil
×
UNCOV
43
        end
×
UNCOV
44
        transaction
×
UNCOV
45
      end
×
UNCOV
46
  end
×
UNCOV
47
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