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

Google Drive integration #34

Closed
ILIYANGERMANOV opened this issue Nov 6, 2021 · 26 comments
Closed

Google Drive integration #34

ILIYANGERMANOV opened this issue Nov 6, 2021 · 26 comments
Assignees
Labels
devexp Codebase & dev experience help wanted Help us! Appreciated

Comments

@ILIYANGERMANOV
Copy link
Collaborator

ILIYANGERMANOV commented Nov 6, 2021

Google Drive integration is crucial for two things:

Goal

  • create "Ivy Wallet" folder in user's Google Drive
  • create "Ivy Wallet/attachments" directory for uploading attachments (receipts, invoices, etc

Success Criteria

  • create :google-drive module
  • implement GoogleDrive interface supporting:
    • creating & writing files
    • reading files
    • deleting files
  • your Google Drive abstraction can accomplish the things from Goal
@ILIYANGERMANOV ILIYANGERMANOV added important devexp Codebase & dev experience labels Nov 6, 2021
@ILIYANGERMANOV ILIYANGERMANOV self-assigned this Nov 6, 2021
@ILIYANGERMANOV ILIYANGERMANOV added the help wanted Help us! Appreciated label Nov 9, 2021
@MohitMandalia
Copy link
Contributor

for this feature did you configure the app to use the Drive API?
if not please include the same

@ILIYANGERMANOV
Copy link
Collaborator Author

Hi @MohitMandalia can't we implement it in a way where each user can backup in their own personal GDrive? This way we won't need centralized Ivy configuration, right?

@MohitMandalia
Copy link
Contributor

yes correct I am currently looking into what ways can be implemented for drive integration.

and I can see you already have attachment URL in the transaction data class so I think it is not in use currently because i dont see any way to attach a file when adding a trancastion.

Please correct me if I am wrong.

@MohitMandalia
Copy link
Contributor

Hi @MohitMandalia can't we implement it in a way where each user can backup in their own personal GDrive? This way we won't need centralized Ivy configuration, right?

I am also checking on the same.

@MohitMandalia
Copy link
Contributor

So regarding this I have made few changes so when we open Activity for result for the flag open document we get option to upload from storage or drive so I think that works if user has allowed files to be shared from drive.

Does this sound good for the attachment part?

@ILIYANGERMANOV
Copy link
Collaborator Author

Hi, @MohitMandalia that sounds good! My only concern is that the user might choose the wrong Google Drive folder for their attachment. And btw, great research :)

Q: Is possible to upload via code (w/o stating an Activity) using Google Drive's API?

@MohitMandalia
Copy link
Contributor

let me get something clear here this is not related to user saving a backup. This is just the first case where for each transactions user will select a file and attach it to the transaction itself. What exactly is in your mind can you elaborate both behaviours?

@MohitMandalia
Copy link
Contributor

Hi, @MohitMandalia that sounds good! My only concern is that the user might choose the wrong Google Drive folder for their attachment. And btw, great research :)

Q: Is possible to upload via code (w/o stating an Activity) using Google Drive's API?

I think you are referring to backup here.

@ILIYANGERMANOV
Copy link
Collaborator Author

Yes, I was referring the backup. But your proposal for attaching images to transactions is perfect! Feel free to proceed with it 🚀

@MohitMandalia
Copy link
Contributor

okk for backup I think how I would do is to let user select a folder once and in that we can take backups and for that will also check your question about not opening activity that may be possible but need to explore few details about it. For now I have just tried the attachment thing. will get back to you on the backup part.

@ILIYANGERMANOV
Copy link
Collaborator Author

Perfect, thank you @MohitMandalia!

@MohitMandalia
Copy link
Contributor

MohitMandalia commented Apr 12, 2022

Had one question @ILIYANGERMANOV how do you want to handle permissions? because we need to ask for the read external storage permission to the user

So what do you propose should we do it on setting up the app or at the time of edit transaction screen?

@ILIYANGERMANOV
Copy link
Collaborator Author

@MohitMandalia ask for permission after the user clicks the button for attaching/uploading image. We don't need to ask for a permission before we actually need it. Does that answer your question?

@MohitMandalia
Copy link
Contributor

@MohitMandalia ask for permission after the user clicks the button for attaching/uploading image. We don't need to ask for a permission before we actually need it. Does that answer your question?

Yes Thanks as we need to show the attachment filename and we are not saving that name to the transaction table we need to fetch that when Edit transaction screen is initiated let me know your thoughts.

@ILIYANGERMANOV
Copy link
Collaborator Author

@MohitMandalia can't we simply generate UUID and use it for attachment name?

Algorithm:

  1. Generate UUID
  2. Save the attachment with this UUID as name
  3. Set attachmentUrl

I don't understand why do we need attachment name in transaction's table?

@MohitMandalia
Copy link
Contributor

Since we dont have a UI for attachment I made one which looks like this :

No need to save the name but to get name as a user edits it from the URI we need permission if user has not provided it on initiating the screen.

Please suggest if any alternative was is there or if any change in the screen.

@ILIYANGERMANOV
Copy link
Collaborator Author

Hi @MohitMandalia your UI is good. I'd suggest:

  1. If the attachment is an image to display the image as a picture using Glide.

  2. The same applies for videos, if possible? There must be a library for displaying videos.

  3. If it's a file: when clicked you should be able to open it.

And thanks for your work! Great job, it would be a killer feature 🚀

@MohitMandalia
Copy link
Contributor

sure I will check on it but my concern was just asking permission on load of edit transaction instead of on click because if user opens existing transaction he would need permission to see the attachment. what do you suggest for this.

and this feature will take a bit longer as there is a lot of work involved let me know if that's okay

@ILIYANGERMANOV
Copy link
Collaborator Author

I understand now. Well, let's make it as simple as possible for version 1 of the feature then. We can always improve it later.

It is mandatory that if you click the attachment you should be able to see it. When in doubt about the right UI/UX decision just imagine what you'd like best as an user.

Ask yourself what the ideal would do in that situation :)

@MohitMandalia
Copy link
Contributor

Yes I was gonna make it such that we can see the attachment my only concern was permission.

Ui was not a doubt actually because as you said had thought as a user to give best UI experience to the user.

@MMannanAkmal
Copy link

Hi @MohitMandalia @ILIYANGERMANOV, are we done implementing this? If not, I would like to join you guys in completing the feature. Guessing from the thread, @MohitMandalia is working on the Issue #6. I can work on #35. Please let me know what you guys think.

@ILIYANGERMANOV
Copy link
Collaborator Author

Hi @MMannanAkmal, nope. And we really need it! It's critical. We need a new :google-drive module with simple GoogleDrive interface having write, read, delete files methods.

Haven't heard from @MohitMandalia either so feel free to work on it 👍

@MohitMandalia
Copy link
Contributor

I wanted but couldn't complete it yet please feel free to pick it up. Sorry man @ILIYANGERMANOV

@ILIYANGERMANOV
Copy link
Collaborator Author

No worries @MohitMandalia 👍 Thanks for participating and helping us!

@MohitMandalia
Copy link
Contributor

MohitMandalia commented Oct 3, 2022

If @MMannanAkmal couldn't complete it i would like to pick it up again or would love to do it with @MMannanAkmal , at the same time wouldn't wanna block this on me as I was not very active lately. Thanks

@ILIYANGERMANOV
Copy link
Collaborator Author

We managed to complete a fully-working prototype of the Google Drive integration! 🎊 🎆 Special thanks to @MohitMandalia and @CyberSirius for making it possible 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp Codebase & dev experience help wanted Help us! Appreciated
Projects
Status: Done
Development

No branches or pull requests

3 participants