freesound icon indicating copy to clipboard operation
freesound copied to clipboard

Request confirmation before deleting comment

Open ffont opened this issue 7 years ago • 6 comments

Currently authors of a sound can delete the comments that other users make to that sound. Some users reported that it is easy to accidentally delete a comment because there is no confirmation step. We should open a simple "are you sure?" dialog before deleting. With jQuery we can do styled dialogs easily, otherwise native dialog would be fine as well. See https://stackoverflow.com/questions/12531324/javascript-or-jquery-are-you-sure-dialog-for-a-link/12531454#12531454

ffont avatar Jun 29 '18 12:06 ffont

We have this workflow in many places, we should consider if we want to standardise the process: https://github.com/MTG/freesound/pull/1191/commits/4b3765fc7d0e1b60726597f0eeb7590fc5ba9ec0 Personally I'm not a huge fan of using js directly for this operation.

alastair avatar Jun 29 '18 12:06 alastair

I thought of JS for simplicity in the code. We don't use dialogs often in FS, but in the new interface we'll use some modals and I think these kind of things would be very easy to implement with modal + JS. What are the reasons not to use JS here other than people not running JS? Could we do something like "if user does not run JS, then there is no delete confirmation". Although I'd like to know how may users don't enable JS in their browsers...

ffont avatar Jul 02 '18 07:07 ffont

While we're looking at this ticket let's also try and find all other places where we have a delete link (and optional confirmation page) workflow. Ideally we should make all of these work the same way, regardless of what that way is.

alastair avatar Jul 13 '18 13:07 alastair

also #1288

alastair avatar May 16 '19 14:05 alastair

A confirmation modal has been added in the new UI, but we should double check if the request is GET or POST and make it POST.

ffont avatar Nov 30 '23 13:11 ffont