-
Notifications
You must be signed in to change notification settings - Fork 36
feat: Update FileImageLoader to be used in shared drive ✨ #2828
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
Conversation
BundleMonUnchanged files (3)
No change in files bundle size Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
@@ -142,7 +142,7 @@ export class FileImageLoader extends Component { | |||
throw new Error('No pdf files fallback') | |||
} | |||
const src = await client | |||
.collection('io.cozy.files') | |||
.collection('io.cozy.files', { driveId: file.driveId }) |
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.
if the file
is an io.cozy.files
object, where the driveId
comes from ? It is not documented https://docs.cozy.io/cozy-doctypes/io.cozy.files.html 🤔 And I don't remember we have such attr on it.
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.
Agree, did you test this to check if it works @lethemanh ? If I remember well, shared drive id comes from io.cozy.sharing and not io.cozy.files. Same for cozy/cozy-libs#2805 ?
About documentation, shared drives are still a work in progress on back side, so doctype documentation can be incomplete. But it will need to be completed.
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.
the request with driveId
will send to this API sharings/drives/:driveId/downloads?Id=...&Filename=...
and it's not working at this moment. This is the error
{
"errors": [
{
"status": "422",
"title": "Invalid Attribute",
"detail": "Invalid document type",
"source": {
"pointer": "/data/attributes/type"
}
}
]
}
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.
It seems that we have driveId on files https://github.com/cozy/cozy-stack/pull/4511/files & cozy/cozy-client#1604
So yeah doctype documentation needs to be updated once the stack PR is merged.
and yes sharings/drives/:driveId/downloads?
seems to not have been implemented yet https://github.com/cozy/cozy-stack/pull/4511/files#diff-4ade94bc84a0d258576e850dcc6d9a18a5be2781ddb37103a3b2e910a550cf6fR322
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.
Oh you are right. @taratatach is it possible implement this route also to download versions of a file ?
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.
This route has been implemented in cozy/cozy-stack@4e4c45e. Do you need something else?
bace81c
to
add44da
Compare
add44da
to
6e46ebc
Compare
🎉 This PR is included in version 127.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
be careful here I think we need an upgrade of cozy-client/cozy-stack-client because the API of |
I've tested the download and get shared drive actions, both of them work as normal for 2 cases without |
You have a valid point; the dependencies should be updated accordingly next time. The cozy-client changes were merged here: cozy/cozy-client#1623 And in this PR, we should've updated the |
I think you tested it with the version of the app of cozy-client, not of the cozy-ui lib :) |
No description provided.