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:
@@ -15,37 +15,25 @@ const schema = Joi.array()
|
||||
.required()
|
||||
|
||||
module.exports = class GithubCommitActivity extends GithubAuthV3Service {
|
||||
static get category() {
|
||||
return 'activity'
|
||||
static category = 'activity'
|
||||
static route = {
|
||||
base: 'github/commit-activity',
|
||||
pattern: ':interval(y|m|4w|w)/:user/:repo',
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'github/commit-activity',
|
||||
pattern: ':interval(y|m|4w|w)/:user/:repo',
|
||||
}
|
||||
}
|
||||
static examples = [
|
||||
{
|
||||
title: 'GitHub commit activity',
|
||||
// Override the pattern to omit the deprecated interval "4w".
|
||||
pattern: ':interval(y|m|w)/:user/:repo',
|
||||
namedParams: { interval: 'm', user: 'eslint', repo: 'eslint' },
|
||||
staticPreview: this.render({ interval: 'm', commitCount: 457 }),
|
||||
keywords: ['commits'],
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'GitHub commit activity',
|
||||
// Override the pattern to omit the deprecated interval "4w".
|
||||
pattern: ':interval(y|m|w)/:user/:repo',
|
||||
namedParams: { interval: 'm', user: 'eslint', repo: 'eslint' },
|
||||
staticPreview: this.render({ interval: 'm', commitCount: 457 }),
|
||||
keywords: ['commits'],
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'commit activity',
|
||||
color: 'blue',
|
||||
}
|
||||
}
|
||||
static defaultBadgeData = { label: 'commit activity', color: 'blue' }
|
||||
|
||||
static render({ interval, commitCount }) {
|
||||
const intervalLabel = {
|
||||
|
||||
Reference in New Issue
Block a user