-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
When uploading a single file, offer input field to change file name #16215
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
base: master
Are you sure you want to change the base?
Conversation
app/src/androidTest/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivityIT.kt
Outdated
Show resolved
Hide resolved
2fb0eed to
3a806a0
Compare
3a806a0 to
a99eec4
Compare
This streamlines the upload from files, e.g. from email attachments. Closes nextcloud#9215. The approach via the listener mFileDisplayNameTransformer was chosen because this allows a potential extension to multiple files (with multiple input fields). Alternatively, ReceiveExternalFilesActivity#uploadFile() could've been used, which requires the storage to a temporary file first. nextFocusForward and nextFocusDown are both needed to support navigation with the Tab key as well as the Enter key Signed-off-by: Philipp Hasper <[email protected]>
This streamlines the renaming and speeds up the process. Signed-off-by: Philipp Hasper <[email protected]>
When running the screenshot tests, the following error was raised: com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT > openMultiAccount[uiComparison(AVD) - 9] FAILED java.lang.AssertionError: Can't create multiple screenshots with the same name: com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT_open at com.facebook.testing.screenshot.internal.AlbumImpl.addRecord This happened because openMultiAccount() simply calls the open() test which "hardcodes" the screenshot name Signed-off-by: Philipp Hasper <[email protected]>
e86f3ef to
aec6581
Compare
The UI only allows to proceed with the upload, if the permissions are given accordingly, so the test setup needs access to the corresponding permission keys. Instead of only making one of the keys available, all were made public. Because why should these magic strings be private after all? This only invites duplication and hinders maintenance. Signed-off-by: Philipp Hasper <[email protected]>
The automated test only tests this partially, because the only invalid name was an emtpy name. All other characters which are typically unsuitable for a filename, like the directory separator '/' are not properly rejected during the test run, because the FileNameValidator is based on the user capabilities, which are null because this is a sever-less test. Signed-off-by: Philipp Hasper <[email protected]>
Signed-off-by: Philipp Hasper <[email protected]>
To reduce duplication, the file and folders are setup in a @before method, but this also affects the existing screenshot tests. Signed-off-by: Philipp Hasper <[email protected]>
Working around the limitation of returns as well as the condition complexity was attempted but made the code just less readable. Ignoring these two specific findings is more appropriate here. Signed-off-by: Philipp Hasper <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
kra-mo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some more padding atop the entry since the label is quite close to the edge now, but other than that, looks good from the design side. Neat :)
This streamlines the upload from files, e.g. from email attachments.
Closes #9215.
Also offers a convenient pre-selection of the filename without extension when entering the input field, as well as file name validation.
Recording of the automated test:
(The upload failure in the end is expected, as there is no server mocked)
Screen_recording_20260102_124130.mp4
Technical details
@Beforemethod which apply to all tests. Screenshot tests are broken on master right now, so I did not feel confident to provide updated screenshots with no way of verifying them. Either they need to be updated later, or the tests should be separated in two files