convert some service classes to static props, run [gem gerrit] (#5553)

* refactor(gem): convert to static props

* refactor(gerrit): convert to static props

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Caleb Cartwright
2020-09-18 17:28:24 -05:00
committed by GitHub
parent 6682b87efe
commit 737254f4a5
5 changed files with 111 additions and 177 deletions

View File

@@ -13,37 +13,23 @@ const schema = Joi.object({
}).required()
module.exports = class Gerrit extends BaseJsonService {
static get category() {
return 'issue-tracking'
}
static get route() {
return {
base: 'gerrit',
pattern: ':changeId',
queryParamSchema,
}
}
static get examples() {
return [
{
title: 'Gerrit change status',
namedParams: {
changeId: '1011478',
},
queryParams: { baseUrl: 'https://android-review.googlesource.com' },
staticPreview: this.render({
changeId: 1011478,
status: 'MERGED',
}),
static category = 'issue-tracking'
static route = { base: 'gerrit', pattern: ':changeId', queryParamSchema }
static examples = [
{
title: 'Gerrit change status',
namedParams: {
changeId: '1011478',
},
]
}
queryParams: { baseUrl: 'https://android-review.googlesource.com' },
staticPreview: this.render({
changeId: 1011478,
status: 'MERGED',
}),
},
]
static get defaultBadgeData() {
return { label: 'gerrit' }
}
static defaultBadgeData = { label: 'gerrit' }
static getColor({ displayStatus }) {
if (displayStatus === 'new') {