cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

Add ability to sort hierarchy places in webapp by custom field

Open 1yuv opened this issue 2 years ago • 2 comments

Currently hierarchy types are sorted in webapp alphabetically as documented here.

We have a deployment where there are hundreds of households registered in webapp and CHNs (FCHVs) are having hard time navigating to particular household. Currently when registering households, we're capturing house number as well and CHNs had a request to sort those places by household numbers.

image

However, with current option it looks like we can either sort by name or by dob by setting sort_by_dob to true.

This is a request to allow sort by custom key in webapp, so that we can address this request for example household_id, or any configurable key.

1yuv avatar Jun 10 '22 12:06 1yuv

Thanks for highlighting @yrimal. Is this meant to be a sort that users can do to see their list in different ways, or for app developers to set for everyone in a deployment? If it's the latter, how do you currently set the household ID in the name shown in that list? Would including the household ID as the prefix for the name field help to sort using the current alphabetic sort? If so, that can be aggregated within the form so that the user doesn't have to do any special formatting themselves. Of course, that doesn't help with different sorts within the app, but thought I'd mention it in case it helped in this scenario.

Pinging @n-orlowski since this should be considered as part of the evolution of the Contacts tab UX.

abbyad avatar Jun 13 '22 15:06 abbyad

Hi @abbyad , thank you for resonses.

Is this meant to be a sort that users can do to see their list in different ways

I guess this would be really nice feature for CHT in longer term.

for app developers to set for everyone in a deployment?

This is our current requirement.

Would including the household ID as the prefix for the name field help to sort using the current alphabetic sort?

I guess that'd make entire combination a string and it'd be alphanumeric sorting, probably making the order more complex, but that's definitely a nice idea for the areas where it works.

1yuv avatar Jun 13 '22 16:06 1yuv