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

fix: [DHIS2-16084] Filter unidirectional relationship types #3477

Merged

Conversation

eirikhaugstulen
Copy link
Contributor

@eirikhaugstulen eirikhaugstulen commented Dec 4, 2023

Tech summary:

  • Added an extra condition that removed relationships where relationship type is unidirectional and the source is in the to-side

Test case: https://dhis2.atlassian.net/browse/DHIS2-16239

@eirikhaugstulen eirikhaugstulen marked this pull request as ready for review December 4, 2023 10:35
@eirikhaugstulen eirikhaugstulen requested a review from a team as a code owner December 4, 2023 10:35
Copy link
Contributor

@superskip superskip left a comment

Choose a reason for hiding this comment

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

Nice simplification on the top level and very clear implementation on the lower level 👍

@@ -137,7 +137,7 @@ const getLinkedEntityData = (apiLinkedEntity, relationshipCreatedAt, pendingApiR
return null;
};

const determineLinkedEntity = (fromEntity, toEntity, sourceId) => {
export const determineLinkedEntity = (fromEntity: ApiLinkedEntity, toEntity: ApiLinkedEntity, sourceId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well add the return type too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we usually type return types? It looks like it's being inferred, but added it just to be safe.

image

@eirikhaugstulen
Copy link
Contributor Author

Thanks for the review, @superskip! Should be fixed now 🙌

@superskip superskip self-requested a review December 12, 2023 14:57
Copy link

Copy link

@geethaalwan geethaalwan left a comment

Choose a reason for hiding this comment

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

Tested successfully on 2.41,2.40.3,2.39.5,2.38.6 versions

@eirikhaugstulen eirikhaugstulen merged commit 3579fc0 into master Dec 14, 2023
36 checks passed
@eirikhaugstulen eirikhaugstulen deleted the eh/fix/DHIS2-16084_Filter-unidirectional-relations branch December 14, 2023 14:07
dhis2-bot added a commit that referenced this pull request Dec 14, 2023
## [100.47.3](v100.47.2...v100.47.3) (2023-12-14)

### Bug Fixes

* [DHIS2-16084] Filter unidirectional relationship types ([#3477](#3477)) ([3579fc0](3579fc0))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.47.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants