mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Clean up some colourizing switch statements
This commit is contained in:
parent
66b69471d0
commit
d74c4ebf2d
@ -67,16 +67,12 @@ func (widget *Widget) contentFrom(view *View) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) jobColor(job *Job) string {
|
func (widget *Widget) jobColor(job *Job) string {
|
||||||
var color string
|
|
||||||
|
|
||||||
switch job.Color {
|
switch job.Color {
|
||||||
case "blue":
|
case "blue":
|
||||||
color = "green"
|
return "blue"
|
||||||
case "red":
|
case "red":
|
||||||
color = "red"
|
return "red"
|
||||||
default:
|
default:
|
||||||
color = "white"
|
return "white"
|
||||||
}
|
}
|
||||||
|
|
||||||
return color
|
|
||||||
}
|
}
|
||||||
|
@ -66,20 +66,16 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) issueTypeColor(issue *Issue) string {
|
func (widget *Widget) issueTypeColor(issue *Issue) string {
|
||||||
var color string
|
|
||||||
|
|
||||||
switch issue.IssueFields.IssueType.Name {
|
switch issue.IssueFields.IssueType.Name {
|
||||||
case "Bug":
|
case "Bug":
|
||||||
color = "red"
|
return "red"
|
||||||
case "Story":
|
case "Story":
|
||||||
color = "blue"
|
return "blue"
|
||||||
case "Task":
|
case "Task":
|
||||||
color = "orange"
|
return "orange"
|
||||||
default:
|
default:
|
||||||
color = "white"
|
return "white"
|
||||||
}
|
}
|
||||||
|
|
||||||
return color
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getProjects() []string {
|
func getProjects() []string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user