X Tutup
Skip to content

Fix file conflict dialog when dragging a file into a folder#39162

Merged
AlexAndBear merged 3 commits intomasterfrom
issues/39133
Sep 3, 2021
Merged

Fix file conflict dialog when dragging a file into a folder#39162
AlexAndBear merged 3 commits intomasterfrom
issues/39133

Conversation

@JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Sep 2, 2021

Description

When dragging a file into a folder, while another file with an identical name exists in the parent directory, the UI falsely showed a conflict dialog alert.

Related Issue

How Has This Been Tested?

  • Upload file "test.txt" to your root dir
  • Create an empty folder "folder" in your root dir
  • Drag-and-drop "test.txt" from your computer's explorer/finder onto "folder", resulting in a new upload
  • -> The file should be uploaded without any issues.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 2, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

71.4% 71.4% Coverage
0.0% 0.0% Duplication

@phil-davis
Copy link
Contributor

Works now for the case:

  • Alice has folder "top" and file "test.txt" in the root of the file system
  • Alice drags-and-drops another file called "test.txt" from her local system on top of folder "top"
  • folder "top" now has that "test.txt" in it - good.

The next thing is more tricky (and probably was tricky already before this PR):

  • Alice edits the local "test.txt"
  • Alice drags-and-drops the changes "test.txt" from her local system on top of folder "top"
  • Alice is shown a dialog titled "One file conflict" and asked "Which files do you want to keep?" - good
  • But the dialog mentions folder "top" as the "already existing file" and shows a "text file" icon for the "new file", but there is no mention of "test.txt" - not so good, see screenshot:

Drag-and-drop-into-folder

  • if Alice selects the new file and "Continue" then top/test.txt does get updated with the new data - good.
  • if Alice selects the "already existing file" (the folder "top") and "Continue" then no changes happen - good.

So the real behavior is OK. It is just that the "One file conflict" dialog should mention top/test.txt as being the existing file.

Is there something that can easily be done about that?

@phil-davis
Copy link
Contributor

Note: the "will have a number added to its name" thing works - if I select both "files" and "Continue" then I end up with both test.txt and test (2).txt inside folder top - good

@JammingBen
Copy link
Contributor Author

Much thanks for the detailled testing! 👍

But the dialog mentions folder "top" as the "already existing file" and shows a "text file" icon for the "new file", but there is no mention of "test.txt" - not so good, see screenshot:

Yes, we also observed this. Unfortunately there is no quick fix for this, because the frontend would need to scan the folder content. Also what happens if you drag a folder into the folder? It would require quite some work and thought either way. Therefore, and because it's "only" an UI issue, we decided to leave this behavior as it is right now.

@phil-davis
Copy link
Contributor

Therefore, and because it's "only" an UI issue, we decided to leave this behavior as it is right now.

That's fine with me. Sorting all that out is a separate issue. The changes here do not make that any different than it already is.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and works.
Note: we can't automated-test this, because Behat+selenium has no access to do an "external" select, drag, drop of a file from a "file explorer" running outside the browser window.

@AlexAndBear AlexAndBear merged commit afb81a4 into master Sep 3, 2021
@delete-merged-branch delete-merged-branch bot deleted the issues/39133 branch September 3, 2021 07:56
@jnweiger
Copy link
Contributor

Confirmed in 10.9.0-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drag-and-drop a file into a folder while the same file exists in parent shows file conflict

4 participants

X Tutup