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 📦🚀

JoakimSM pushed a commit that referenced this pull request Nov 1, 2024
… WL (#3821)

chore(release): cut 101.9.0 [skip release]

* [DHIS2-15238] show and filter on assigned user in program stage WL ([#3821](#3821)) ([e032d50](e032d50))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.9.1 [skip release]

* **translations:** sync translations from transifex (master) ([2603f34](2603f34))

feat: [DHIS2-17771] Org unit context in tables and lists (#3813)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

chore(release): cut 101.10.0 [skip release]

* [DHIS2-17771] Org unit context in tables and lists ([#3813](#3813)) ([b1a720a](b1a720a))

fix: [DHIS2-18028] User is able to add invalid related stages event (#3795)

* fix: change logic for linkable events

* fix: split up all and linkable events

* chore: remove redundant filter

chore(release): cut 101.10.1 [skip release]

* [DHIS2-18028] User is able to add invalid related stages event ([#3795](#3795)) ([301585e](301585e))

test: cleanup after running NewPage tests (#3843)

fix: cleanup after tests are run

chore: [DHIS2-17915] remove opt-in functionality (#3796)

fix: [DHIS2-18215] selected working list not persisted on navigate (#3838)

* fix: persist working list on navigate

* fix: allow navigate back despite displayFrontPageList

* chore: review

chore(release): cut 101.10.2 [skip release]

* [DHIS2-18215] selected working list not persisted on navigate ([#3838](#3838)) ([599b2c1](599b2c1))

feat: [DHIS2-17970] Auto-select orgUnit if there is only one available (#3798)

* feat: pre select

* feat: review changes

* fix: remove children check

* fix: review change

* feat: merge hooks for auto select

* Revert "feat: merge hooks for auto select"

This reverts commit 9b97d2e.

* fix: review changes

chore(release): cut 101.11.0 [skip release]

* [DHIS2-17970] Auto-select orgUnit if there is only one available ([#3798](#3798)) ([de06f8b](de06f8b))

fix: [DHIS2-16993] Text and long text DEs are missing arrows in changelog when deleted (#3827)

* fix: make arrow size static

* fix: revert changes to text

chore(release): cut 101.11.1 [skip release]

* [DHIS2-16993] Text and long text DEs are missing arrows in changelog when deleted ([#3827](#3827)) ([5e6dfa6](5e6dfa6))

fix: [DHIS2-18056] use linkedEntityFormFoundation instead of the searchFormFoundation (#3835)

chore(release): cut 101.11.2 [skip release]

* [DHIS2-18056] use linkedEntityFormFoundation instead of the searchFormFoundation ([#3835](#3835)) ([cbfe70b](cbfe70b))

feat: [DHIS2-17956] Display name for org unit in changelog (#3826)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

* feat: display name for orgunit

* fix: merge conflict

* fix: improve flow type

chore(release): cut 101.12.0 [skip release]

* [DHIS2-17956] Display name for org unit in changelog ([#3826](#3826)) ([5299f37](5299f37))

fix: [DHIS2-17978] use title instead of alt on missing icons (#3847)

* fix: use title instead of alt on missing icons

* chore: fix failing tests

chore(release): cut 101.12.1 [skip release]

* [DHIS2-17978] use title instead of alt on missing icons ([#3847](#3847)) ([b5940f2](b5940f2))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.12.2 [skip release]

* **translations:** sync translations from transifex (master) ([9bf7696](9bf7696))

feat: [DHIS2-17991] Show orgUnit selector in Enter details now (#3824)

* feat: add org unit selector

* feat: select org unit for linked event

* feat: add validation

feat: [DHIS2-16992] Fixed size for changelog modal and columns (#3834)

* feat: temp

* feat: fixed size table and columns

* fix: remove console log

* fix: fixed size improvement

chore(release): cut 101.13.0 [skip release]

* [DHIS2-16992] Fixed size for changelog modal and columns ([#3834](#3834)) ([3b021cf](3b021cf))
* [DHIS2-17991] Show orgUnit selector in Enter details now ([#3824](#3824)) ([bf2f1ca](bf2f1ca))

feat: [DHIS2-17792] Org unit context in forms (#3828)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

* feat: add org unit context to forms

* fix: translation

* fix: cy tests breakes after translation fix

* fix: cy tests

chore(release): cut 101.14.0 [skip release]

* [DHIS2-17792] Org unit context in forms ([#3828](#3828)) ([c8ccf63](c8ccf63))

fix: [DHIS2-16010] app crashes on invalid programid (#3765)

* fix: app crash on invalid programid

* fix: app stuck in loading state when url has invalid enrollmentId or teiId

* fix: useProgramInfo hook breaks the app

chore(release): cut 101.14.1 [skip release]

* [DHIS2-16010] app crashes on invalid programid ([#3765](#3765)) ([9133a63](9133a63))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.14.2 [skip release]

* **translations:** sync translations from transifex (master) ([57a7b83](57a7b83))

docs: improve docs (#3865)

fix: [DHIS2-17843] Disable delete enrollment button when user does not have authority (#3859)

* fix: string adjustment

* fix: disable button and add tooltip

* fix: revert wrong commit

* fix: create generic authorities hook

chore(release): cut 101.14.3 [skip release]

* [DHIS2-17843] Disable delete enrollment button when user does not have authority ([#3859](#3859)) ([edee6d3](edee6d3))

fix: [DHIS2-18228] Image Deleted on Update (#3857)

* fix: image deleted on update

* fix: remove call to fileresources

chore(release): cut 101.14.4 [skip release]

* [DHIS2-18228] Image Deleted on Update ([#3857](#3857)) ([4656864](4656864))

fix: [DHIS2-18248] pass on createdAt to rules engine when editing (#3848)
JoakimSM pushed a commit that referenced this pull request Nov 1, 2024
… WL (#3821)

chore(release): cut 101.9.0 [skip release]

* [DHIS2-15238] show and filter on assigned user in program stage WL ([#3821](#3821)) ([e032d50](e032d50))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.9.1 [skip release]

* **translations:** sync translations from transifex (master) ([2603f34](2603f34))

feat: [DHIS2-17771] Org unit context in tables and lists (#3813)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

chore(release): cut 101.10.0 [skip release]

* [DHIS2-17771] Org unit context in tables and lists ([#3813](#3813)) ([b1a720a](b1a720a))

fix: [DHIS2-18028] User is able to add invalid related stages event (#3795)

* fix: change logic for linkable events

* fix: split up all and linkable events

* chore: remove redundant filter

chore(release): cut 101.10.1 [skip release]

* [DHIS2-18028] User is able to add invalid related stages event ([#3795](#3795)) ([301585e](301585e))

test: cleanup after running NewPage tests (#3843)

fix: cleanup after tests are run

chore: [DHIS2-17915] remove opt-in functionality (#3796)

fix: [DHIS2-18215] selected working list not persisted on navigate (#3838)

* fix: persist working list on navigate

* fix: allow navigate back despite displayFrontPageList

* chore: review

chore(release): cut 101.10.2 [skip release]

* [DHIS2-18215] selected working list not persisted on navigate ([#3838](#3838)) ([599b2c1](599b2c1))

feat: [DHIS2-17970] Auto-select orgUnit if there is only one available (#3798)

* feat: pre select

* feat: review changes

* fix: remove children check

* fix: review change

* feat: merge hooks for auto select

* Revert "feat: merge hooks for auto select"

This reverts commit 9b97d2e.

* fix: review changes

chore(release): cut 101.11.0 [skip release]

* [DHIS2-17970] Auto-select orgUnit if there is only one available ([#3798](#3798)) ([de06f8b](de06f8b))

fix: [DHIS2-16993] Text and long text DEs are missing arrows in changelog when deleted (#3827)

* fix: make arrow size static

* fix: revert changes to text

chore(release): cut 101.11.1 [skip release]

* [DHIS2-16993] Text and long text DEs are missing arrows in changelog when deleted ([#3827](#3827)) ([5e6dfa6](5e6dfa6))

fix: [DHIS2-18056] use linkedEntityFormFoundation instead of the searchFormFoundation (#3835)

chore(release): cut 101.11.2 [skip release]

* [DHIS2-18056] use linkedEntityFormFoundation instead of the searchFormFoundation ([#3835](#3835)) ([cbfe70b](cbfe70b))

feat: [DHIS2-17956] Display name for org unit in changelog (#3826)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

* feat: display name for orgunit

* fix: merge conflict

* fix: improve flow type

chore(release): cut 101.12.0 [skip release]

* [DHIS2-17956] Display name for org unit in changelog ([#3826](#3826)) ([5299f37](5299f37))

fix: [DHIS2-17978] use title instead of alt on missing icons (#3847)

* fix: use title instead of alt on missing icons

* chore: fix failing tests

chore(release): cut 101.12.1 [skip release]

* [DHIS2-17978] use title instead of alt on missing icons ([#3847](#3847)) ([b5940f2](b5940f2))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.12.2 [skip release]

* **translations:** sync translations from transifex (master) ([9bf7696](9bf7696))

feat: [DHIS2-17991] Show orgUnit selector in Enter details now (#3824)

* feat: add org unit selector

* feat: select org unit for linked event

* feat: add validation

feat: [DHIS2-16992] Fixed size for changelog modal and columns (#3834)

* feat: temp

* feat: fixed size table and columns

* fix: remove console log

* fix: fixed size improvement

chore(release): cut 101.13.0 [skip release]

* [DHIS2-16992] Fixed size for changelog modal and columns ([#3834](#3834)) ([3b021cf](3b021cf))
* [DHIS2-17991] Show orgUnit selector in Enter details now ([#3824](#3824)) ([bf2f1ca](bf2f1ca))

feat: [DHIS2-17792] Org unit context in forms (#3828)

* feat: update client to list converter

* feat: changes in tooltip component

* feat: add orgunit context stages and events widget

* feat: use cache for subvalues

* feat: orgunit context event workspace

* fix: renaming of return statement

* feat: add org unit context to forms

* fix: translation

* fix: cy tests breakes after translation fix

* fix: cy tests

chore(release): cut 101.14.0 [skip release]

* [DHIS2-17792] Org unit context in forms ([#3828](#3828)) ([c8ccf63](c8ccf63))

fix: [DHIS2-16010] app crashes on invalid programid (#3765)

* fix: app crash on invalid programid

* fix: app stuck in loading state when url has invalid enrollmentId or teiId

* fix: useProgramInfo hook breaks the app

chore(release): cut 101.14.1 [skip release]

* [DHIS2-16010] app crashes on invalid programid ([#3765](#3765)) ([9133a63](9133a63))

fix(translations): sync translations from transifex (master)

Automatically merged.

chore(release): cut 101.14.2 [skip release]

* **translations:** sync translations from transifex (master) ([57a7b83](57a7b83))

docs: improve docs (#3865)

fix: [DHIS2-17843] Disable delete enrollment button when user does not have authority (#3859)

* fix: string adjustment

* fix: disable button and add tooltip

* fix: revert wrong commit

* fix: create generic authorities hook

chore(release): cut 101.14.3 [skip release]

* [DHIS2-17843] Disable delete enrollment button when user does not have authority ([#3859](#3859)) ([edee6d3](edee6d3))

fix: [DHIS2-18228] Image Deleted on Update (#3857)

* fix: image deleted on update

* fix: remove call to fileresources

chore(release): cut 101.14.4 [skip release]

* [DHIS2-18228] Image Deleted on Update ([#3857](#3857)) ([4656864](4656864))

fix: [DHIS2-18248] pass on createdAt to rules engine when editing (#3848)
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