diff --git a/app/frontend/images/svg/icon-green-tick.svg b/app/frontend/images/svg/icon-green-tick.svg new file mode 100644 index 0000000000..3803560c34 --- /dev/null +++ b/app/frontend/images/svg/icon-green-tick.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/frontend/src/styles/application/icons.scss b/app/frontend/src/styles/application/icons.scss index 7a01b301d4..534e9786cb 100644 --- a/app/frontend/src/styles/application/icons.scss +++ b/app/frontend/src/styles/application/icons.scss @@ -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'); +} diff --git a/app/views/shared/vacancy/_jobseeker_view.html.slim b/app/views/shared/vacancy/_jobseeker_view.html.slim index 2bfb6f01db..d21b34403e 100644 --- a/app/views/shared/vacancy/_jobseeker_view.html.slim +++ b/app/views/shared/vacancy/_jobseeker_view.html.slim @@ -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. @@ -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 diff --git a/config/locales/jobseekers.yml b/config/locales/jobseekers.yml index 981747f51f..81b9161321 100644 --- a/config/locales/jobseekers.yml +++ b/config/locales/jobseekers.yml @@ -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:" @@ -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: diff --git a/spec/system/jobseekers_can_start_a_job_application_spec.rb b/spec/system/jobseekers_can_start_a_job_application_spec.rb index dc05a0d297..31305f08d1 100644 --- a/spec/system/jobseekers_can_start_a_job_application_spec.rb +++ b/spec/system/jobseekers_can_start_a_job_application_spec.rb @@ -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)) @@ -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)) @@ -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)) @@ -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 @@ -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