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-18028] User is able to add invalid related stages event #3795

Conversation

eirikhaugstulen
Copy link
Contributor

Tech-summary:

  • We were filtering out events that had a relationship because these are not considered linkable
  • Switched this out to rather keep all events, but filter out the non-linkable as a separate array

Copy link
Contributor

@henrikmv henrikmv left a comment

Choose a reason for hiding this comment

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

I just found a filter function that I think is unnecessary. Apart from that, it looks very good.

/>
))}
{linkableEvents
.filter(event => event.isLinkable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to filter here? As I understand it, constant linkableEvents are only events where isLinkable is true due to the filter function in useRelatedStageEvents.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, Henrik! Removed now 🎉

@eirikhaugstulen eirikhaugstulen marked this pull request as ready for review September 11, 2024 07:13
@eirikhaugstulen eirikhaugstulen requested a review from a team as a code owner September 11, 2024 07:13
Copy link
Contributor

@simonadomnisoru simonadomnisoru left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

github-actions bot commented Sep 12, 2024

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.42,2.41.2,2.40.6,2.39.8 versions

@eirikhaugstulen eirikhaugstulen merged commit 301585e into master Oct 14, 2024
59 checks passed
@eirikhaugstulen eirikhaugstulen deleted the eh/fix/DHIS2-18028-user-is-able-to-add-event-to-invalid-stage branch October 14, 2024 11:32
dhis2-bot added a commit that referenced this pull request Oct 14, 2024
## [101.10.1](v101.10.0...v101.10.1) (2024-10-14)

### Bug Fixes

* [DHIS2-18028] User is able to add invalid related stages event ([#3795](#3795)) ([301585e](301585e))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 101.10.1 🎉

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.

6 participants