mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge branch 'master' of https://github.com/jdenoy/wtf into jdenoy-master
This commit is contained in:
commit
fb873e1463
@ -13,6 +13,7 @@ type IssueFields struct {
|
||||
Summary string `json:"summary"`
|
||||
|
||||
IssueType *IssueType `json:"issuetype"`
|
||||
IssueStatus *IssueStatus `json:"status"`
|
||||
}
|
||||
|
||||
type IssueType struct {
|
||||
@ -23,3 +24,9 @@ type IssueType struct {
|
||||
Name string `json:"name"`
|
||||
Subtask bool `json:"subtask"`
|
||||
}
|
||||
|
||||
type IssueStatus struct {
|
||||
ISelf string `json:"self"`
|
||||
IDescription string `json:"description"`
|
||||
IName string `json:"name"`
|
||||
}
|
||||
|
@ -113,12 +113,13 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {
|
||||
|
||||
for idx, issue := range searchResult.Issues {
|
||||
fmtStr := fmt.Sprintf(
|
||||
`["%d"][""][%s] [%s]%-6s[white] [green]%-10s[white] [%s]%s`,
|
||||
`["%d"][""][%s] [%s]%-6s[white] [green]%-10s[white] [yellow][%s][white] [%s]%s`,
|
||||
idx,
|
||||
widget.rowColor(idx),
|
||||
widget.issueTypeColor(&issue),
|
||||
issue.IssueFields.IssueType.Name,
|
||||
issue.Key,
|
||||
issue.IssueFields.IssueStatus.IName,
|
||||
widget.rowColor(idx),
|
||||
issue.IssueFields.Summary,
|
||||
)
|
||||
|
@ -125,6 +125,16 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
|
||||
return nil
|
||||
}
|
||||
switch event.Key() {
|
||||
case tcell.KeyDown:
|
||||
// Select the next item down
|
||||
widget.next()
|
||||
widget.display()
|
||||
return nil
|
||||
case tcell.KeyUp:
|
||||
// Select the next item up
|
||||
widget.prev()
|
||||
widget.display()
|
||||
return nil
|
||||
case tcell.KeyEnter:
|
||||
widget.openTicket()
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user