Skip to content
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

Integration with Frappe Drive for file uploads #503

Open
nikkothari22 opened this issue Oct 22, 2023 · 7 comments
Open

Integration with Frappe Drive for file uploads #503

nikkothari22 opened this issue Oct 22, 2023 · 7 comments
Labels
✨ Feature Created by Linear-GitHub Sync FOSSHack

Comments

@nikkothari22
Copy link
Member

Allow users to quickly select a file from Frappe Drive and share it on Raven. This should be a link to the File instead of another link (and hence a copy of the original file).

@jcgurango
Copy link

Hello @nikkothari22 I'm currently working on a solution that integrates the two. Will this part only be started once Frappe Drive is out of beta?

@nikkothari22
Copy link
Member Author

Hello @nikkothari22 I'm currently working on a solution that integrates the two. Will this part only be started once Frappe Drive is out of beta?

Hey @jcgurango - we haven't tried Frappe Drive yet so we don't know how the integration should/would work. From what I understand, the frontend would change to allow for selecting files from Frappe Drive instead of uploading them. Are you working on an integration of Frappe Drive with Raven? if yes, we can discuss here and we can merge once it's ready.

@jcgurango
Copy link

jcgurango commented Oct 23, 2023

Hello @nikkothari22 I'm currently working on a solution that integrates the two. Will this part only be started once Frappe Drive is out of beta?

Hey @jcgurango - we haven't tried Frappe Drive yet so we don't know how the integration should/would work. From what I understand, the frontend would change to allow for selecting files from Frappe Drive instead of uploading them. Are you working on an integration of Frappe Drive with Raven? if yes, we can discuss here and we can merge once it's ready.

Indeed I am working on this integration, though Frappe Drive has no hooks for its authentication mechanisms so I'm not totally sure how best to allow raven users access to a drive file. For the mostpart, Frappe Drive only allows access to view its files by either the owner/creator of the file or via its own DocType called "Drive DocShare" which links with a User or a User Group. So, I think there's a few possible approaches.

  1. The most straightforward approach would be to allow this Drive DocShare DocType to take Raven Channels into account so that when sharing a file into a DM or channel it would automatically share it to that channel as well. However, this would require some coordination with the Frappe Drive developers so maybe @uhrjun should be included for this.
  2. We could also automatically make shared Drive Entities public, but this presents a problem of security since anyone with the link to the file could just view it.
  3. We could sync the channel members with the Drive Entity (i.e. file/folder) automatically, though this could be particularly error prone.

EDIT: Also, a nice to have feature here would be something similar to Lark Suite, where when sending files you also have a dropdown for permissions within the chat, so you could easily update the permissions from edit to view directly in the chat window.

@nikkothari22
Copy link
Member Author

nikkothari22 commented Oct 23, 2023

I would suggest we build the easiest part first - which is simply linking a document to a Raven Message.

In our ERPNext integrations, we will be adding a Dynamic Link that would allow a Raven Message to be linked to any other doctype. We could use that and render accordingly - so if a message is linked to a FDrive doc - we can render it differently in our chat screen (not relying on the File URL link field). Second, we can allow users to upload files from Raven - wherein they can share documents from FDrive. They can send it on any channel in Raven. If users do not have access, they would have to ask the person to change the permissions for it or if there's an API in FDrive to request access (similar to Google Docs), we can render a button "Request Access" on our chat screen with the message.

Regarding sharing of files - this is a little tricky since we would have to add an interface on FDrive to be able to share to a channel on Raven. So we might take this up later.

Since FDrive is in beta, the APIs (for requesting access, sharing, listing available files, checking if a file is accessible) might change and building a direct integration would take time.

@nikkothari22
Copy link
Member Author

Also, we're currently in the process of changing our Message renderer to Tiptap - that would allow us to embed blocks in between messages. We're also changing the API to fetch messages (adding pagination and infinite scroll) - so things would change a lot in the next 15 days.

@jcgurango
Copy link

Ah that's good to hear. Okay, that sounds like a good plan to start with just being able to render it. Is there any work already done towards the Dynamic Link? On my fork of Raven I have already actually added some fields that does this (A new message type called "Entity", a Link field to doctype called "Entity Type", a Dynamic Link field called "Entity Name"), so would be nice if I could keep it in sync with the upstream and just hook into the custom rendering part for my own DocTypes.

@nikkothari22
Copy link
Member Author

Ah that's good to hear. Okay, that sounds like a good plan to start with just being able to render it. Is there any work already done towards the Dynamic Link? On my fork of Raven I have already actually added some fields that does this (A new message type called "Entity", a Link field to doctype called "Entity Type", a Dynamic Link field called "Entity Name"), so would be nice if I could keep it in sync with the upstream and just hook into the custom rendering part for my own DocTypes.

Not yet started on that. Currently working on performance fixes and mobile app.

@nikkothari22 nikkothari22 added FOSSHack ✨ Feature Created by Linear-GitHub Sync labels Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Created by Linear-GitHub Sync FOSSHack
Development

No branches or pull requests

2 participants