feat: move a card between statuses #3
1 changed files with 6 additions and 6 deletions
|
@ -21,7 +21,6 @@ const (
|
||||||
addPageName string = "add"
|
addPageName string = "add"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UI does some magical stuff.
|
|
||||||
type UI struct {
|
type UI struct {
|
||||||
*tview.Application
|
*tview.Application
|
||||||
|
|
||||||
|
@ -50,12 +49,12 @@ func NewUI() UI {
|
||||||
return u
|
return u
|
||||||
}
|
}
|
||||||
|
|
||||||
// closeBoard closes the BoltDB database.
|
// closeBoard closes the board.
|
||||||
func (u *UI) closeBoard() {
|
func (u *UI) closeBoard() {
|
||||||
_ = u.board.Close()
|
_ = u.board.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// init the UI.
|
// init initialises the UI.
|
||||||
func (u *UI) init() {
|
func (u *UI) init() {
|
||||||
u.pages.AddPage(mainPageName, u.flex, true, true)
|
u.pages.AddPage(mainPageName, u.flex, true, true)
|
||||||
|
|
||||||
|
@ -82,6 +81,7 @@ func (u *UI) init() {
|
||||||
u.SetRoot(u.pages, true)
|
u.SetRoot(u.pages, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initAddInputModal initialises the add input modal.
|
||||||
func (u *UI) initAddInputModal() {
|
func (u *UI) initAddInputModal() {
|
||||||
doneFunc := func(text string, success bool) {
|
doneFunc := func(text string, success bool) {
|
||||||
if success {
|
if success {
|
||||||
|
@ -111,7 +111,7 @@ func (u *UI) initQuitModal() {
|
||||||
SetDoneFunc(quitDoneFunc)
|
SetDoneFunc(quitDoneFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// newCard creates a new card and saves it to the database.
|
// newCard creates and saves a new card to the database.
|
||||||
func (u *UI) newCard(title, content string) error {
|
func (u *UI) newCard(title, content string) error {
|
||||||
args := board.CardArgs{
|
args := board.CardArgs{
|
||||||
NewTitle: title,
|
NewTitle: title,
|
||||||
|
@ -127,7 +127,7 @@ func (u *UI) newCard(title, content string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// openBoard opens the kanban project.
|
// openBoard opens the kanban board.
|
||||||
func (u *UI) openBoard(path string) error {
|
func (u *UI) openBoard(path string) error {
|
||||||
b, err := board.Open(path)
|
b, err := board.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -143,7 +143,7 @@ func (u *UI) openBoard(path string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh the UI.
|
// refresh refreshes the UI.
|
||||||
func (u *UI) refresh() error {
|
func (u *UI) refresh() error {
|
||||||
statusList, err := u.board.StatusList()
|
statusList, err := u.board.StatusList()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue