diff --git a/command/issue.go b/command/issue.go index 2f4e145af..f2cb4ba47 100644 --- a/command/issue.go +++ b/command/issue.go @@ -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, ", ") diff --git a/command/issue_test.go b/command/issue_test.go index b7f91031d..e9229ac24 100644 --- a/command/issue_test.go +++ b/command/issue_test.go @@ -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`, diff --git a/command/pr.go b/command/pr.go index a5b1f0079..009548061 100644 --- a/command/pr.go +++ b/command/pr.go @@ -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, ", ") diff --git a/command/pr_test.go b/command/pr_test.go index 074420deb..ba0989645 100644 --- a/command/pr_test.go +++ b/command/pr_test.go @@ -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`, diff --git a/test/fixtures/issueView_previewWithMetadata.json b/test/fixtures/issueView_previewWithMetadata.json index a420eec66..246bbd77b 100644 --- a/test/fixtures/issueView_previewWithMetadata.json +++ b/test/fixtures/issueView_previewWithMetadata.json @@ -67,6 +67,14 @@ "column": { "name": "column C" } + }, + { + "project": { + "name": "Project 4" + }, + "column": { + "name": "" + } } ], "totalcount": 3 diff --git a/test/fixtures/prViewPreviewWithMetadataByNumber.json b/test/fixtures/prViewPreviewWithMetadataByNumber.json index de0da816a..e49bcdc85 100644 --- a/test/fixtures/prViewPreviewWithMetadataByNumber.json +++ b/test/fixtures/prViewPreviewWithMetadataByNumber.json @@ -66,6 +66,14 @@ "column": { "name": "column C" } + }, + { + "project": { + "name": "Project 4" + }, + "column": { + "name": "" + } } ], "totalcount": 3