feat: Handle file upload from Flagship#2969
Conversation
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.
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...
|
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.
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.
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.
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 linagora/cozy-flagship-app@5278d76
Instead of removing all files to upload, we go back to the selection screen
Files are sent one by one
Uh oh!
There was an error while loading. Please reload this page.