Skip to content
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

Change further education filter #4796

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

tomas-stefano
Copy link
Contributor

@tomas-stefano tomas-stefano commented Dec 30, 2024

Context

This PR changes the further education filter:

  1. Use level as parameter (to map the data modelling)
  2. Makes compatible with "old" parameters (the current live version that soon will be replaced):
    • "age_group" parameter is used when user answer the second question and chooses "Further education"
    • "qualification" as "pgce pgde" parameter is used when user answer the qualification "further education" filter

Changes proposed in this pull request

Also changed the content of the filter as the trello card:

Guidance to review

  1. Visit /v2/results page
  2. Does the further education filter works?
  3. Go to live site and answer the second question and go to results page. Copy the parameters and paste into `/v2/results?...."
  4. Does the further education filter works?
  5. Go to live site and filter the qualification to further education. Copy the parameters and paste into `/v2/results?...."
  6. Does the further education filter works?

@tomas-stefano tomas-stefano added the deploy A Review App will be created for PRs with this label label Dec 30, 2024
@tomas-stefano tomas-stefano force-pushed the td/change-further-education-filter branch from d85c791 to 47438dd Compare December 31, 2024 10:03
This commit updates the handling of legacy
parameters (`age_group` and `qualification`) to ensure compatibility
when filtering by "further education" in the old v1 `/results` endpoint.

- **SearchCoursesForm**:
  - Introduced `age_group` and `qualification` attributes.
  - Added methods to map old parameters (`age_group: 'further_education'` or `qualification: ['pgce pgde']`) to the `level: 'further_education'` parameter.
  - Ensures `search_params` excludes legacy parameters while still applying their equivalent filtering logic.

- **CoursesQuery**:
  - Simplified logic for `further_education_scope` to focus on `level: 'further_education'`.

If a user selects "further education" in the updated v2 filters,
legacy v1 requests using

1. `age_group = further_education` (v1 second question)
2. `qualification = ['pgce pgde']` will continue to work. (v1
   qualification filter when user chooses further education).

This ensures backward compatibility while moving towards the new parameter
conventions.
@tomas-stefano tomas-stefano force-pushed the td/change-further-education-filter branch from 47438dd to d258e3e Compare December 31, 2024 10:04
@tomas-stefano tomas-stefano marked this pull request as ready for review December 31, 2024 10:04
@tomas-stefano tomas-stefano requested a review from a team as a code owner December 31, 2024 10:04
@tomas-stefano
Copy link
Contributor Author

@tomas-stefano tomas-stefano changed the title Td/change further education filter Change further education filter Dec 31, 2024
@tomas-stefano tomas-stefano merged commit 2bc9a40 into main Jan 2, 2025
19 checks passed
@tomas-stefano tomas-stefano deleted the td/change-further-education-filter branch January 2, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy A Review App will be created for PRs with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants