-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Discard Draft does not delete draft #3927
Comments
Thanks for the clear report @ThaMunsta. The "Discard Draft" button has always just discarded the draft content (Re-fetches current saved page content) from the editor, and not touched the database, but I can see how this is not clear by the action name, and with it being alongside the "Save Draft" button which is a database action. Also can understand why you'd want to be able to actually delete the draft. Maybe we need to provide two options:
Ideally would want more concise wording for that second option. Maintainer Note
|
I'll throw my name suggestion in the hat:
I think especially displayed in that order, it will be easy to understand what the second button does. Thanks for taking the time to read this! |
Provides a way for users to actually delte their user drafts where required. For #3927 Added test to cover new endpoint. Makes update to MD editor #setText so that new selection is within new range, otherwise it errors and fails operation.
Within b01bbf9 as new "Delete Draft" button has been added alongside the existing option to delete the user draft and discard the editor content back to last saved state. This includes a confirmation before the action is taken, since there's a higher risk of data loss with this action. This will be part of the next feature release. |
Describe the Bug
A saved draft is not removed from the database by clicking Discard Draft at the top of the page.
Steps to Reproduce
Expected Behaviour
The button named Discard Draft should remove the stored changes from the database so a user doesn't go in to edit the page later and save edits from an old draft that were not intended to be "remembered". Ideally this will also prevent the warning about unsaved changes when you are navigating away from the page.
Screenshots or Additional Context
The two buttons in question are at the top of the page and look like this:
Browser Details
Chrome Version 108.0.5359.125 on Windows 10 21H2
Exact BookStack Version
v22.11.1
PHP Version
PHP 8.0.25
Hosting Environment
Docker Image (linuxserver/bookstack:latest) hosted behind Nginx Proxy Manager.
Reproduced on https://demo.bookstackapp.com/ logged in as admin.
Originally discovered on older version (v21 something I believe) but looking at the docs and
page-editor.js
it might have been this way for a while. If it was intentional - my apologies.The text was updated successfully, but these errors were encountered: