-
Notifications
You must be signed in to change notification settings - Fork 63
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
[VO-711 & VO-741 & VO-755 & VO-707] feat: Show the content of Nextcloud folder #3153
Conversation
12703d4
to
68de683
Compare
BundleMonFiles updated (8)
Unchanged files (10)
Total files change +58.84KB +1.21% Groups updated (5)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
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.
Maybe the 2 make future action visible
commits messages need to be more explicit. I'm not sure to understand them.
But anyway, only a few suggestion but everything is fine.
const hasMultipleDrive = data?.length > 0 | ||
const showNextcloud = flag('drive.show-nextcloud-dev') == true |
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.
Does this mean we can have multiple drive but other than nextcloud ones?
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 if you have shortcut into the shared drives folder it will display them there. In the future, it will have also folder as the real version of shared drives
src/modules/nextcloud/utils.js
Outdated
export function makePath(root, filename) { | ||
return `${root}${root.endsWith('/') ? '' : '/'}${filename}` | ||
} |
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.
Nice one, I was going to comment this on first commit when it was inlined. There are 6 other iterations of this code in cozy-drive, let's homogenize them ❤️
src/locales/en.json
Outdated
@@ -787,5 +788,11 @@ | |||
"NotFound": { | |||
"title": "The element cannot be found", | |||
"text": "We have not found anything at this address. This may be a typing error." | |||
}, | |||
"NextcloudBreadcrumb": { | |||
"root": "Drive partagés" |
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.
Wrong language here
const { subdomain: subDomainType } = (client?.getInstanceOptions() ?? { | ||
subdomain: 'flat' | ||
}) as { subdomain: string } |
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'm not sure you should call getInstanceOptions()
here.
As you are in a web app, you can access client.instanceOptions
as it is already initialized from DOM here: https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyClient.js#L1677-L1689
But even better, you can call client.capabilities.flat_subdomains
that is initialized at the same place and directly contains the boolean
you are looking for. Also client.capabilities
is typed here so you dont need to use any as XXX
notation
Last but not least, you can also use the useCapabilities hook if needed (but it is not typed, we should fix that someday)
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.
That's an interesting question you ask - we use this method in several places in Drive (ex). getInstanceOptions()
is only a getter for client.instanceOptions
.
I will try client.capabilities.flat_subdomains
as it is typed 🫶
timeout = setTimeout(() => { | ||
setNeedsToWait(false) | ||
}, 50) |
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.
Here are we waiting for 50ms in order to be in a new render loop? If yes we can reduce it to 1ms can't we?
Or maybe this is to display the skeleton long enough to avoid any flickering?
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 thinks this for avoid flickering but I only copy it from FolderViewBody trying to extract the essential piece. My commit message are enough explicite
This refactor allow to navigate to other type of document instead file
fix: Translation on NextcloudBreadcrumb feat: improve type
This new component is an extraction of the essence of the FolderViewBody component to decouple the display of files from their type
These actions are placeholders, which allow the user to see the future actions available before they are developed. These are deactivated in the meantime
These actions are placeholders, which allow the user to see the future actions available before they are developed. These are deactivated in the meantime
All this work is behind the flag
drive.show-nextcloud-dev
Note on this PR :
This is the first part of my work on Nextcloud so that it can be tested. Some parts will be removed or merged with others in the next version.
Especially the actions, the ones that don't have Nextcloud in the naming correspond to the ones I intend to make common with the
io.cozy.files
. I plan to use 2 strategies :FolderBody
as the minimal part and to expose two new methods (onFileRename, onFileCreate). They will be implemented specifically forio.cozy.files
andio.cozy.remote.nextcloud.files
in a wrapper component like I begin inNextcloudFolderBody
.:parent/delete
where we can have different implementationThe two slightly more hybrid cases would be the move modal and uploading a file, which I need to look at in more detail.
This version still produces a lot of 404s because it tries to download the thumbnail of a Nextcloud file using the
io.cozy.files
api.Related PRs: