Merge pull request #836 from rista404/project-state-empty-818

Show "Awaiting triage" for empty project state
This commit is contained in:
Nate Smith 2020-04-28 20:04:42 -05:00 committed by GitHub
commit 0e623ec652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 4 deletions

View file

@ -504,7 +504,11 @@ func issueProjectList(issue api.Issue) string {
projectNames := make([]string, 0, len(issue.ProjectCards.Nodes))
for _, project := range issue.ProjectCards.Nodes {
projectNames = append(projectNames, fmt.Sprintf("%s (%s)", project.Project.Name, project.Column.Name))
colName := project.Column.Name
if colName == "" {
colName = "Awaiting triage"
}
projectNames = append(projectNames, fmt.Sprintf("%s (%s)", project.Project.Name, colName))
}
list := strings.Join(projectNames, ", ")

View file

@ -312,7 +312,7 @@ func TestIssueView_Preview(t *testing.T) {
`Open • marseilles opened about 292 years ago • 9 comments`,
`Assignees: marseilles, monaco\n`,
`Labels: one, two, three, four, five\n`,
`Projects: Project 1 \(column A\), Project 2 \(column B\), Project 3 \(column C\)\n`,
`Projects: Project 1 \(column A\), Project 2 \(column B\), Project 3 \(column C\), Project 4 \(Awaiting triage\)\n`,
`Milestone: uluru\n`,
`bold story`,
`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123`,

View file

@ -417,7 +417,11 @@ func prProjectList(pr api.PullRequest) string {
projectNames := make([]string, 0, len(pr.ProjectCards.Nodes))
for _, project := range pr.ProjectCards.Nodes {
projectNames = append(projectNames, fmt.Sprintf("%s (%s)", project.Project.Name, project.Column.Name))
colName := project.Column.Name
if colName == "" {
colName = "Awaiting triage"
}
projectNames = append(projectNames, fmt.Sprintf("%s (%s)", project.Project.Name, colName))
}
list := strings.Join(projectNames, ", ")

View file

@ -429,7 +429,7 @@ func TestPRView_Preview(t *testing.T) {
`Open • nobody wants to merge 12 commits into master from blueberries`,
`Assignees: marseilles, monaco\n`,
`Labels: one, two, three, four, five\n`,
`Projects: Project 1 \(column A\), Project 2 \(column B\), Project 3 \(column C\)\n`,
`Projects: Project 1 \(column A\), Project 2 \(column B\), Project 3 \(column C\), Project 4 \(Awaiting triage\)\n`,
`Milestone: uluru\n`,
`blueberries taste good`,
`View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12\n`,

View file

@ -67,6 +67,14 @@
"column": {
"name": "column C"
}
},
{
"project": {
"name": "Project 4"
},
"column": {
"name": ""
}
}
],
"totalcount": 3

View file

@ -66,6 +66,14 @@
"column": {
"name": "column C"
}
},
{
"project": {
"name": "Project 4"
},
"column": {
"name": ""
}
}
],
"totalcount": 3