mirror of
https://github.com/MichaelMure/git-bug.git
synced 2025-01-07 10:36:36 +03:00
Use labelSelect to edit labels in bugView
This commit is contained in:
parent
e8173d4663
commit
59658bb98e
@ -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 {
|
func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
|
||||||
if sb.isOnSide {
|
|
||||||
ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
snap := sb.bug.Snapshot()
|
snap := sb.bug.Snapshot()
|
||||||
|
|
||||||
|
if sb.isOnSide {
|
||||||
|
return sb.editLabels(g, snap)
|
||||||
|
}
|
||||||
|
|
||||||
op, err := snap.SearchTimelineItem(git.Hash(sb.selected))
|
op, err := snap.SearchTimelineItem(git.Hash(sb.selected))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -647,12 +646,19 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
|
|||||||
case *bug.CreateTimelineItem:
|
case *bug.CreateTimelineItem:
|
||||||
preMessage := op.(*bug.CreateTimelineItem).Message
|
preMessage := op.(*bug.CreateTimelineItem).Message
|
||||||
return editCommentWithEditor(sb.bug, op.Hash(), preMessage)
|
return editCommentWithEditor(sb.bug, op.Hash(), preMessage)
|
||||||
|
case *bug.LabelChangeTimelineItem:
|
||||||
|
return sb.editLabels(g, snap)
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.")
|
ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.")
|
||||||
return nil
|
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 {
|
func (sb *showBug) addLabel(g *gocui.Gui, v *gocui.View) error {
|
||||||
c := ui.inputPopup.Activate("Add labels")
|
c := ui.inputPopup.Activate("Add labels")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user