Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(gatsby-source-drupal): added preview feature (#14630)
* added preview feature to drupal source module * Update README.md * added a more robust check for relationship data, empty arrays were causing errors in preview updates * Update README.md * reverted backticks in comments * refactor: don't spawn extra server, re-use node creation and relationship handling * there is no more preview config option * remove stray console.log * fix tests * mark as experimental * move webhook update handling to separate function to make it easier to test * add tests for updating function * add more notes about experimental state of preview feature * move utils to separate file - fixes exporting variable that is not gatsby API * normalize newline in gitignore
- Loading branch information
Grant Glidewell
authored and
GatsbyJS Bot
committed
Jul 8, 2019
1 parent
530e8da
commit a045a32
Showing
10 changed files
with
523 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/gatsby-node.js | ||
/normalize.js | ||
/utils.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/gatsby-source-drupal/src/__tests__/fixtures/webhook-insert.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"data": { | ||
"type": "node--article", | ||
"id": "article-4", | ||
"attributes": { | ||
"id": 24, | ||
"uuid": "article-4", | ||
"title": "Article #4", | ||
"body": "Praesent accumsan nisl nulla." | ||
}, | ||
"relationships": { | ||
"field_tags": { | ||
"data": [ | ||
{ | ||
"type": "taxonomy_term--tags", | ||
"id": "tag-1" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"links": {} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/gatsby-source-drupal/src/__tests__/fixtures/webhook-update.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"data": { | ||
"type": "node--article", | ||
"id": "article-3", | ||
"attributes": { | ||
"id": 23, | ||
"uuid": "article-3", | ||
"title": "Article #3 - Updated", | ||
"body": "Aliquam non varius libero, sit amet consequat ex. Aenean porta turpis quis vulputate blandit. Suspendisse in porta erat. Sed sit amet scelerisque turpis, at rutrum mauris. Sed tempor eleifend lobortis. Proin maximus, massa sed dignissim sollicitudin, quam risus mattis justo, sit amet aliquam odio ligula quis urna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut mollis leo nisi, at interdum urna fermentum ut. Fusce id suscipit neque, eu fermentum lacus. Donec egestas laoreet felis ac luctus. Vestibulum molestie mattis ante, a vulputate nunc ullamcorper at. Ut hendrerit ipsum eget gravida ultricies." | ||
}, | ||
"relationships": { | ||
"field_tags": { | ||
"data": [ | ||
{ | ||
"type": "taxonomy_term--tags", | ||
"id": "tag-2" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"links": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.