diff --git a/.all-contributorsrc b/.all-contributorsrc
index 0d4101a..be61bed 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -362,6 +362,15 @@
"bug",
"code"
]
+ },
+ {
+ "login": "MarceloAlves",
+ "name": "Marcelo Alves",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/216782?v=4",
+ "profile": "https://github.com/marceloalves",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --git a/README.md b/README.md
index e6210cf..f42f036 100644
--- a/README.md
+++ b/README.md
@@ -128,6 +128,7 @@ Thanks goes to these wonderful people
Fabrizio 🐛 💻 |
+ Marcelo Alves 💻 |
diff --git a/src/generate/__tests__/format-contribution-type.js b/src/generate/__tests__/format-contribution-type.js
index a7317af..11bff89 100644
--- a/src/generate/__tests__/format-contribution-type.js
+++ b/src/generate/__tests__/format-contribution-type.js
@@ -50,6 +50,15 @@ test('return link to issues', () => {
expect(formatContributionType(options, contributor, 'bug')).toBe(expected)
})
+test('return link to reviews', () => {
+ const contributor = contributors.kentcdodds
+ const {options} = fixtures()
+ const expected =
+ '👀'
+
+ expect(formatContributionType(options, contributor, 'review')).toBe(expected)
+})
+
test('make any symbol into a link if contribution is an object', () => {
const contributor = contributors.kentcdodds
const {options} = fixtures()
diff --git a/src/generate/__tests__/format-contributor.js b/src/generate/__tests__/format-contributor.js
index b8feece..8ed7564 100644
--- a/src/generate/__tests__/format-contributor.js
+++ b/src/generate/__tests__/format-contributor.js
@@ -20,7 +20,7 @@ test('format a simple contributor', () => {
const {options} = fixtures()
const expected =
- '
Kent C. Dodds
👀'
+ '
Kent C. Dodds
👀'
expect(formatContributor(options, contributor)).toBe(expected)
})
@@ -30,7 +30,7 @@ test('format contributor with complex contribution types', () => {
const {options} = fixtures()
const expected =
- '
Kent C. Dodds
📖 👀 💬'
+ '
Kent C. Dodds
📖 👀 💬'
expect(formatContributor(options, contributor)).toBe(expected)
})
@@ -53,7 +53,7 @@ test('default image size to 100', () => {
delete options.imageSize
const expected =
- '
Kent C. Dodds
👀'
+ '
Kent C. Dodds
👀'
expect(formatContributor(options, contributor)).toBe(expected)
})
diff --git a/src/repo/index.js b/src/repo/index.js
index ac3196c..808d70b 100644
--- a/src/repo/index.js
+++ b/src/repo/index.js
@@ -12,6 +12,8 @@ const SUPPORTED_REPO_TYPES = {
'<%= options.repoHost || "https://github.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/commits?author=<%= contributor.login %>',
linkToIssues:
'<%= options.repoHost || "https://github.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/issues?q=author%3A<%= contributor.login %>',
+ linkToReviews:
+ '<%= options.repoHost || "https://github.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/pulls?q=is%3Apr+reviewed-by%3A<%= contributor.login %>',
getUserInfo: githubAPI.getUserInfo,
getContributors: githubAPI.getContributors,
},
@@ -24,6 +26,8 @@ const SUPPORTED_REPO_TYPES = {
'<%= options.repoHost || "https://gitlab.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/commits/master',
linkToIssues:
'<%= options.repoHost || "https://gitlab.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/issues?author_username=<%= contributor.login %>',
+ linkToReviews:
+ '<%= options.repoHost || "https://gitlab.com" %>/<%= options.projectOwner %>/<%= options.projectName %>/merge_requests?scope=all&state=all&approver_usernames[]=<%= contributor.login %>',
getUserInfo: gitlabAPI.getUserInfo,
getContributors: gitlabAPI.getContributors,
},
@@ -77,6 +81,13 @@ const getLinkToIssues = function(repoType) {
return null
}
+const getLinkToReviews = function(repoType) {
+ if (repoType in SUPPORTED_REPO_TYPES) {
+ return SUPPORTED_REPO_TYPES[repoType].linkToReviews
+ }
+ return null
+}
+
const getUserInfo = function(username, repoType, repoHost) {
if (repoType in SUPPORTED_REPO_TYPES) {
return SUPPORTED_REPO_TYPES[repoType].getUserInfo(
@@ -107,6 +118,7 @@ module.exports = {
getTypeName,
getLinkToCommits,
getLinkToIssues,
+ getLinkToReviews,
getUserInfo,
getContributors,
}
diff --git a/src/util/contribution-types.js b/src/util/contribution-types.js
index 8d792c1..dbb2257 100644
--- a/src/util/contribution-types.js
+++ b/src/util/contribution-types.js
@@ -81,6 +81,7 @@ const defaultTypes = function(repoType) {
review: {
symbol: '👀',
description: 'Reviewed Pull Requests',
+ link: repo.getLinkToReviews(repoType),
},
security: {
symbol: '🛡️',