Skip to content

Commit

Permalink
Merge pull request #3053 from DFE-Digital/TEVA-2033-apply-CTA-applica…
Browse files Browse the repository at this point in the history
…tion-status

[TEVA-2033] Apply CTA Application Status
  • Loading branch information
josephhull676 committed Mar 16, 2021
2 parents e4d420f + d7437c8 commit 28e8fac
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 20 deletions.
4 changes: 4 additions & 0 deletions app/frontend/images/svg/icon-green-tick.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/frontend/src/styles/application/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@
.icon--cross {
background-image: url('../../images/svg/icon-cross.svg');
}

.icon--green-tick {
background-image: url('../../images/svg/icon-green-tick.svg');
}
46 changes: 32 additions & 14 deletions app/views/shared/vacancy/_jobseeker_view.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,29 @@
h2.govuk-caption-l.job-caption class="govuk-!-margin-bottom-5 govuk-!-margin-top-0"
= vacancy_job_location(@vacancy)
.govuk-grid-row
- if JobseekerApplicationsFeature.enabled?
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: "apply",
link_id: "apply-job-application",
link_method: :get,
link_path: new_jobseekers_job_job_application_path(@vacancy.id),
link_text: t("jobseekers.job_applications.apply")))
- if JobseekerApplicationsFeature.enabled? && @vacancy.apply_through_teaching_vacancies&.downcase == "yes"
- case current_jobseeker&.job_applications&.find_by(vacancy_id: @vacancy.id)&.status
- when "submitted"
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: "green-tick",
link_id: "apply-job-application",
link_method: :get,
link_path: jobseekers_job_application_path(current_jobseeker.job_applications.find_by(vacancy_id: @vacancy.id)),
link_text: t("jobseekers.job_applications.banner_links.submitted")))
- when "draft"
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: "green-tick",
link_id: "apply-job-application",
link_method: :get,
link_path: jobseekers_job_application_path(current_jobseeker.job_applications.find_by(vacancy_id: @vacancy.id)),
link_text: t("jobseekers.job_applications.banner_links.draft")))
- else
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: "apply",
link_id: "apply-job-application",
link_method: :get,
link_path: new_jobseekers_job_job_application_path(@vacancy.id),
link_text: t("jobseekers.job_applications.banner_links.apply")))

.govuk-grid-column-one-third
/ The "origin" param is used both for the back button on the subsequent page and for performance analysis.
Expand All @@ -32,13 +48,15 @@
link_path: new_subscription_path,
link_text: t("jobs.alert.similar.terse"),
params: { search_criteria: @devised_job_alert_search_criteria, origin: request.original_fullpath }))
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: @saved_job.present? ? "saved" : "save",
link_id: "#{@saved_job.present? ? 'saved' : 'save'}-job-listing",
link_method: @saved_job.present? ? :delete : :get,
link_path: @saved_job.present? ? jobseekers_saved_job_path(@vacancy.id, @saved_job) : new_jobseekers_saved_job_path(@vacancy.id),
params: { click_event: "vacancy_save_to_account_clicked" },
link_text: t("jobseekers.saved_jobs.#{@saved_job.present? ? 'saved' : 'save'}")))

- if current_jobseeker&.job_applications&.find_by(vacancy_id: @vacancy.id).nil?
.govuk-grid-column-one-third
= render(Shared::BannerLinkComponent.new(icon_class: @saved_job.present? ? "saved" : "save",
link_id: "#{@saved_job.present? ? 'saved' : 'save'}-job-listing",
link_method: @saved_job.present? ? :delete : :get,
link_path: @saved_job.present? ? jobseekers_saved_job_path(@vacancy.id, @saved_job) : new_jobseekers_saved_job_path(@vacancy.id),
params: { click_event: "vacancy_save_to_account_clicked" },
link_text: t("jobseekers.saved_jobs.#{@saved_job.present? ? 'saved' : 'save'}")))

.govuk-grid-row

Expand Down
6 changes: 5 additions & 1 deletion config/locales/jobseekers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ en:
apply: Apply for this job
applying_for_the_role_heading: Applying for the role
applying_for_the_role_paragraph: Please complete the online application.
current_step: Step %{current} of %{total}
banner_links:
apply: Apply for this job
draft: Started - continue application
submitted: Submitted - view application
build:
ask_for_support:
adjustments: "This could be:"
Expand Down Expand Up @@ -111,6 +114,7 @@ en:
heading: References
no_references: No referees specified
title: References — Application
current_step: Step %{current} of %{total}
details:
employment_history: Role
form:
Expand Down
10 changes: 5 additions & 5 deletions spec/system/jobseekers_can_start_a_job_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
before { login_as(jobseeker, scope: :jobseeker) }

context "when clicking apply on the job page" do
before { click_on I18n.t("jobseekers.job_applications.apply") }
before { click_on I18n.t("jobseekers.job_applications.banner_links.apply") }

it "starts a job application" do
expect(current_path).to eq(new_jobseekers_job_job_application_path(vacancy.id))
Expand All @@ -38,7 +38,7 @@

context "when the jobseeker is not signed in" do
context "when clicking apply on the job page" do
before { click_on I18n.t("jobseekers.job_applications.apply") }
before { click_on I18n.t("jobseekers.job_applications.banner_links.apply") }

it "starts a job application after signing in" do
expect(current_path).not_to eq(new_jobseekers_job_job_application_path(vacancy.id))
Expand All @@ -58,7 +58,7 @@

context "when the jobseeker does not have an account" do
context "when clicking apply on the job page" do
before { click_on I18n.t("jobseekers.job_applications.apply") }
before { click_on I18n.t("jobseekers.job_applications.banner_links.apply") }

it "starts a job application after signing up" do
expect(current_path).not_to eq(new_jobseekers_job_job_application_path(vacancy.id))
Expand All @@ -85,7 +85,7 @@

before do
login_as(jobseeker, scope: :jobseeker)
click_on I18n.t("jobseekers.job_applications.apply")
click_on I18n.t("jobseekers.job_applications.banner_links.apply")
end

it "redirects to job applications dashboard with correct message" do
Expand All @@ -105,7 +105,7 @@

before do
login_as(jobseeker, scope: :jobseeker)
click_on I18n.t("jobseekers.job_applications.apply")
click_on I18n.t("jobseekers.job_applications.banner_links.apply")
end

it "redirects to job applications dashboard with correct message" do
Expand Down

0 comments on commit 28e8fac

Please sign in to comment.