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

[FAU-420] Add new "German language skills for international students" filter and allow sorting by it #29

Merged
merged 8 commits into from
May 13, 2024

Conversation

amiut
Copy link
Collaborator

@amiut amiut commented May 8, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
https://inpsyde.atlassian.net/browse/FAU-420
No filter for required German language skills for degree programs

What is the new behavior (if this is a feature change)?

  • Added new "German language skills for international students" filter
  • Allow sorting by "German language skills for international students" (only if filter is applied)

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No

Other information:
Related PR: RRZE-Webteam/FAU-Studium-Common#5

Screenshots of new filter / sorting column, Maybe we can discuss changing the layout slightly so it looks better.

Screenshot 2024-05-08 at 1 40 10 PM Screenshot 2024-05-08 at 1 40 20 PM

Copy link
Collaborator

@o-samaras o-samaras left a comment

Choose a reason for hiding this comment

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

Code-wise LGTM. Please fix the stylelint issues before merging this and also update the common package once it's merged so that Psalm is happy as well :) Thanks

Copy link
Collaborator

@zhyian zhyian left a comment

Choose a reason for hiding this comment

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

It looks good and functions well too! As Orestis mentioned, it would be good if the linter's issues were addressed. Thank you for your work on this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think if we need to update the actual meta key here -

/**
* @psalm-param LanguageCodes $languageCode
*/
private function updateForLanguage(string $languageCode, DegreeProgramViewRaw $rawView): void
{
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::DEGREE . '_' . $languageCode,
$rawView->degree()->name()->asString($languageCode)
);
if ($rawView->start()->offsetExists(0)) {
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::START . '_' . $languageCode,
$rawView->start()->offsetGet(0)->asString($languageCode),
);
}
if ($rawView->location()->offsetExists(0)) {
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::LOCATION . '_' . $languageCode,
$rawView->location()->offsetGet(0)->asString($languageCode)
);
}
$admissionRequirement = AdmissionRequirementsTranslated::fromAdmissionRequirements(
$rawView->admissionRequirements(),
$languageCode,
)
->mainLink();
if (!$admissionRequirement instanceof AdmissionRequirementTranslated) {
return;
}
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::ADMISSION_REQUIREMENTS . '_' . $languageCode,
$admissionRequirement->name()
);
}
to make possible sorting by that meta key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch 👌
It's definitely needed for consuming sites

@amiut
Copy link
Collaborator Author

amiut commented May 10, 2024

Code-wise LGTM. Please fix the stylelint issues before merging this and also update the common package once it's merged so that Psalm is happy as well :) Thanks

Thanks done, there were some un-related issues, I added those to the baseline file so we can revisit them later.

@amiut amiut merged commit 93b5fc8 into dev May 13, 2024
7 checks passed
@amiut amiut deleted the FAU-420 branch May 13, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants