-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from WPMedia/AIO-322_prod
Aio 322 prod
- Loading branch information
Showing
58 changed files
with
500 additions
and
282 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@wpmedia/feeds-source-collections-block': minor | ||
'@wpmedia/feeds-source-content-api-block': minor | ||
'@wpmedia/feeds-source-video-api-block': minor | ||
'@wpmedia/mrss-feature-block': minor | ||
'@wpmedia/rss-fbia-feature-block': minor | ||
'@wpmedia/rss-feature-block': minor | ||
'@wpmedia/rss-flipboard-feature-block': minor | ||
'@wpmedia/rss-google-news-feature-block': minor | ||
'@wpmedia/rss-msn-feature-block': minor | ||
'@wpmedia/sitemap-feature-block': minor | ||
'@wpmedia/sitemap-index-feature-block': minor | ||
'@wpmedia/sitemap-news-feature-block': minor | ||
'@wpmedia/sitemap-video-feature-block': minor | ||
--- | ||
|
||
push AIO-322 stable tag |
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,13 @@ | ||
# @wpmedia/feeds-source-collections-block | ||
|
||
## 0.1.1 | ||
|
||
### Patch Changes | ||
|
||
- [`cb47744`](https://github.com/WPMedia/feed-components/commit/cb4774411a55198955ee7b524c498baff73e04f0) [#264](https://github.com/WPMedia/feed-components/pull/264) Thanks [@tbrick855](https://github.com/tbrick855)! - Update test to not use snapshot | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- [`9358763`](https://github.com/WPMedia/feed-components/commit/935876381a96ede3cebf9f72703c0d02c08952a5) [#258](https://github.com/WPMedia/feed-components/pull/258) Thanks [@tbrick855](https://github.com/tbrick855)! - add collections, check for nulls in title and description and make packages public |
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,18 @@ | ||
# Collections content source | ||
|
||
Searches for a collection by \_id or alias. Articles in a collection do not contain any content_elements. | ||
|
||
## Globals | ||
|
||
- CONTENT_BASE | ||
|
||
## Parameters | ||
|
||
- \_id: Collection \_id to search for | ||
- content_alias: Collection alias name to search for | ||
- from: number of rows to skip | ||
- size: number of rows to return | ||
|
||
### Usage | ||
|
||
The `/content/v4/collections` content-api endpoint is used |
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 @@ | ||
module.exports = {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
{ | ||
"name": "@wpmedia/feeds-source-collections-block", | ||
"version": "0.1.1", | ||
"description": "Content source to search for a collection", | ||
"main": "index.js", | ||
"files": [ | ||
"sources" | ||
], | ||
"license": "UNLICENSED", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/WPMedia/feed-components.git", | ||
"directory": "blocks/feeds-source-collections-block" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://npm.pkg.github.com/", | ||
"access": "public" | ||
}, | ||
"author": "Cameron Woodmansee", | ||
"contributors": [ | ||
"Iyob Beyene <iyob.beyene@washpost.com>", | ||
"Tim Kosmider <tim.kosmider@washpost.com>" | ||
], | ||
"homepage": "https://github.com/WPMedia/feed-components#readme", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"prop-types": "^15.7.2" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
blocks/feeds-source-collections-block/sources/collections.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const params = { | ||
_id: 'text', | ||
content_alias: 'text', | ||
from: 'text', | ||
size: 'text', | ||
} | ||
|
||
const resolve = (key = {}) => { | ||
const { 'arc-site': site, _id, content_alias: contentAlias, from, size } = key | ||
return `content/v4/collections?${ | ||
_id ? `_id=${_id}` : `content_alias=${contentAlias}` | ||
}${site ? `&website=${site}` : ''}${from ? `&from=${from}` : ''}${ | ||
size ? `&size=${size}` : '' | ||
}&published=true` | ||
} | ||
|
||
export default { | ||
params, | ||
resolve, | ||
} |
36 changes: 36 additions & 0 deletions
36
blocks/feeds-source-collections-block/sources/collections.test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
import Consumer from 'fusion:consumer' | ||
const resolver = require('./collections') | ||
|
||
it('validate params', () => { | ||
expect(resolver.default.params).toStrictEqual({ | ||
_id: 'text', | ||
content_alias: 'text', | ||
from: 'text', | ||
size: 'text', | ||
}) | ||
}) | ||
|
||
it('returns query search by _id', () => { | ||
const query = resolver.default.resolve({ | ||
_id: 'NBXKZJC3ONEGRB2VPINBMQTNFA', | ||
content_alias: '', | ||
from: '', | ||
size: '', | ||
}) | ||
expect(query).toBe( | ||
'content/v4/collections?_id=NBXKZJC3ONEGRB2VPINBMQTNFA&published=true', | ||
) | ||
}) | ||
|
||
it('returns query by alias', () => { | ||
const query = resolver.default.resolve({ | ||
_id: '', | ||
content_alias: 'sports page', | ||
from: '5', | ||
size: '10', | ||
}) | ||
expect(query).toBe( | ||
'content/v4/collections?content_alias=sports page&from=5&size=10&published=true', | ||
) | ||
}) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.