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 211 forks source link

Invalid entry in place_hierarchy_types causes report filter to not load #7249

Open kennsippell opened 3 years ago

kennsippell commented 3 years ago

What feature do you want to improve? There is an attribute in app_settings called place_hierarchy_types which does not appear to be mentioned in in our documentation. This month, two apps had this setting incorrectly configured which resulted in the "All Places" flyout not loading in the filter section on the reports tab (see screenshot below).

Describe the improvement you'd like Is this setting redundant? Can it be calculated from the contact_types configuration? If it is required, can cht-conf error if it is ever invalid (instead of failing silently)? Can we document it clearly?

Additional context image

inbox.js:3 Error loading facilities TypeError: n[e] is not a function
    at inbox.js:3
    at Array.map (<anonymous>)
    at inbox.js:3
    at inbox.js:3
    at inbox.js:3
    at c.$digest (inbox.js:3)
    at c.$apply (inbox.js:3)
    at HTMLSpanElement.<anonymous> (inbox.js:3)
    at HTMLSpanElement.dispatch (inbox.js:3)
    at HTMLSpanElement.v.handle (inbox.js:3)

Related Production Issues

https://github.com/medic/config-moh-kenya-app/issues/37 https://github.com/medic/config-cmmb-ke/issues/167

Why Now? Partner(s): Internal Reason(s): A partner will have CHWs/Supervisors with a detrimental experience, thus providing bad care

garethbowen commented 3 years ago

In addition to the above, we should prevent the error and provide a useful error message in the console.

garethbowen commented 3 years ago

I've added it to 3.13.0 but depending on where the code is fixed it potentially should be moved to a cht-conf milestone.

garethbowen commented 2 years ago

Not a blocker for 3.15.0