Skip to content

Commit

Permalink
Add UR banner details in the yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
catalinailie committed Oct 20, 2023
1 parent a1dae6b commit ce73931
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 32 deletions.
8 changes: 5 additions & 3 deletions app/presenters/content_item/recruitment_banner.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module ContentItem
module RecruitmentBanner
def recruitment_survey_url
pages = YAML.load_file(Rails.root.join("config/recruitment_banner_pages.yml"))
def recruitment_survey_details
survey_pages = YAML.load_file(Rails.root.join("config/recruitment_banner_pages.yml"))
key = content_item["base_path"]

pages[key] if pages
# TODO: check if all the values are in place
# TODO: if the text is not specified in the yml, we should use the standard one
survey_pages.find{ |banner| banner["pages"].include?(key) } if survey_pages

Check failure on line 9 in app/presenters/content_item/recruitment_banner.rb

View workflow job for this annotation

GitHub Actions / Lint Ruby / Run RuboCop

Layout/SpaceBeforeBlockBraces: Space missing to the left of {.
end
end
end
8 changes: 4 additions & 4 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<% end %>
<% end %>

<% if @content_item.recruitment_survey_url %>
<% if @content_item.recruitment_survey_details %>
<div class="govuk-!-static-margin-top-4">
<%= render "govuk_publishing_components/components/intervention", {
suggestion_text: "Help improve GOV.UK",
suggestion_link_text: "Take part in user research",
suggestion_link_url: @content_item.recruitment_survey_url,
suggestion_text: @content_item.recruitment_survey_details["suggestion_text"],
suggestion_link_text: @content_item.recruitment_survey_details["suggestion_link_text"],
suggestion_link_url: @content_item.recruitment_survey_details["suggestion_link_url"],
new_tab: true,
} %>
</div>
Expand Down
60 changes: 35 additions & 25 deletions config/recruitment_banner_pages.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
# Add bellow the pages we want to show a user research banner on and the survey link for each page
# eg. "/log-in-register-hmrc-online-services": "survey url"

"/log-in-register-hmrc-online-services": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/log-in-file-self-assessment-tax-return": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/self-assessment-tax-returns": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/pay-self-assessment-tax-bill": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/contact-hmrc": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/log-in-register-hmrc-online-services/register": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/dbs-update-service": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
"/government/organisations/hm-revenue-customs/contact/self-assessment": "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
-
name: Benefits banner
suggestion_text: "Help improve GOV.UK"
suggestion_link_text: "Take part in user research"
suggestion_link_url: "https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16"
pages:
- "/disability-living-allowance-children"
- "/help-with-childcare-costs"
- "/financial-help-disabled"
- "/pip"
- "/blind-persons-allowance"
- "/dla-disability-living-allowance-benefit"
- "/carers-allowance"
- "/carers-credit"
- "/maternity-pay-leave"
- "/paternity-pay-leave"
- "/child-benefit"
- "/jobseekers-allowance"
- "/universal-credit"
- "/employment-support-allowance"
- "/benefits-calculators"

# Benefits pages
"/disability-living-allowance-children": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/help-with-childcare-costs": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/financial-help-disabled": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/pip": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/blind-persons-allowance": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/dla-disability-living-allowance-benefit": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/carers-allowance": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/carers-credit": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/maternity-pay-leave": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/paternity-pay-leave": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/child-benefit": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/jobseekers-allowance": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/universal-credit": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/employment-support-allowance": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
"/benefits-calculators": https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16
-
name: Research banner
suggestion_text: "Help improve a new GOV.UK tool"
suggestion_link_text: "Sign up to take part in user research"
suggestion_link_url: "https://surveys.publishing.service.gov.uk/s/SNFVW1/"
pages:
- "/log-in-register-hmrc-online-services"
- "/log-in-file-self-assessment-tax-return"
- "/self-assessment-tax-returns"
- "/pay-self-assessment-tax-bill"
- "/contact-hmrc"
- "/log-in-register-hmrc-online-services/register"
- "/dbs-update-service"
- "/government/organisations/hm-revenue-customs/contact/self-assessment"

0 comments on commit ce73931

Please sign in to comment.