implementing dependency management in tui

This commit is contained in:
viljarb
2026-03-24 19:57:45 +01:00
parent 47f1cf8d09
commit 802d379de8
12 changed files with 701 additions and 15 deletions

View File

@@ -62,6 +62,26 @@ type (
Err error
}
DependencyAddedMsg struct {
IssueID string
DependsOnID string
Err error
}
DependencyAddRequestedMsg struct {
IssueID string
}
DependencyRemovedMsg struct {
IssueID string
DependsOnID string
Err error
}
DependencyRemoveRequestedMsg struct {
IssueID string
}
ModalCompletedMsg struct {
ModalID string
Result interface{}
@@ -161,3 +181,22 @@ func AddIssueCommentCmd(app *app.App, issueID, author, text string) tea.Cmd {
return IssueCommentAddedMsg{IssueID: issueID, Err: err}
}
}
func AddDependencyCmd(app *app.App, issueID, dependsOnID string) tea.Cmd {
return func() tea.Msg {
dep := &models.Dependency{
IssueID: issueID,
DependsOnID: dependsOnID,
Type: models.DepBlocks,
}
err := app.Issues.AddDependency(context.Background(), dep, "tui")
return DependencyAddedMsg{IssueID: issueID, DependsOnID: dependsOnID, Err: err}
}
}
func RemoveDependencyCmd(app *app.App, issueID, dependsOnID string) tea.Cmd {
return func() tea.Msg {
err := app.Issues.RemoveDependency(context.Background(), issueID, dependsOnID, "tui")
return DependencyRemovedMsg{IssueID: issueID, DependsOnID: dependsOnID, Err: err}
}
}