mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44:04 +03:00
Cleanup unused bits and pieces (#10349)
This commit is contained in:
parent
dfc5a36817
commit
1585d157c1
@ -175,7 +175,7 @@ export default class DockerVersion extends BaseJsonService {
|
||||
})
|
||||
}
|
||||
|
||||
const { version } = await this.transform({
|
||||
const { version } = this.transform({
|
||||
tag,
|
||||
sort,
|
||||
data,
|
||||
|
@ -130,7 +130,7 @@ export default class GithubDeployments extends GithubAuthV4Service {
|
||||
return { state }
|
||||
}
|
||||
|
||||
async handle({ user, repo, environment }, queryParams) {
|
||||
async handle({ user, repo, environment }) {
|
||||
const json = await this.fetch({ user, repo, environment })
|
||||
const { state } = this.transform({ data: json.data })
|
||||
return this.constructor.render({ state })
|
||||
|
@ -49,7 +49,7 @@ export default class GithubMilestoneDetail extends GithubAuthV3Service {
|
||||
|
||||
static defaultBadgeData = { label: 'milestones', color: 'informational' }
|
||||
|
||||
static render({ user, repo, variant, number, milestone }) {
|
||||
static render({ variant, milestone }) {
|
||||
let milestoneMetric
|
||||
let color
|
||||
let label = ''
|
||||
@ -102,6 +102,6 @@ export default class GithubMilestoneDetail extends GithubAuthV3Service {
|
||||
|
||||
async handle({ user, repo, variant, number }) {
|
||||
const milestone = await this.fetch({ user, repo, number })
|
||||
return this.constructor.render({ user, repo, variant, number, milestone })
|
||||
return this.constructor.render({ variant, milestone })
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ export default class GithubMilestone extends GithubAuthV3Service {
|
||||
color: 'informational',
|
||||
}
|
||||
|
||||
static render({ user, repo, variant, milestones }) {
|
||||
static render({ variant, milestones }) {
|
||||
const milestoneLength = milestones.length
|
||||
let color
|
||||
let qualifier = ''
|
||||
@ -84,6 +84,6 @@ export default class GithubMilestone extends GithubAuthV3Service {
|
||||
|
||||
async handle({ user, repo, variant }) {
|
||||
const milestones = await this.fetch({ user, repo, variant })
|
||||
return this.constructor.render({ user, repo, variant, milestones })
|
||||
return this.constructor.render({ variant, milestones })
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ export default class Netlify extends BaseSvgScrapingService {
|
||||
return result
|
||||
}
|
||||
|
||||
async fetch({ projectId, branch }) {
|
||||
async fetch({ projectId }) {
|
||||
const url = `https://api.netlify.com/api/v1/badges/${projectId}/deploy-status`
|
||||
const { buffer } = await this._request({
|
||||
url,
|
||||
@ -61,8 +61,8 @@ export default class Netlify extends BaseSvgScrapingService {
|
||||
return { message: 'unknown' }
|
||||
}
|
||||
|
||||
async handle({ projectId, branch }) {
|
||||
const { message: status } = await this.fetch({ projectId, branch })
|
||||
async handle({ projectId }) {
|
||||
const { message: status } = await this.fetch({ projectId })
|
||||
return this.constructor.render({ status })
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ const isBuildStatus = Joi.alternatives().try(
|
||||
Joi.equal(...Object.keys(localStatuses)),
|
||||
)
|
||||
|
||||
function renderBuildStatusBadge({ repository, status }) {
|
||||
function renderBuildStatusBadge({ status }) {
|
||||
const color = localStatuses[status]
|
||||
if (color) {
|
||||
return {
|
||||
|
@ -45,8 +45,8 @@ export default class ObsService extends BaseXmlService {
|
||||
|
||||
static defaultBadgeData = { label: 'build' }
|
||||
|
||||
static render({ repository, status }) {
|
||||
return renderBuildStatusBadge({ repository, status })
|
||||
static render({ status }) {
|
||||
return renderBuildStatusBadge({ status })
|
||||
}
|
||||
|
||||
async fetch({ instance, project, packageName, repository, arch }) {
|
||||
@ -73,7 +73,6 @@ export default class ObsService extends BaseXmlService {
|
||||
arch,
|
||||
})
|
||||
return this.constructor.render({
|
||||
repository,
|
||||
status: resp.status['@_code'],
|
||||
})
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ function LastUpdateForType(extensionType) {
|
||||
slug,
|
||||
})
|
||||
|
||||
const newDate = await this.transform(lastUpdated)
|
||||
const newDate = this.transform(lastUpdated)
|
||||
|
||||
return this.constructor.render({
|
||||
lastUpdated: newDate,
|
||||
|
Loading…
x
Reference in New Issue
Block a user