Enable editing polls
Part of #975
What does this MR do?
Makes it possible for the author of a poll to edit the title, description, and options within the first hour after creation (as discussed in https://codi.kanthaus.online/fs_voting_tool_2020#). In detail:
- adds the creation timestamp to the
fs_poll
database table - changes the minimum start time to now + 1 hour, so that there is one hour time in which the poll can still be edited
- new "edit" button in the poll overview page which is visible for the poll's author and opens an edit form
- new endpoint
PATCH /polls/{id}
in the backend
How confident are you it won't break things if deployed?
Not very sure. I'd be happy about a lot of testing :)
How to test
Steps a reviewer can take to verify that this MR does what it says it does e.g.
- Checkout branch locally
- Login as userbot
- Go to Göttingen -> Abstimmungen and create a new poll
- You should not be able to create a poll that starts in less than an hour
- Submit the poll -> on the poll's page there should now be an edit button
- Edit the poll, save it, and check if the changes are visible
- In older/ongoing/finished polls the edit button should not be visible
Checklist
-
added a test, or explain why one is not needed/possible... -
no unrelated changes -
asked someone for a code review -
set a "for:" label to indicate who will be affected by this change -
use "state:" labels to track this MR's state until it was beta tested -
added an entry to CHANGELOG.md -
add a short text that can be used in the release notes(we should create a general text about the tool for the next release) -
Once your MR has been merged, you are responsible to create a testing issue in Beta Testing Repo:(will be done in the beta working group)- Consider writing a detailed description in German.
- Describe in a few sentences, what should be tested from a user perspective.
- Also mention different settings (e.g. different browsers, roles, ...). how this change can be tested.
- Be aware, that also non technical people should understand.