-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: Handle file upload from Flagship #2969
feat: Handle file upload from Flagship #2969
Conversation
acezard
commented
Aug 23, 2023
•
edited
Loading
edited
- Upload one file
- Upload multiple files
- Handle upload progression without leaving the app with one file
- Handle upload progression without leaving the app with multiple files
- Handle upload progression after leaving and opening the app again with one file
- Handle upload progression after leaving and opening the app again with multiple files
569db51
to
5a3eb17
Compare
7bd34e8
to
ec80628
Compare
7ce7c11
to
880b97e
Compare
title={t('ImportToDrive.title', { smart_count: items.length })} | ||
subTitle={t('ImportToDrive.to')} | ||
/> | ||
<Query |
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.
Query component is deprecated. You should have refactor to useQuery(). I still thin that this kind of refactor to be up to date with the cozy latest standard should be done BEFORE converting to TS...
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.
refactored
I have to delete the cache on travis to be able to build this branch. And locally I have to rm -rf node_modules/ .... |
BundleMonFiles updated (6)
Unchanged files (13)
Total files change -51.6KB -1.13% Groups updated (4)
Unchanged groups (4)
Final result: ✅ View report in BundleMon website ➡️ |
}, [dispatch, removeFileToUploadQueue, t]) | ||
|
||
const onClose = useCallback(async () => { | ||
await webviewIntent?.call('resetFilesToHandle').then(() => { |
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.
I still really don't like this way of writing code... Can we do it differently to be the same as other place?
- Also add placeholder route that will handle mobile uploads later
It is believed this will help integrating with the existing store logic. No runtime changes are intended, only typings so everything is as clear as possible when reusing the already existing mobile upload flow
has to be put at a better location
Go back to drive root as a fallback. Some app states can go back to drive upload page that was in cache, while cozy-flagship doesn't have files to upload anymore
1331b4b
to
76634d1
Compare
this commit: - removes modification in upload module - removes logic in uploaderView - regroup logic and state management in the custom hook of the feature - removes deprecated Query component - enhances UI loading state - accept 10 files maximum
76634d1
to
96ce541
Compare
Also remove old import from a test file. The test file itself seems a bit outdated, it would be good to review it at some point
|
||
logger('info', 'uploadFilesFromFlagship called') | ||
|
||
await webviewIntent?.call('uploadFiles', JSON.stringify({ fileOptions })) |
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.
I just noticed that we pass only one file at a time to uploadFiles
. Didn't we want to pass an array here?
If yes we should modify the interface.
If no we should rename this as uploadFile
.
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.
Yes it's one by one, it was made like that to mimick the old upload to mobile feature. In this case renaming seems the best approach
done on react-native side too cozy/cozy-flagship-app@5278d76
Instead of removing all files to upload, we go back to the selection screen
Files are sent one by one