1
0
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:
Chris Cummer 2019-02-06 12:04:34 -08:00
commit fb873e1463
3 changed files with 19 additions and 1 deletions

View File

@ -13,6 +13,7 @@ type IssueFields struct {
Summary string `json:"summary"` Summary string `json:"summary"`
IssueType *IssueType `json:"issuetype"` IssueType *IssueType `json:"issuetype"`
IssueStatus *IssueStatus `json:"status"`
} }
type IssueType struct { type IssueType struct {
@ -23,3 +24,9 @@ type IssueType struct {
Name string `json:"name"` Name string `json:"name"`
Subtask bool `json:"subtask"` Subtask bool `json:"subtask"`
} }
type IssueStatus struct {
ISelf string `json:"self"`
IDescription string `json:"description"`
IName string `json:"name"`
}

View File

@ -113,12 +113,13 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {
for idx, issue := range searchResult.Issues { for idx, issue := range searchResult.Issues {
fmtStr := fmt.Sprintf( 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, idx,
widget.rowColor(idx), widget.rowColor(idx),
widget.issueTypeColor(&issue), widget.issueTypeColor(&issue),
issue.IssueFields.IssueType.Name, issue.IssueFields.IssueType.Name,
issue.Key, issue.Key,
issue.IssueFields.IssueStatus.IName,
widget.rowColor(idx), widget.rowColor(idx),
issue.IssueFields.Summary, issue.IssueFields.Summary,
) )

View File

@ -125,6 +125,16 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
return nil return nil
} }
switch event.Key() { 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: case tcell.KeyEnter:
widget.openTicket() widget.openTicket()
return nil return nil