-
Notifications
You must be signed in to change notification settings - Fork 5
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
add westeros houses example using google sheets #33
add westeros houses example using google sheets #33
Conversation
… add/google-sheets-westeros-houses-example
example/google-sheets/westeros-houses/inc/queries/class-get-westeros-houses-query.php
Outdated
Show resolved
Hide resolved
The google auth logic was located in inc/config/auth dir. The /inc/integrations dir seems more appropriate for this as it won't just contains configs.
726940b
to
85090a7
Compare
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.
Cool stuff! Didn't test, but, code makes sense.
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.
Tested, looks good. But I am concerned about all the fantasy content in these examples 😂
wp_cache_set( | ||
$cache_key, | ||
$token, | ||
'oauth-tokens', | ||
3000, // 50 minutes | ||
); |
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.
@chriszarate @mhsdef I am wondering if we should encrypt this token before writing to cache ? We do encrypt the data source config when we store it in options table, but that is persistent as opposed to this which has TTL of 50mins for now.
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.
Ideally, yeah. We could do what we're doing with the DB option if there's a hook that fires in the cache set. I didn't see one, in brief perusing, but maybe I missed it.
Otherwise, could invoke our encryption code manually to handle.
Description
This PR adds an example block for Google Sheets. Google Sheets like Airtable and unlike Shopify doesn't have a static schema for the data. So this example is just one example and the schema would be different for each Google Sheet. The example used here is a sheet containing the list of houses of Westeros with the columns as "Name", "Seat", "Region", "Words" and "Sigil". The 2 blocks added are:
Testing
Google Sheets and Google API Access Setup
resourcemanager.projects.create
permission is needed to create a new project. Skip this step if you already have a project setup in your organization in Google Cloud Platform.REMOTE_DATA_BLOCKS_EXAMPLE_GOOGLE_SHEETS_WESTEROS_HOUSES_ACCESS_TOKEN"
key in the.wp-env.override.json
file.Trying out the block
npm run monolith
http://localhost:8888/wp-admin
Screenshots