RolnickLab / ami-platform

GNU General Public License v3.0
8 stars 2 forks source link

Show default sorting #430

Closed annavik closed 1 week ago

annavik commented 2 weeks ago

From start, we will not pass any sort param to BE and the order of items is not really specified. We could either just reflect the default sorting (whatever that is) in the interface OR make sure frontend always passes a sorting preference when items are fetched, also from start. Let me know what you prefer @mihow !

annavik commented 2 weeks ago

I'm thinking perhaps better to always specify a sorting preference from frontend? Just reflecting the default sorting will be a solution that means frontend app has to make assumptions.

mihow commented 2 weeks ago

I'm thinking the backend list views should return a meta attribute that contains the active filter and sorting parameters. Also then the filter parameter can be a full object with a name you can use for display, rather than just Event: 123

image

mihow commented 2 weeks ago

But ALSO, I think the default sorting preference can come from the UI. The backend list endpoints are used for multiple views. So it's really the current view/page that should store what sort order is most helpful in that context. I think the sort order for the Occurrences table view should default to the most recently detected occurrences.