refactor(github): convert some clasess to static fields (#5556)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Caleb Cartwright
2020-09-20 15:17:22 -05:00
committed by GitHub
parent 7712d26897
commit fa608e29d3
4 changed files with 68 additions and 111 deletions

View File

@@ -11,42 +11,31 @@ const schema = Joi.object({
}).required()
module.exports = class GithubCommitStatus extends GithubAuthV3Service {
static get category() {
return 'issue-tracking'
static category = 'issue-tracking'
static route = {
base: 'github/commit-status',
pattern: ':user/:repo/:branch/:commit',
}
static get route() {
return {
base: 'github/commit-status',
pattern: ':user/:repo/:branch/:commit',
}
}
static get examples() {
return [
{
title: 'GitHub commit merge status',
namedParams: {
user: 'badges',
repo: 'shields',
branch: 'master',
commit: '5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c',
},
staticPreview: this.render({
isInBranch: true,
branch: 'master',
}),
keywords: ['branch'],
documentation,
static examples = [
{
title: 'GitHub commit merge status',
namedParams: {
user: 'badges',
repo: 'shields',
branch: 'master',
commit: '5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c',
},
]
}
staticPreview: this.render({
isInBranch: true,
branch: 'master',
}),
keywords: ['branch'],
documentation,
},
]
static get defaultBadgeData() {
return {
label: 'commit status',
}
}
static defaultBadgeData = { label: 'commit status' }
static render({ isInBranch, branch }) {
if (isInBranch) {