Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change closed GitHub issue color to purple, run [GitHubIssueDetail] #7374

Merged
merged 2 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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