convert some service classes to static fields, run [GitHubForks GitHubGoMod GitHubIssueDetail GitHubIssues GitHubLabels GitHubLanguageCount GitHubLastCommit] (#5590)

* refactor(githubforks): convert to static fields

* refactor(githubgomod): convert to static fields

* refactor(githubissuedetail): convert to static fields

* refactor(githubissues): convert to static fields

* refactor(githublabels): convert to static fields

* refactor(githublanguagecount): convert to static fields

* refactor(githublastcommit): convert to static fields

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
This commit is contained in:
Caleb Cartwright
2020-09-22 18:18:54 -05:00
committed by GitHub
parent 484c652719
commit ec5b976c0d
7 changed files with 343 additions and 434 deletions

View File

@@ -16,49 +16,33 @@ const schema = Joi.object({
}).required()
module.exports = class GithubForks extends GithubAuthV4Service {
static get category() {
return 'social'
}
static get route() {
return {
base: 'github/forks',
pattern: ':user/:repo',
}
}
static get examples() {
return [
{
title: 'GitHub forks',
namedParams: {
user: 'badges',
repo: 'shields',
},
// TODO: This is currently a literal, as `staticPreview` doesn't
// support `link`.
staticPreview: {
label: 'Fork',
message: '150',
style: 'social',
},
// staticPreview: {
// ...this.render({ user: 'badges', repo: 'shields', forkCount: 150 }),
// label: 'fork',
// style: 'social',
// },
queryParams: { label: 'Fork' },
documentation,
static category = 'social'
static route = { base: 'github/forks', pattern: ':user/:repo' }
static examples = [
{
title: 'GitHub forks',
namedParams: {
user: 'badges',
repo: 'shields',
},
]
}
// TODO: This is currently a literal, as `staticPreview` doesn't
// support `link`.
staticPreview: {
label: 'Fork',
message: '150',
style: 'social',
},
// staticPreview: {
// ...this.render({ user: 'badges', repo: 'shields', forkCount: 150 }),
// label: 'fork',
// style: 'social',
// },
queryParams: { label: 'Fork' },
documentation,
},
]
static get defaultBadgeData() {
return {
label: 'forks',
namedLogo: 'github',
}
}
static defaultBadgeData = { label: 'forks', namedLogo: 'github' }
static render({ user, repo, forkCount }) {
return {