-
Notifications
You must be signed in to change notification settings - Fork 0
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-443, FAU-444] Make “German language skills for international students” taxonomy hierarchical #20
base: main
Are you sure you want to change the base?
Conversation
…for international students' filter and column, if exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise LGTM. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for taking care of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on that!
return new self( | ||
$data[MultilingualLink::NAME], | ||
$data[MultilingualLink::LINK_TEXT], | ||
$data[MultilingualLink::LINK_URL], | ||
!empty($parentData) ? self::fromArray($parentData) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is wrong. If $parentData
is not empty, then fromArray
is called again but this time you 're passing a Link
object instead of an array. Apart from the type error this (calling fromArray()
again) doesn't make sense to me in general, but I may be overlooking something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out! I believe this is correct since we’re passing an array as defined by the @psalm-type
FAU-Studium-Common/src/Application/Link.php
Lines 10 to 17 in f9b1698
/** | |
* @psalm-type Link = array{ | |
* name: string, | |
* link_text: string, | |
* link_url: string, | |
* } | |
* @psalm-type LinkType = Link & array{parent?: Link|null} | |
*/ |
return new self( | ||
$data[self::ID], | ||
MultilingualString::fromArray($data[self::NAME]), | ||
MultilingualString::fromArray($data[self::LINK_TEXT]), | ||
MultilingualString::fromArray($data[self::LINK_URL]), | ||
!empty($parentData) ? self::fromArray($parentData) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same:
FAU-Studium-Common/src/Domain/MultilingualLink.php
Lines 7 to 16 in f9b1698
/** | |
* @psalm-import-type MultilingualStringType from MultilingualString | |
* @psalm-type MultilingualLink = array{ | |
* id: string, | |
* name: MultilingualStringType, | |
* link_text: MultilingualStringType, | |
* link_url: MultilingualStringType | |
* } | |
* @psalm-type MultilingualLinkType = MultilingualLink & array{parent?: MultilingualLink|null} | |
*/ |
Please check if the PR fulfills these requirements
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-443
https://inpsyde.atlassian.net/browse/FAU-444
Discussion: https://inpsyde.slack.com/archives/C045KFJ9MB5/p1734520808952019
What is the new behavior (if this is a feature change)?
German language skills for international students
taxonomy is hierarchicalMultilingualLink
has been extended with aparent
property to enable proper synchronization of both child and parent terms to consuming websitesDoes 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 that incorporates the use of
parent
property for synchronization to consuming websites: RRZE-Webteam/FAU-Studium-Embed#49