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

@@ -23,48 +23,33 @@ const schema = Joi.array()
.required()
module.exports = class GithubLastCommit extends GithubAuthV3Service {
static get category() {
return 'activity'
}
static get route() {
return {
base: 'github/last-commit',
pattern: ':user/:repo/:branch*',
}
}
static get examples() {
return [
{
title: 'GitHub last commit',
pattern: ':user/:repo',
namedParams: {
user: 'google',
repo: 'skia',
},
staticPreview: this.render({ commitDate: '2013-07-31T20:01:41Z' }),
...commonExampleAttrs,
static category = 'activity'
static route = { base: 'github/last-commit', pattern: ':user/:repo/:branch*' }
static examples = [
{
title: 'GitHub last commit',
pattern: ':user/:repo',
namedParams: {
user: 'google',
repo: 'skia',
},
{
title: 'GitHub last commit (branch)',
pattern: ':user/:repo/:branch',
namedParams: {
user: 'google',
repo: 'skia',
branch: 'infra/config',
},
staticPreview: this.render({ commitDate: '2013-07-31T20:01:41Z' }),
...commonExampleAttrs,
staticPreview: this.render({ commitDate: '2013-07-31T20:01:41Z' }),
...commonExampleAttrs,
},
{
title: 'GitHub last commit (branch)',
pattern: ':user/:repo/:branch',
namedParams: {
user: 'google',
repo: 'skia',
branch: 'infra/config',
},
]
}
staticPreview: this.render({ commitDate: '2013-07-31T20:01:41Z' }),
...commonExampleAttrs,
},
]
static get defaultBadgeData() {
return {
label: 'last commit',
}
}
static defaultBadgeData = { label: 'last commit' }
static render({ commitDate }) {
return {