-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new campaign bespoke landing page #7137
Conversation
Review app deployed to https://teaching-vacancies-review-pr-7137.test.teacherservices.cloud on AKS |
.custom-banner | ||
.govuk-grid-row | ||
.govuk-grid-column-one-third-at-desktop | ||
h1.govuk-heading-l class="govuk-!-margin-bottom-4" = "#{@jobseeker_name}, find your primary teacher job" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we've only implemented the 'primary teacher' landing page here. Do we not need to parameterise this so we can do secondary teachers (and others) - using education_phase or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good question, and I've asked it to @EllieNodder myself. This is not technically a landing page but a campaign page.
This is a throwaway campaign page that will run for a certain amount of time, and we can remove it afterwards.
As a broader context, we need to rework the way landing pages are generated, as we need them to be more customisable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, could we make it so it pulls through either 'primary' or 'secondary', depending on their info in Mailchimp?
working_patterns << "full_time" if campaign_params.delete(:email_fulltime) == "true" | ||
working_patterns << "part_time" if campaign_params.delete(:email_parttime) == "true" | ||
working_patterns << "job_share" if campaign_params.delete(:email_jobshare) == "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we not use ActiveModel::Type::Boolean.new.cast(value) here so that we cope with values of "1" (and Yes?) as well as (lowercase) true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks
:email_phase, :email_ECT, :email_fulltime, :email_parttime, :email_jobshare, :email_contact) | ||
.tap do |campaign_params| | ||
campaign_params[:location] = campaign_params.delete(:email_location) | ||
campaign_params[:radius] = campaign_params.delete(:email_radius) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are supposed to pre-select 15 mile radius if it isn't specified (which it probably won't be?) - or is that going to be done by the email rather than here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the radius is set in the email link. But good observation!
let!(:maths_job1) { create(:vacancy, :past_publish, :no_tv_applications, job_roles: ["teacher"], publish_on: Date.current - 1, job_title: "Maths 1", subjects: %w[Mathematics], organisations: [school], phases: %w[secondary], expires_at: Date.current + 1, geolocation: "POINT(-0.019501 51.504949)") } | ||
let!(:maths_job2) { create(:vacancy, :past_publish, :no_tv_applications, job_roles: ["teacher"], publish_on: Date.current - 2, job_title: "Maths Teacher 2", subjects: %w[Mathematics], organisations: [school], phases: %w[secondary], expires_at: Date.current + 3, geolocation: "POINT(-1.8964 52.4820)") } | ||
|
||
it "contains the expected content and vacancies with personalized jobseeker name" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if we should add some simple interaction testing here to make sure that this custom page works as expected, as it seems to have quite a lot of content on it? Also I have just noticed that these jobs are both marked as 'secondary' phase, but the target was 'primary' so not sure why they are showing up? Maybe we should add some jobs outside the radius to show that the radius searches work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll chat with Chloe first and then test the page. I suspect I will still need to tweak something.
After that, I think I'll be better positioned to add more testing.
Consider this a temporary page that will be live only for the campaign's duration.
61f59d7
to
240ed94
Compare
Better to use `ActiveModel::Type::Boolean.new.cast(value)` to catch more truthy values
6a3d6fd
to
f3d2f85
Compare
decb1a5
to
e4aef0f
Compare
end | ||
|
||
def self.[](utm_content_code) | ||
raise "No such campaign page: '#{utm_content_code}'" unless exists?(utm_content_code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we gracefully handle this so users don't get a service error when the param value is wrong?
I would expect a user to get a 404
page or get redirected to the generic vacancies page.
Oh this seems unreachable due to the route constraint bellow.
get "campaigns/",
to: "vacancies#campaign_landing_page",
as: :campaign_landing_page,
constraints: ->(request) { CampaignPage.exists?(request.params[:utm_content]) }
Forget my original comment then, this is a good enough safeguard!
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime)) == "true" | ||
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime)) == "true" | ||
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare)) == "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect these checks would never pass, since the boolean casting will return true
instead of "true"
. So true == "true"
doesn't match.
I think we don't even need the comparison:
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime)) == "true" | |
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime)) == "true" | |
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare)) == "true" | |
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime)) | |
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime)) | |
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare)) |
@@ -0,0 +1,134 @@ | |||
shared: | |||
whentoapplybespoke+PRIMARY: | |||
banner_image: "campaigns/primary_teacher.jpg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Trello card URL
https://trello.com/c/kqe2MWBV/1253-create-bespoke-landing-pages-for-new-teachers-digital-activity
Changes in this PR:
We're adding a new campaign bespoke landing page. Users will be able to access this temporary landing page through links in QR codes within physical booklets or through emails. The page has a different design from the orginal job search page but we can re-use some of the components.
Screenshots of UI changes: