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

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

Merged
merged 7 commits into from
Oct 14, 2024

Conversation

henrikmv
Copy link
Contributor

@henrikmv henrikmv commented Sep 26, 2024

DHIS2-17771

  • Updates files for subvalue retrieval to use getOrgUnitNames for retrieving organization unit names. With getOrgUnitNames we take use of caching instead of directly querying organization unit details.

  • Modifies the TooltipOrgUnit component to fetch and display organization unit names with their ancestors. Modifying the TooltipOrgUnit required changes to the Profile widget and Enrollment widget.

  • Implements organization unit context in:
    TEI WL,
    Program stage widget
    Two Event Workspace widget

@henrikmv henrikmv marked this pull request as ready for review September 27, 2024 09:32
@henrikmv henrikmv requested a review from a team as a code owner September 27, 2024 09:32
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.

Great simplifications @henrikmv! 🎉 Just one minor comment from me:

@@ -48,9 +48,9 @@ const getImageResourceSubvalue = async ({ attribute, minorServerVersion }: SubVa
};

const getOrganisationUnitSubvalue = async ({ attribute: { value }, querySingleResource }: SubValueFunctionParams) => {
const orgUnits = await getOrgUnitNames([value], querySingleResource);
const organisationUnit = await getOrgUnitNames([value], querySingleResource);
Copy link
Contributor

Choose a reason for hiding this comment

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

To make the return statement below clearer I think organisationUnit should be renamed to organisationUnits or orgUnits. Same in getSubvalueTofTei.js.

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 Oct 2, 2024

…/feat/DHIS2-17771_OrgUnitContextInTablesAndLists
},
});
return { ...organisationUnit };
const organisationUnit = await getOrgUnitNames([key], querySingleResource);
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if we can make a wrapper function called getOrgUnitName (singular).

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.7 versions

@henrikmv henrikmv merged commit b1a720a into master Oct 14, 2024
41 checks passed
@henrikmv henrikmv deleted the hv/feat/DHIS2-17771_OrgUnitContextInTablesAndLists branch October 14, 2024 08:55
dhis2-bot added a commit that referenced this pull request Oct 14, 2024
# [101.10.0](v101.9.1...v101.10.0) (2024-10-14)

### Features

* [DHIS2-17771] Org unit context in tables and lists ([#3813](#3813)) ([b1a720a](b1a720a))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 101.10.0 🎉

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