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

[PROD] Situation report list order #1395

Open
szabozoltan69 opened this issue Sep 27, 2024 · 2 comments
Open

[PROD] Situation report list order #1395

szabozoltan69 opened this issue Sep 27, 2024 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@szabozoltan69
Copy link
Collaborator

szabozoltan69 commented Sep 27, 2024

Issue

Recently it is not possible to set a situation report order, situation reports show randomly on emergency pages.
We should use an &ordering=created_at part in the request.

Details:

From backend side it would be possible to order by created_at and name:
https://github.com/IFRCGo/go-api/blob/develop/api/drf_views.py#L782-L784
But the client does not send any of them.
E.g.
https://go.ifrc.org/emergencies/6700/reports :
https://goadmin.ifrc.org/api/v2/situation_report/?event=6700&limit=9999
gives this order:
Middle East Complex Emergency - SITREP N.2
Middle East Complex Emergency - SITREP N.10
Middle East Complex Emergency - SITREP N.13
Middle East Complex Emergency - SITREP N.1
Middle East Complex Emergency - SITREP N.4
This is not date neither name order.

If we insert an
&ordering=created_at

If a more sophisticated version is needed, we can insert a "position" or "order" integer to expicitely being able to define ordering.

Also on backend side Admin it would be nice to – at least – see created_at, because recently it can not be seen anywhere, just in the database.

@szabozoltan69
Copy link
Collaborator Author

Could be solved on backend side via IFRCGo/go-api#2275

@szabozoltan69
Copy link
Collaborator Author

You can test it on Staging, e.g. on https://go-stage.ifrc.org/emergencies/6700/reports

@tovari tovari added the type: bug Something isn't working label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants