Skip to content

Commit

Permalink
Merge pull request #1169 from nla/blac-467-cultural-sensitive-feedback
Browse files Browse the repository at this point in the history
BLAC-467: cultural sensitive feedback button
  • Loading branch information
CEdwardsBlasikiewicz authored Dec 12, 2024
2 parents d01fb74 + e282ac2 commit c241682
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ THUMBNAIL_SERVICE_API_BASE_URL="define THUMBNAIL_SERVICE_API_BASE_URL"

# Feedback
FEEDBACK_ERROR_URL=https://reftracker.nla.gov.au/reft100.aspx?key=Report_an_error
CULTURALLY_SENSITIVE_URL=https://reftracker.nla.gov.au/reft100.aspx?key=Cultural_Feedback

# 2FA registration
EMAIL_2FA_REGISTRATION_URL="define EMAIL_2FA_REGISTRATION_URL"
Expand Down
3 changes: 3 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ EMAIL_2FA_REGISTRATION_REDIRECT_URL="define EMAIL_2FA_REGISTRATION_REDIRECT_URL"
EMAIL_2FA_ACTION="define EMAIL_2FA_ACTION"
ABOUT_2FA_URL=https://www.library.gov.au/research/start-researching/get-started-catalogue/two-factor-authentication

# Feedback
CULTURALLY_SENSITIVE_URL=https://reftracker.nla.gov.au/reft100.aspx?key=Cultural_Feedback

# disable functionality during FOLIO updates
FOLIO_UPDATE_IN_PROGRESS=
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ THUMBNAIL_SERVICE_API_BASE_URL=http://thumbservices.test

# Feedback
FEEDBACK_ERROR_URL=https://reftracker.nla.gov.au/reft100.aspx?key=Report_an_error
CULTURALLY_SENSITIVE_URL=https://reftracker.nla.gov.au/reft100.aspx?key=Cultural_Feedback

