Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

[PROD] "Add Report" button on emergency page redirects to general admin backend #1116

Closed
teklal opened this issue Apr 16, 2020 · 8 comments
Closed
Assignees

Comments

@teklal
Copy link
Contributor

teklal commented Apr 16, 2020

Issue

On an emergency page in the response documents section there is a button "Add report".

image

Currently this redirects the user to the general Django admin page instead of the backend of the desired emergency.

Steps to reproduce

Go to an emergency that has response docs added to it (the highlighted operations on the frontpage would have these) and navigate to the Response documents section where on the right there is the "Add report" button.

Expected behaviour

Instead of redirecting the user to the general admin backend, it should direct the user to the backend of the emergency that they are trying to add the document to.

As an example: for the global COVID-19 emergency page (https://go.ifrc.org/emergencies/3972) comparing the URL of the "Add report" button (https://prddsgocdnapi.azureedge.net/admin/api/event/3972/change) and the "Edit Event" (https://prddsgocdnapi.azureedge.net/api/event/3972/change/) which correctly redirects to the right emergency backend, it seems like an easy fix of just removing the "admin" part from the URL to get it to redirect to the right emergency.

If feasible it would be great to redirect not only to the correct emergency but also to the response docs (atm Situation reports in the backend) section of that specific emergency in the backend.
image

Related feature

#791

Severity

Until this has been fixed, the risk of users trying to add reports through the section that gives an error (described in #1117 ) is higher. If #1117 is fixed before, this isn't as critical.

Is there a workaround?

In the backend the user can navigate to the right emergency or on the frontend use instead the "Edit event" button.

@batpad batpad self-assigned this May 25, 2020
@batpad
Copy link
Contributor

batpad commented May 25, 2020

This should be a straightforward fix to ensure that the ?next= parameter is set correctly when redirecting to the Admin login so that the user is forwarded to the right Emergency after logging in.

Assigning to myself for now, @kamicut @GregoryHorvath let me know if you guys have spare cycles to look and can re-assign.

@karitotp
Copy link
Collaborator

Now this is redirecting to the backend of the desired emergency!

@nanometrenat
Copy link
Contributor

@batpad - a favour (sorry, I should've spotted this in original ticket) - is it easy enough to make the redirect point to the human-friendly domain (i.e. goadmin.ifrc.org, in Production) rather than the biglong prddsgocdnapi.azureedge.net version?

FYI part 3 of #958 did a bunch of URL "nicing" already so it would be great if we could be consistent and always use the nice version if poss. However not if too risky of course, as it functions perfectly well with the long URL ;)

THANKS A LOT!

@LukeCaley
Copy link

@batpad can you confirm if @nanometrenat's suggestion / request above is in scope and can be easily delivered please?

@batpad
Copy link
Contributor

batpad commented Jul 1, 2020

@batpad can you confirm if @nanometrenat's suggestion / request above is in scope and can be easily delivered please?

The only non-hacky way to do this is to change a configuration variable application-wide. This would be good to do, I would just not be comfortable making that change without more thorough testing. Can we push that to a future release? Happy to either keep this ticket open or make a new one for the URL change. Once I look a bit more at where all this config parameter is being used and how, it is likely I will open a separate ticket. Thanks @nanometrenat for flagging and apologies for not getting back sooner on this one.

@nanometrenat
Copy link
Contributor

Personally I am fine with this being in a future release as it has been how it is for quite some time and don't want to introduce risk at short notice without testing. Separate ticket is all good, thanks @batpad

@batpad
Copy link
Contributor

batpad commented Jul 2, 2020

New issues created for:

Marking this ticket as Done.

@teklal
Copy link
Contributor Author

teklal commented Jul 2, 2020

Original ask now in PROD and working well, tangent requests outlined in separate tickets. Thanks team! Closing this.

@teklal teklal closed this as completed Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants