diff --git a/.env.development b/.env.development index 480c21f3..7aa01c8d 100644 --- a/.env.development +++ b/.env.development @@ -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" diff --git a/.env.staging b/.env.staging index 84d50506..23be1081 100644 --- a/.env.staging +++ b/.env.staging @@ -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= diff --git a/.env.test b/.env.test index 4576c3ba..3057cdc0 100644 --- a/.env.test +++ b/.env.test @@ -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/ diff --git a/app/components/feedback_component.html.erb b/app/components/feedback_component.html.erb index 3cdfb62b..bf517867 100644 --- a/app/components/feedback_component.html.erb +++ b/app/components/feedback_component.html.erb @@ -4,6 +4,20 @@ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8662241d..0a3c796e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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? diff --git a/config/locales/en.yml b/config/locales/en.yml index d45944d2..2a060ef3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/spec/components/feedback_component_spec.rb b/spec/components/feedback_component_spec.rb index 4c797a65..b5bb231c 100644 --- a/spec/components/feedback_component_spec.rb +++ b/spec/components/feedback_component_spec.rb @@ -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