Skip to content

Commit

Permalink
change closed GitHub issue color to purple (#7374)
Browse files Browse the repository at this point in the history
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
  • Loading branch information
calebcartwright and repo-ranger[bot] authored Dec 18, 2021
1 parent 08c30f7 commit 24355a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions services/github/github-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const documentation = `
</p>
`

function stateColor(s) {
return { open: '2cbe4e', closed: 'cb2431', merged: '6f42c1' }[s]
function issueStateColor(s) {
return { open: '2cbe4e', closed: '6f42c1' }[s]
}

function errorMessagesFor(notFoundMessage = 'repo not found') {
Expand All @@ -33,7 +33,7 @@ const commentsColor = colorScale([1, 3, 10, 25], undefined, true)

export {
documentation,
stateColor,
issueStateColor,
commentsColor,
errorMessagesFor,
transformErrors,
Expand Down
4 changes: 2 additions & 2 deletions services/github/github-issue-detail.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GithubAuthV3Service } from './github-auth-service.js'
import {
documentation,
errorMessagesFor,
stateColor,
issueStateColor,
commentsColor,
} from './github-helpers.js'

Expand All @@ -33,7 +33,7 @@ const stateMap = {

if (!isPR || state === 'open') {
return {
color: stateColor(state),
color: issueStateColor(state),
label,
message: state,
}
Expand Down
6 changes: 3 additions & 3 deletions services/github/github-issue-detail.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { age } from '../color-formatters.js'
import { formatDate, metric } from '../text-formatters.js'
import { InvalidResponse } from '../index.js'
import GithubIssueDetail from './github-issue-detail.service.js'
import { stateColor, commentsColor } from './github-helpers.js'
import { issueStateColor, commentsColor } from './github-helpers.js'

describe('GithubIssueDetail', function () {
test(GithubIssueDetail.render, () => {
Expand All @@ -16,7 +16,7 @@ describe('GithubIssueDetail', function () {
}).expect({
label: 'pull request 12',
message: 'open',
color: stateColor('open'),
color: issueStateColor('open'),
})
given({
property: 'state',
Expand All @@ -26,7 +26,7 @@ describe('GithubIssueDetail', function () {
}).expect({
label: 'issue 15',
message: 'closed',
color: stateColor('closed'),
color: issueStateColor('closed'),
})
given({
property: 'title',
Expand Down

0 comments on commit 24355a0

Please sign in to comment.