Merge pull request #836 from rista404/project-state-empty-818
Show "Awaiting triage" for empty project state
This commit is contained in:
commit
0e623ec652
6 changed files with 28 additions and 4 deletions
|
|
@ -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, ", ")
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
|
|
|
|||
|
|
@ -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, ", ")
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
|
|
|
|||
|
|
@ -67,6 +67,14 @@
|
|||
"column": {
|
||||
"name": "column C"
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": {
|
||||
"name": "Project 4"
|
||||
},
|
||||
"column": {
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"totalcount": 3
|
||||
|
|
|
|||
|
|
@ -66,6 +66,14 @@
|
|||
"column": {
|
||||
"name": "column C"
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": {
|
||||
"name": "Project 4"
|
||||
},
|
||||
"column": {
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"totalcount": 3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue