• 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/controllers/feedback_controller.rb
1
# frozen_string_literal: true
2

UNCOV
3
class FeedbackController < ApplicationController
×
UNCOV
4
  include ApplicationHelper
×
5

UNCOV
6
  before_action :current_user_email
×
UNCOV
7
  before_action :build_feedback_form, only: [:create]
×
UNCOV
8
  before_action :build_ask_a_question_form, only: [:ask_a_question]
×
UNCOV
9
  before_action :build_suggest_correction_form, only: [:suggest_correction]
×
UNCOV
10
  before_action :build_report_biased_results_form, only: [:report_biased_results]
×
11

UNCOV
12
  def new
×
UNCOV
13
    @feedback_form = FeedbackForm.new if @feedback_form.nil?
×
UNCOV
14
    @feedback_form.current_url = request.referer || root_url
×
UNCOV
15
  end
×
16

UNCOV
17
  def create
×
UNCOV
18
    respond_to do |format|
×
UNCOV
19
      if @feedback_form.valid?
×
UNCOV
20
        @feedback_form.deliver
×
UNCOV
21
        format.js { flash.now[:notice] = I18n.t('blacklight.feedback.success') }
×
UNCOV
22
      else
×
UNCOV
23
        format.js { flash.now[:error] = @feedback_form.error_message }
×
UNCOV
24
      end
×
UNCOV
25
    end
×
UNCOV
26
  end
×
27

UNCOV
28
  def ask_a_question; end
×
29

UNCOV
30
  def suggest_correction; end
×
31

UNCOV
32
  def report_biased_results; end
×
33

UNCOV
34
  protected
×
35

UNCOV
36
    def build_feedback_form
×
UNCOV
37
      @feedback_form = FeedbackForm.new(feedback_form_params)
×
UNCOV
38
      @feedback_form.request = request
×
UNCOV
39
      @feedback_form
×
UNCOV
40
    end
×
41

UNCOV
42
    def feedback_form_params
×
UNCOV
43
      params.require(:feedback_form).permit(:name, :email, :message, :current_url, :feedback_desc)
×
UNCOV
44
    end
×
45

UNCOV
46
    def build_ask_a_question_form
×
UNCOV
47
      @question_form = AskAQuestionForm.new(
×
UNCOV
48
        context: page_url(question_form_params),
×
UNCOV
49
        title: question_form_params['title']
×
UNCOV
50
      )
×
UNCOV
51
    end
×
52

UNCOV
53
    def question_form_params
×
UNCOV
54
      params.require(:ask_a_question_form).permit(:id, :title)
×
UNCOV
55
    end
×
56

UNCOV
57
    def build_suggest_correction_form
×
UNCOV
58
      @suggest_correction_form = SuggestCorrectionForm.new(
×
UNCOV
59
        context: page_url(suggest_correction_form_params),
×
UNCOV
60
        title: suggest_correction_form_params['title']
×
UNCOV
61
      )
×
UNCOV
62
    end
×
63

UNCOV
64
    def suggest_correction_form_params
×
UNCOV
65
      params.require(:suggest_correction_form).permit(:id, :title)
×
UNCOV
66
    end
×
67

UNCOV
68
    def build_report_biased_results_form
×
UNCOV
69
      @biased_results_form = ReportBiasedResultsForm.new(
×
UNCOV
70
        biased_results_params
×
UNCOV
71
      )
×
UNCOV
72
    end
×
73

UNCOV
74
    def biased_results_params
×
UNCOV
75
      params.require(:report_biased_results_form).permit(:context)
×
UNCOV
76
    end
×
77

UNCOV
78
    def search_results_url(_params)
×
79
      search_catalog_url(q: biased_results_params['q'])
×
UNCOV
80
    end
×
81

UNCOV
82
    def page_url(params)
×
UNCOV
83
      solr_document_url(id: params['id'])
×
UNCOV
84
    end
×
85

UNCOV
86
    def current_user_email
×
UNCOV
87
      return if current_user.nil?
×
UNCOV
88
      return if current_user.provider != 'cas'
×
UNCOV
89
      @user_email = "#{current_user.uid}@princeton.edu"
×
UNCOV
90
      @user_email
×
UNCOV
91
    end
×
UNCOV
92
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

© 2026 Coveralls, Inc