aboutsummaryrefslogtreecommitdiffstats
path: root/termui/show_bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-30 17:15:54 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-30 17:15:54 +0200
commit7f86898ef9a8f9e866835ece3c9824a8edc58036 (patch)
tree5c5733c9272f3477317935bde6ecb4680276b717 /termui/show_bug.go
parentd71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (diff)
downloadgit-bug-7f86898ef9a8f9e866835ece3c9824a8edc58036.tar.gz
bug: use deditated type for all TimelineItem
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r--termui/show_bug.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index 5a3ea1d5..32bea95a 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -253,8 +253,8 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
fmt.Fprint(v, content)
y0 += lines + 2
- case *bug.CommentTimelineItem:
- comment := op.(*bug.CommentTimelineItem)
+ case *bug.AddCommentTimelineItem:
+ comment := op.(*bug.AddCommentTimelineItem)
edited := ""
if comment.Edited() {
@@ -277,13 +277,13 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
fmt.Fprint(v, content)
y0 += lines + 2
- case *bug.SetTitleOperation:
- setTitle := op.(*bug.SetTitleOperation)
+ case *bug.SetTitleTimelineItem:
+ setTitle := op.(*bug.SetTitleTimelineItem)
content := fmt.Sprintf("%s changed the title to %s on %s",
colors.Magenta(setTitle.Author.Name),
colors.Bold(setTitle.Title),
- setTitle.Time().Format(timeLayout),
+ setTitle.UnixTime.Time().Format(timeLayout),
)
content, lines := text.Wrap(content, maxX)
@@ -294,13 +294,13 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
fmt.Fprint(v, content)
y0 += lines + 2
- case *bug.SetStatusOperation:
- setStatus := op.(*bug.SetStatusOperation)
+ case *bug.SetStatusTimelineItem:
+ setStatus := op.(*bug.SetStatusTimelineItem)
content := fmt.Sprintf("%s %s the bug on %s",
colors.Magenta(setStatus.Author.Name),
colors.Bold(setStatus.Status.Action()),
- setStatus.Time().Format(timeLayout),
+ setStatus.UnixTime.Time().Format(timeLayout),
)
content, lines := text.Wrap(content, maxX)
@@ -311,8 +311,8 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
fmt.Fprint(v, content)
y0 += lines + 2
- case *bug.LabelChangeOperation:
- labelChange := op.(*bug.LabelChangeOperation)
+ case *bug.LabelChangeTimelineItem:
+ labelChange := op.(*bug.LabelChangeTimelineItem)
var added []string
for _, label := range labelChange.Added {
@@ -349,7 +349,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
content := fmt.Sprintf("%s %s on %s",
colors.Magenta(labelChange.Author.Name),
action.String(),
- labelChange.Time().Format(timeLayout),
+ labelChange.UnixTime.Time().Format(timeLayout),
)
content, lines := text.Wrap(content, maxX)