ClaudioZandonella / trackdown

R package for collaborative writing and editing of R Markdown (or Sweave) documents in Google Docs.
https://ClaudioZandonella.github.io/trackdown/
GNU General Public License v3.0
214 stars 15 forks source link

Google Team Drive / Google Drive shared drive functionality #14

Closed januz closed 3 years ago

januz commented 3 years ago

I finally got around to testing the Team Drive (now renamed to Google Drive shared drive, see the other issue I opened) functionality.

It almost worked but there was one problem: get_root_dribble() always returned the root folder of "My Drive", even if a team_drive was specified. Furthermore, even after fixing this issue, the current implementation defaulted to data.frame(id = "root") if there were no files found which again resulted in "My Drive" being used if a team_drive was specified but it did not contain any files.

I rewrote and simplified the function (see the feature branch shared-drive) by directly getting a dribble for the root folder using drive_get() and team_drive_get(), respectively. Were there any specific reasons why you used drive_find that will make my solution fail in specific situations?

I created a new shared drive trackdown-shared-drive and shared it with the trackdown.rpackage@gmail.com user you created to test trackdown. So you should now all be able to test trackdown with shared drives. Please let me know whether you run into problems. Relatedly, I wanted to log into the trackdown.rpackage Google account but dual authentification is set up, so I would need either the account holders recovery email address or phone number.

ClaudioZandonella commented 3 years ago

Thanks @januz great improvements! I didn't know that it was possible to get the root dribble id specifying "~/" as argument of googledrive::drive_get() function. I should have read better the documentation😅... Before I used the inefficient trick of checking elements in the root folder and get the id of the root from there, but it was a long roundabout and there was the problem if no element was present in the root. Now it is much better! Thanks.

I will check other functions as well as now I guess it is possible to simplify few other passages.

I also removed authentication checks from the trackdown.rpackage so now there should be no more problems!

ClaudioZandonella commented 3 years ago

Thanks @januz for all your work! I used the shared drive feature and everything works perfectly. I also updated all the documentation according to your suggestions. I merged all changes into the develop branch and now I have merged the develop branch into the master branch. So everything should be updated now...

Let me know if we can close this issue and delete the shared-drive branch.