-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix!: switch google drive picker to gis #23096
Conversation
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.
Thanks a lot for the fix! Apart from the suggestions above, this seems to work fine.
People migrating from the old setup will have to generate a new OAuth Client Key as well as a new API key.
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
@TMF42 sorry for the delay, I'm pretty busy at the moment. If anybody else can review this, please do! |
@TMF42 will this fix the authentication error currently facing in the google drive picker? reference: https://discuss.frappe.io/t/google-drive-picker/102950 |
@fadilsiddique yes. that's the fix for the problem you referenced. |
Thanks. Facing the issue currently. I have asked in the TG group to check this PR. |
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 very happy with the code. Could definitely use a refactor. But it works fine, so I'm inclined to get this merged for the time being.
Todo:
- Remove unused properties (
this.pickerInited
,this.gisInited
) -
ReplaceNo need to store this at all.this.accessToken
withfrappe.boot.user.google_drive_token
. No need to store this in two places. - Currently, the auth popup shows every time. Can we avoid this, if we already have an active token?
It's one-time use anyway.
@shariquerik this PR is ready. I have tested the functionality. If the code looks okay, kindly merge. |
* fix: switch google drive picker to gis * fix: switch google drive picker to gis (linting) * fix: switch google drive picker to gis (prettier) * fix: remove restrictions on file types Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: show navigator Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: no multiselect for files Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * refactor: get rid of jquery * fix: don't add script twice * refactor: remove unused properties * refactor: store access token in one place only * refactor: make tokenClient a local constant * fix: set locale * refactor: async calls * fix: don't store access token It's one-time use anyway. * fix: scope for allowing file upload * reafctor: rename libsLoaded() to autthenticate() --------- Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> (cherry picked from commit 043c004)
* fix: switch google drive picker to gis * fix: switch google drive picker to gis (linting) * fix: switch google drive picker to gis (prettier) * fix: remove restrictions on file types Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: show navigator Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: no multiselect for files Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * refactor: get rid of jquery * fix: don't add script twice * refactor: remove unused properties * refactor: store access token in one place only * refactor: make tokenClient a local constant * fix: set locale * refactor: async calls * fix: don't store access token It's one-time use anyway. * fix: scope for allowing file upload * reafctor: rename libsLoaded() to autthenticate() --------- Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> (cherry picked from commit 043c004)
* fix: switch google drive picker to gis * fix: switch google drive picker to gis (linting) * fix: switch google drive picker to gis (prettier) * fix: remove restrictions on file types Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: show navigator Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: no multiselect for files Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * refactor: get rid of jquery * fix: don't add script twice * refactor: remove unused properties * refactor: store access token in one place only * refactor: make tokenClient a local constant * fix: set locale * refactor: async calls * fix: don't store access token It's one-time use anyway. * fix: scope for allowing file upload * reafctor: rename libsLoaded() to autthenticate() --------- Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> (cherry picked from commit 043c004) Co-authored-by: Thomas Fojan <thomas@tmf.one>
* fix: switch google drive picker to gis * fix: switch google drive picker to gis (linting) * fix: switch google drive picker to gis (prettier) * fix: remove restrictions on file types Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: show navigator Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * fix: no multiselect for files Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> * refactor: get rid of jquery * fix: don't add script twice * refactor: remove unused properties * refactor: store access token in one place only * refactor: make tokenClient a local constant * fix: set locale * refactor: async calls * fix: don't store access token It's one-time use anyway. * fix: scope for allowing file upload * reafctor: rename libsLoaded() to autthenticate() --------- Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> (cherry picked from commit 043c004) Co-authored-by: Thomas Fojan <thomas@tmf.one>
Original PR to integrate Google Drive Picker in file uploader -> #12715
Created by @barredterra
Meanwhile, Google deprecated the Google Sign-In library and new client IDs will be blocked -> see here
This PR deals with migrating the authentication part to Google Identity Services based on Google's suggestions -> see here
and based on the latest example for using the Google Picker API -> see here
Additional Notes: