From 5511c230b678a181cc596238bf6669428d1b1902 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 18 Aug 2022 23:34:05 +0200 Subject: move {bug,identity} to /entities, move input to /commands --- termui/show_bug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'termui/show_bug.go') diff --git a/termui/show_bug.go b/termui/show_bug.go index 528d1fa5..c77000f5 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -9,8 +9,8 @@ import ( text "github.com/MichaelMure/go-term-text" "github.com/awesome-gocui/gocui" - "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/util/colors" ) -- cgit From 8818d091e85087766d7f493b7dfaf1aedc3a4ab0 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 20 Aug 2022 10:52:11 +0200 Subject: move bug.Status in entities/common for reuse --- termui/show_bug.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'termui/show_bug.go') diff --git a/termui/show_bug.go b/termui/show_bug.go index c77000f5..6cace04a 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -11,6 +11,7 @@ import ( "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/entities/bug" + "github.com/MichaelMure/git-bug/entities/common" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/util/colors" ) @@ -624,10 +625,10 @@ func (sb *showBug) setTitle(g *gocui.Gui, v *gocui.View) error { func (sb *showBug) toggleOpenClose(g *gocui.Gui, v *gocui.View) error { switch sb.bug.Snapshot().Status { - case bug.OpenStatus: + case common.OpenStatus: _, err := sb.bug.Close() return err - case bug.ClosedStatus: + case common.ClosedStatus: _, err := sb.bug.Open() return err default: -- cgit From 45b04351d8d02e53b3401b0ee23f7cbe750b63cd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 3 May 2021 11:45:15 +0200 Subject: bug: have a type for combined ids, fix https://github.com/MichaelMure/git-bug/issues/653 --- termui/show_bug.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'termui/show_bug.go') diff --git a/termui/show_bug.go b/termui/show_bug.go index 6cace04a..8bcae842 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -244,7 +244,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { y0 += lines + 1 for _, op := range snap.Timeline { - viewName := op.Id().String() + viewName := op.CombinedId().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 @@ -647,16 +647,16 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error { return nil } - op, err := snap.SearchTimelineItem(entity.Id(sb.selected)) + op, err := snap.SearchTimelineItem(entity.CombinedId(sb.selected)) if err != nil { return err } switch op := op.(type) { case *bug.AddCommentTimelineItem: - return editCommentWithEditor(sb.bug, op.Id(), op.Message) + return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message) case *bug.CreateTimelineItem: - return editCommentWithEditor(sb.bug, op.Id(), op.Message) + return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message) case *bug.LabelChangeTimelineItem: return sb.editLabels(g, snap) } -- cgit