wagtail-nest / wagtail-review

A Wagtail extension for gathering annotations and feedback on pages before publication
BSD 3-Clause "New" or "Revised" License
49 stars 19 forks source link

Redirect to Reviews Dashboard page after response is saved #4

Closed maylonpedroso closed 5 years ago

maylonpedroso commented 5 years ago

Hi,

Using the plugin I found uncomfortable to have a page just with a message of success after a response is submitted in the review page. I created this PR with what I think is the expected workflow:

After the response is saved the page redirect to the Reviews Dashboard displaying a success message, then the user can pick another pending page for review.

Screenshot: screenshot from 2019-01-10 15-25-26

Also added a test for a POST to the respond view.

Let me know your take on this. Thanks!

gasman commented 5 years ago

Hi @maylonpedroso - thanks for the PR.

The problem with redirecting to the dashboard is that the reviewer might not have a login to the Wagtail admin - allowing non-Wagtail users to be reviewers is a fundamental feature of this package. Perhaps we can add an 'is logged in' check here, and only send them to the dashboard if they're currently logged in?

maylonpedroso commented 5 years ago

Hi @gasman , thanks for the review. It took some days to get back to it, but I finally had the time to put together a fix with your suggestion. Please, give it another look and let me know your take.

gasman commented 5 years ago

Looks good to me - thanks @maylonpedroso!