diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
commit | 99b5c58d43137bd9f6503788a55484327b0c531f (patch) | |
tree | 08ecc0f923b5f1fb4e8a7627aeabccb335d92ad1 /termui/show_bug.go | |
parent | 67a3752e176790e82a48706236f889cab4f8913d (diff) | |
download | git-bug-99b5c58d43137bd9f6503788a55484327b0c531f.tar.gz |
finish the refactoring for the dedicated identifier type
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r-- | termui/show_bug.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go index d25d21db..228b85b0 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -7,6 +7,7 @@ import ( "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/text" "github.com/MichaelMure/gocui" @@ -213,7 +214,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { } bugHeader := fmt.Sprintf("[%s] %s\n\n[%s] %s opened this bug on %s%s", - colors.Cyan(snap.HumanId()), + colors.Cyan(snap.Id().Human()), colors.Bold(snap.Title), colors.Yellow(snap.Status), colors.Magenta(snap.Author.DisplayName()), @@ -231,7 +232,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { y0 += lines + 1 for _, op := range snap.Timeline { - viewName := op.ID() + viewName := op.Id().String() // TODO: me might skip the rendering of blocks that are outside of the view // but to do that we need to rework how sb.mainSelectableView is maintained @@ -642,7 +643,7 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error { return nil } - op, err := snap.SearchTimelineItem(sb.selected) + op, err := snap.SearchTimelineItem(entity.Id(sb.selected)) if err != nil { return err } @@ -650,10 +651,10 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error { switch op.(type) { case *bug.AddCommentTimelineItem: message := op.(*bug.AddCommentTimelineItem).Message - return editCommentWithEditor(sb.bug, op.ID(), message) + return editCommentWithEditor(sb.bug, op.Id(), message) case *bug.CreateTimelineItem: preMessage := op.(*bug.CreateTimelineItem).Message - return editCommentWithEditor(sb.bug, op.ID(), preMessage) + return editCommentWithEditor(sb.bug, op.Id(), preMessage) case *bug.LabelChangeTimelineItem: return sb.editLabels(g, snap) } |