Review main Merged

25523[BUGFIX] Improve confirmation dialog in drag'n'drop fileupload

Stefan Aebischer CR +2 V +2 Easy +30 −4 updated 01/30/14, 16:05

Commit message

This patch introduces the following changes to the drag'n'drop
fileuploader:

* Only ask for confirmation to overwrite files, if at least
one of the uploaded files will overwrite an existing file on
the server
* Display the files which will be overwritten in the confirmation
dialog
* If the user selects "Cancel", cancel the whole action, and
don't upload any files.
* If no files will be overwritten, just upload them without
disturbing the user with a confirmation message.

Review

  • Code review CR +2
    • Wouter Wolters +2
  • Verified V +2
    • Wouter Wolters +2

Issues 1

Files 3

Review log 16

  1. Mr. Jenkins commented on patch set 1 11/20/13, 00:24

  2. Markus Klein commented on patch set 1 11/20/13, 01:24

    Nice patch, please see my comments

    DragUploader.js:94

    line break and {} please

    DragUploader.js:103

    no need to compare against true again

    DragUploader.js:209

    $(row).data('file-name')
  3. Stefan Aebischer uploaded patch set 2 11/20/13, 10:26

  4. Mr. Jenkins commented on patch set 2 11/20/13, 10:42

  5. Markus Klein voted on patch set 2 V +1 CR +1 11/20/13, 11:38

  6. Wouter Wolters uploaded patch set 3 11/20/13, 17:31

  7. Wouter Wolters commented on patch set 3 V +2 CR +2 11/20/13, 17:32

    Added only 2 spaces after an if inside the JavaScript part. No functional changes. Markus his vote is still valid.
  8. Wouter Wolters merged patch set 4 11/20/13, 17:32

  9. Mr. Jenkins commented on patch set 3 11/20/13, 17:45

  10. Frans Saris commented on patch set 4 01/25/14, 17:58

    In general nice approach. But only the visible files are counted. But the filelist can contain multiple pages.
  11. Frans Saris commented on patch set 4 01/25/14, 18:32

    And it only works when thumbs are shown and for files that have a preview thumb.
  12. Frans Saris commented on patch set 4 01/28/14, 20:00

    Imo this should be reverted as it doesn't work when the file list has more then one page and only for files that have a thumb shown. So now it doesn't work when no thumbs are shown. Further it does/can not respect the file renaming done by file driver when matching for existing files.
  13. Markus Klein commented on patch set 4 01/28/14, 21:58

    Frans I agree here. Although I voted for this patch, I didn't realize that we've paging in the filelist. And of course the duplicate detection has to be the same as in the core. So +1 for reverting
  14. Stefan Aebischer commented on patch set 4 01/28/14, 22:31

    Hi Frans, i also did not realize that the filelist is paginated. My suggestion would be to provide a list with existing files as json (either inline in HMTL or via an extra ajax request), instead of having them in data-file-name attributes. This would solve the first two problems you mentioned. I just had a quick look at TYPO3\CMS\Core\Utility\File\ExtendedFileUtiliy. For now it only handles the conflictModes 'replace' or 'cancel'. (around line 916) So it anyway does/can not respect the file renaming done by file driver when matching for existing files.
  15. Frans Saris commented on patch set 4 01/30/14, 15:55

    For now we gonna revert this. Will try to come up with a new approach for this after the drag&drop changes are in.
  16. Frans Saris commented on patch set 4 01/30/14, 16:05

    Reverted This patchset was reverted in change: I6f4b91bbf28e7b6f0cb8d7bcfb42f0cfb5eeacc6