-
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 #258 from WPMedia/AIO-322
AJC updates AIO-322
- Loading branch information
Showing
44 changed files
with
1,831 additions
and
1,208 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,16 @@ | ||
--- | ||
'@wpmedia/feeds-source-collections-block': minor | ||
'@wpmedia/feeds-source-content-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 | ||
--- | ||
|
||
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,28 @@ | ||
name: A job to push technical docs to Arc | ||
on: | ||
push: | ||
branches: | ||
- prod | ||
|
||
jobs: | ||
md_to_alc_job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: getfiles | ||
uses: lots0logs/gh-action-get-changed-files@2.1.4 | ||
with: | ||
token: ${{ secrets.GIT_TOKEN }} | ||
- name: Checkout private repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: WPMedia/md_to_alc_action | ||
token: ${{ secrets.GIT_TOKEN }} | ||
- id: send-markdown | ||
uses: ./ | ||
with: | ||
arcToken: ${{ secrets.ARC_TOKEN }} | ||
repoToken: ${{ secrets.GIT_TOKEN }} | ||
docPath: documentation/ | ||
changedFiles: ${{ steps.getfiles.outputs.modified }} | ||
repoName: ${{ github.event.repository.name }} | ||
|
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.0.0", | ||
"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" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
blocks/feeds-source-collections-block/sources/__snapshots__/collections.test.js.snap
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,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns query by alias 1`] = `"content/v4/collections?content_alias=sports page&from=5&size=10&published=true"`; | ||
|
||
exports[`returns query search by _id 1`] = `"content/v4/collections?_id=NBXKZJC3ONEGRB2VPINBMQTNFA&published=true"`; |
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, | ||
} |
32 changes: 32 additions & 0 deletions
32
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,32 @@ | ||
// 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).toMatchSnapshot() | ||
}) | ||
|
||
it('returns query by alias', () => { | ||
const query = resolver.default.resolve({ | ||
_id: '', | ||
content_alias: 'sports page', | ||
from: '5', | ||
size: '10', | ||
}) | ||
expect(query).toMatchSnapshot() | ||
}) |
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
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.