aboutsummaryrefslogtreecommitdiffstats
path: root/termui/show_bug.go
diff options
context:
space:
mode:
authorLuke Adams <lukeclydeadams@gmail.com>2018-10-04 13:22:26 -0600
committerLuke Adams <lukeclydeadams@gmail.com>2018-10-04 13:51:00 -0600
commit59658bb98e27ca60cd8ae7f7029edf9ca46830c4 (patch)
treec2a114ed45af98220698c83e2f8a7d6acb3e6dca /termui/show_bug.go
parente8173d466304e3abc86cec527f062e3709f375dd (diff)
downloadgit-bug-59658bb98e27ca60cd8ae7f7029edf9ca46830c4.tar.gz
Use labelSelect to edit labels in bugView
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r--termui/show_bug.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index 72bcfe2f..71237cbf 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -628,13 +628,12 @@ func (sb *showBug) toggleOpenClose(g *gocui.Gui, v *gocui.View) error {
}
func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
+ snap := sb.bug.Snapshot()
+
if sb.isOnSide {
- ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.")
- return nil
+ return sb.editLabels(g, snap)
}
- snap := sb.bug.Snapshot()
-
op, err := snap.SearchTimelineItem(git.Hash(sb.selected))
if err != nil {
return err
@@ -647,12 +646,19 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
case *bug.CreateTimelineItem:
preMessage := op.(*bug.CreateTimelineItem).Message
return editCommentWithEditor(sb.bug, op.Hash(), preMessage)
+ case *bug.LabelChangeTimelineItem:
+ return sb.editLabels(g, snap)
}
ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.")
return nil
}
+func (sb *showBug) editLabels(g *gocui.Gui, snap *bug.Snapshot) error {
+ ui.labelSelect.SetBug(sb.cache, sb.bug)
+ return ui.activateWindow(ui.labelSelect)
+}
+
func (sb *showBug) addLabel(g *gocui.Gui, v *gocui.View) error {
c := ui.inputPopup.Activate("Add labels")