# Copyright
COPYRIGHT_SERVICE_URL=https://test.nla.gov.au/copyright/
Expand Down
14 changes: 14 additions & 0 deletions app/components/feedback_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
<ul class="list-unstyled">
<li class="feedback-link">
<%= link_to t("feedback.report_error"), helpers.error_feedback_url(@id) %>
<%= link_to helpers.culturally_sensitive_url(@id) do %>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1">
<title>message-stick-16px</title>
<g id="message-stick-16px" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Message-stick" fill="currentColor" fill-rule="nonzero">
<path d="M1.20922083,11.2190908 L4.9050795,14.4851985 C4.64722889,14.6570989 4.4678209,14.8160254 4.30342809,14.9149495 C3.23406321,15.5584446 2.84227466,15.7744515 1.98277264,15.9463519 C0.779469821,16.2042025 -0.0800321944,15.5166009 0.00591800722,14.2273479 C0.00591800722,13.9694973 0.0883870524,13.7105195 0.17781841,13.4537961 C0.373153673,12.8930628 0.716954479,12.148161 1.20922083,11.2190908 Z" id="Path"/>
<path d="M10.6774875,2.12772506 C10.6774875,2.12772506 10.6916892,2.13896541 10.7169073,2.15905168 L10.8224257,2.24345377 C10.9986882,2.38498838 11.3002482,2.62974654 11.523245,2.82448406 C11.710705,2.98818814 11.8541177,3.73145629 11.4244023,4.01227556 C10.6077956,4.54592853 10.4592047,4.68844508 10.2126492,4.99501833 C9.73415453,5.58999055 9.69896248,5.95777782 9.59614749,6.63349441 C9.50704117,7.21911545 9.12345447,7.28091753 8.6340869,7.28698705 L8.40140099,7.28753548 C7.80434412,7.28753548 7.65026753,7.25349654 7.22456917,7.356173 C6.78683754,7.46175182 6.41462917,7.80231906 6.48176683,8.41830034 C6.55528913,9.09286006 6.73533369,9.55022031 6.57040511,9.90801649 C6.40373794,10.2695843 6.03951094,10.5191738 5.15153792,10.6645379 C4.2635649,10.809902 3.93061489,10.892671 3.35797587,11.4769414 C2.89823462,11.061299 2.50982616,10.7325553 1.98277264,10.2736386 C3.22006105,8.795377 4.73027962,7.2203862 6.06363198,5.97429245 C7.57328977,4.56343123 7.91333655,4.09396812 10.6774875,2.12772506 Z M4.85136062,8.8554603 C4.60333517,8.8554603 4.40227082,9.05652465 4.40227082,9.3045501 C4.40227082,9.55257555 4.60333517,9.75363991 4.85136062,9.75363991 C5.09938607,9.75363991 5.30045042,9.55257555 5.30045042,9.3045501 C5.30045042,9.05652465 5.09938607,8.8554603 4.85136062,8.8554603 Z M8.28077366,5.34439457 C8.03274821,5.34439457 7.83168386,5.54545892 7.83168386,5.79348437 C7.83168386,6.04150982 8.03274821,6.24257417 8.28077366,6.24257417 C8.52879911,6.24257417 8.72986347,6.04150982 8.72986347,5.79348437 C8.72986347,5.54545892 8.52879911,5.34439457 8.28077366,5.34439457 Z" id="Combined-Shape"/>
<path d="M12.5211718,3.65931107 C13.4721386,4.46932597 13.947622,4.87433342 13.947622,4.87433342 C12.360737,7.37482749 11.6728045,7.97567922 10.0799503,9.75363991 C8.48709614,11.5316006 7.1271636,12.7785638 5.93648192,13.7116467 C5.3348305,13.1959455 4.73317909,12.6802443 4.13152768,12.1645431 C4.04557748,12.0785929 4.04557748,11.9066925 4.13152768,11.8207423 C4.30342809,11.6488419 4.47532849,11.4769414 4.73317909,11.3909912 C5.1629301,11.2190908 5.63530859,11.1519836 6.08133403,11.0303403 C7.02678624,10.7724897 7.56953575,9.92983782 7.31168514,8.8984354 C7.29084183,8.81506215 7.21367151,8.52323514 7.21367151,8.40155072 C7.21367151,8.05774991 7.39763534,7.95298318 7.91333655,7.95298318 C8.34308756,7.95298318 8.81668843,7.99209048 9.23656467,7.89950982 C9.85984422,7.76207973 10.1377345,7.48542542 10.3541815,6.9711313 C10.4595213,6.72083589 10.4849169,6.39957852 10.5350383,6.04872877 C10.6209885,5.44707736 10.8878299,5.20337738 11.523245,4.77282573 C12.1885295,4.32203483 12.5211718,3.95086327 12.5211718,3.65931107 Z M8.60738443,8.61050223 C8.35935898,8.61050223 8.15829463,8.81156658 8.15829463,9.05959203 C8.15829463,9.30761748 8.35935898,9.50868183 8.60738443,9.50868183 C8.85540988,9.50868183 9.05647423,9.30761748 9.05647423,9.05959203 C9.05647423,8.81156658 8.85540988,8.61050223 8.60738443,8.61050223 Z M11.9551448,5.34439457 C11.7071193,5.34439457 11.506055,5.54545892 11.506055,5.79348437 C11.506055,6.04150982 11.7071193,6.24257417 11.9551448,6.24257417 C12.2031702,6.24257417 12.4042346,6.04150982 12.4042346,5.79348437 C12.4042346,5.54545892 12.2031702,5.34439457 11.9551448,5.34439457 Z" id="Combined-Shape"/>
<path d="M11.523245,1.50671807 C12.5546474,0.905066655 13.4141495,0.303415244 14.4455519,0.0455646396 C15.3050539,-0.126335764 15.924741,0.184251669 15.8387908,1.04375368 C15.6668904,2.0751561 15.1101971,3.11509689 14.5085456,3.9745989 L11.523245,1.50671807 Z" id="Path"/>
</g>
</g>
</svg>
<%= t("feedback.culturally_sensitive") %>
<% end %>
</li>
</ul>
</div>
Expand Down
9 changes: 9 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ def error_feedback_url(id)
end
end

def culturally_sensitive_url(id)
url = ENV.fetch("CULTURALLY_SENSITIVE_URL", "#")
if url != "#"
"#{url}&qnudftb17=#{request.original_url}&qnudftb11=#{id}"
else
url
end
end

# Used to find users who have made too many requests to a resource
def log_eresources_offsite_access(url)
message = if current_user.present?
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ en:
feedback:
title: "Feedback"
report_error: "Report an error"
culturally_sensitive: "Report culturally sensitive content"
culturally_sensitive: "Report culturally sensitive item"
6 changes: 6 additions & 0 deletions spec/components/feedback_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@

expect(rendered_content).to have_link(I18n.t("feedback.report_error"))
end

it "renders the culturally sensitive item reporting link" do
render_inline(described_class.new("123"))

expect(rendered_content).to have_link(I18n.t("feedback.culturally_sensitive"))
end
end

0 comments on commit c241682

Please sign in to comment.