medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
439 stars 207 forks source link

Contact Details load facilities when user has one home place assigned #9265

Closed latin-panda closed 1 month ago

latin-panda commented 1 month ago

Describe the bug When the user only has 1 home place assigned, the contact details should not load the descendant facilities. For example, a CHW Area that is the user's home place should not load households.

But if the user has more than 1 home place assigned, it should load them.

The bug is when the user has 1 home place, it's loading the facilities on reload.

To Reproduce

https://github.com/user-attachments/assets/ad0af532-cadc-423f-a02a-abf1b4f99357

Expected behavior

It should not load the descendant facilities when a user has 1 home place assigned, not even when reloading the page.

Logs No errors in logs.

Environment

latin-panda commented 1 month ago

@michaelkohn Am I remembering the rule correctly? Should we make this rule explicit somewhere in cht-docs so it's not just a rule in the code?

michaelkohn commented 1 month ago

Am I remembering the rule correctly?

Yes, that is correct.

Should we make this rule explicit somewhere in cht-docs so it's not just a rule in the code?

We mention this in the release notes and link to the forum screenshots in the docs here. Perhaps we can address it elsewhere (like here) when we redo everything for NAV. Was there somewhere else you were thinking too? cc: @esthermmoturi