Skip to content

Commit

Permalink
Merge pull request #1203 from alphagov/add-hmrc-pensions-and-company-…
Browse files Browse the repository at this point in the history
…car-surveys

Add HMRC Pensions and Car Tax surveys
  • Loading branch information
elenatanasoiu authored Nov 29, 2017
2 parents 36e7952 + e2b57d3 commit 517a19f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions app/assets/javascripts/surveys.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@
}
}

var hmrcSurveysNov2017Url = function () {
var path = window.location.pathname
switch (true) {
case /^\/tax-on-your-private-pension(?:\/|$)/.test(path) : return 'https://signup.take-part-in-research.service.gov.uk/?utm_campaign=PrivatePensionContributionsGOV&utm_source=govukother&utm_medium=gov.uk&t=HMRC&id=105'
case /^\/update-company-car-details(?:\/|$)/.test(path) : return 'https://signup.take-part-in-research.service.gov.uk/?utm_campaign=CompanyCarGOV&utm_source=Other&utm_medium=other&t=HMRC&id=49'
default: return ''
}
}

var hmrcSurveysNov2017EndTime = function () {
var path = window.location.pathname
switch (true) {
case /^\/tax-on-your-private-pension(?:\/|$)/.test(path) : return new Date('February 28, 2017')
case /^\/update-company-car-details(?:\/|$)/.test(path) : return new Date('January 11, 2017')
default: return ''
}
}

/* This data structure is explained in `doc/surveys.md` */
var userSurveys = {
defaultSurvey: {
Expand Down Expand Up @@ -341,6 +359,25 @@
'^/guidance/tell-hmrc-if-youve-underpaid-national-minimum-wage-in-the-social-care-sector(?:/|$)'
]
}
},
{
identifier: 'hmrc_november',
surveyType: 'url',
frequency: 6,
startTime: new Date('November 30, 2017').getTime(),
endTime: hmrcSurveysNov2017EndTime(),
url: hmrcSurveysNov2017Url(),
templateArgs: {
title: 'Help us improve our services, join our User Research Panel',
surveyCta: 'Join our User Research Panel.',
surveyCtaPostscript: 'Sign up form will open on another website.'
},
activeWhen: {
path: [
'^/tax-on-your-private-pension(?:/|$)',
'^/update-company-car-details(?:/|$)'
]
}
}
],

Expand Down

0 comments on commit 517a19f

Please sign in to comment.