Skip to content
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

[full-ci] Implement single file upload on "paste" action #9140

Merged
merged 8 commits into from Jun 1, 2023

Conversation

lookacat
Copy link
Contributor

@lookacat lookacat commented May 31, 2023

Description

See #9047

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented May 31, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@lookacat lookacat changed the title Upload file on paste Implement single file upload on "paste" action May 31, 2023
@lookacat lookacat marked this pull request as ready for review May 31, 2023 13:15
@lookacat lookacat changed the title Implement single file upload on "paste" action [full-ci] Implement single file upload on "paste" action May 31, 2023
@lookacat lookacat requested a review from JammingBen May 31, 2023 13:40
Copy link
Collaborator

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

Code LGTM and works nice :) 2 more things though:

  • When selecting multiple files there should probably be a message informing the user that only 1 file was pasted successfully because of security reasons.
  • If unref(canUpload) is false you can early return as well.

@lookacat
Copy link
Contributor Author

lookacat commented Jun 1, 2023

I don't think we have the information that the user has selected multiple files, we just have this one file even when multiple are selected, but other point is valid ^^

@JammingBen
Copy link
Collaborator

I don't think we have the information that the user has selected multiple files, we just have this one file even when multiple are selected

So the API doesn't even provide that information? Well, okay. Too bad :(

@lookacat
Copy link
Contributor Author

lookacat commented Jun 1, 2023

Theoretically it depends on the browser, but since all sources i found say only one will be pasted i think it makes no sence to provide logic for the case a browser comes along which gives us an file array of two files :D

@lookacat lookacat requested a review from JammingBen June 1, 2023 09:03
@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@lookacat lookacat merged commit 680b27a into master Jun 1, 2023
4 checks passed
@delete-merged-branch delete-merged-branch bot deleted the upload-file-on-paste branch June 1, 2023 11:39
ownclouders pushed a commit that referenced this pull request Jun 1, 2023
* Upload file on paste

* refactor

* Add changelog

* Address PR issues

* Fix .find is not a function error

* remove useless mutation

* reintroduced wrongly removed item

* Add canUpload check
@micbar micbar mentioned this pull request Jul 24, 2023
68 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Implement single file upload on "paste" action in Web
3 participants