Skip to content

Stop prefilling applications with profiles and vice versa#8667

Merged
KyleMacPherson merged 4 commits intomainfrom
disconnect-profiles
Apr 8, 2026
Merged

Stop prefilling applications with profiles and vice versa#8667
KyleMacPherson merged 4 commits intomainfrom
disconnect-profiles

Conversation

@KyleMacPherson
Copy link
Copy Markdown
Collaborator

@KyleMacPherson KyleMacPherson commented Mar 27, 2026

Trello card URL

https://trello.com/c/mdntsKhY/2751-stop-auto-filling-profiles

Changes in this PR:

This ticket is to disconnect the logic between jobseeker profiles and job applications as we are looking to make the two flows totally separate/different going forward.

Screenshots of UI changes:

Before

After

Checklists:

Data & Schema Changes

If this PR modifies data structures or validations, check the following:

  • Adds/removes model validations
  • Adds/removes database fields
  • Modifies Vacancy enumerables (phases, working patterns, job roles, key stages, etc.)
If any of the above options has changed then the author must check/resolve all of the following...

Integration Impact

Does this change affect any of these integrations?

  • DfE Analytics platform
  • Legacy imports mappings
  • DWP Find a Job export mappings
  • Publisher ATS API (may require mapping updates or API versioning)

User Experience & Data Integrity

Could this change impact:

  • Existing subscription alerts (will legacy subscription search filters break?)
  • Legacy vacancy copying (will copied vacancies fail new validations?)
  • In-progress drafts for Vacancies or Job Applications

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Review app https://teaching-vacancies-review-pr-8667.test.teacherservices.cloud was successfully deleted

Comment on lines -50 to -57
# If we don't know the user's status, or they have the right perform the role
# then we can send them straight to the 'quick apply' screen, otherwise we display the
# (badly named) about_your_application screen which suggests they might not be qualified for the role.
if !vacancy.visa_sponsorship_available? && profile.present? && profile.needs_visa_for_uk?
render "about_your_application"
else
@has_previous_application = previous_application?
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure why this has been deleted?

Copy link
Copy Markdown
Collaborator Author

@KyleMacPherson KyleMacPherson Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking around deleting this is that if I didn't it would mean that the application flow retains a dependency on the jobseeker profile and means we still have to consider the application flow when making any further changes to the jobseeker profile. That being said I have added this logic back in and we can revisit it if it becomes an issue.


def quick_apply?
previous_application? || profile.present?
previous_application?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure about this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that as we don't prefill with profile details now this is only going to be true if we have a previous application right?

Comment on lines -367 to -376
context "with a non-visa-seeking profile" do
before do
create(:jobseeker_profile, jobseeker: jobseeker, personal_details: build(:personal_details, has_right_to_work_in_uk: true))
end

it "renders 'new'" do
expect(get(new_jobseekers_job_job_application_path(vacancy.id)))
.to render_template(:new)
end
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment above 0- I would have expected this behaviour to stay?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed this one above!

Comment on lines +253 to +256
def previous_application?
current_jobseeker.has_submitted_native_job_application?
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking suggestion: I think this is obvious enough to inline it in #quick_apply?

Suggested change
def previous_application?
current_jobseeker.has_submitted_native_job_application?
end


def quick_apply?
previous_application? || profile.present?
previous_application?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking suggestion:
I personally find that previous_application? adds little to nothing over the current_jobseeker.has_submitted_native_job_application?

So we could just

Suggested change
previous_application?
current_jobseeker.has_submitted_native_job_application?

def job_application
return new_job_application if @vacancy.uploaded_form?
return new_job_application unless has_data_available_to_prefill_with?
return new_job_application unless previously_submitted_application?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same non-blocking suggestion. I think we could just call and be as easy to understand as the method name.

Suggested change
return new_job_application unless previously_submitted_application?
return new_job_application unless jobseeker.has_submitted_native_job_application?

Comment on lines 22 to 24
def previously_submitted_application?
jobseeker.has_submitted_native_job_application?
end
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking:

Suggested change
def previously_submitted_application?
jobseeker.has_submitted_native_job_application?
end

Copy link
Copy Markdown
Collaborator

@scruti scruti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love these PRs:
Image

Left a tiny suggestion around a method that seems superfluous and we could inline instead. But it is cosmetic and non-blocking at all.

@KyleMacPherson KyleMacPherson merged commit 00b05ec into main Apr 8, 2026
16 checks passed
@KyleMacPherson KyleMacPherson deleted the disconnect-profiles branch April 8, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants