implementing dependency management in tui
This commit is contained in:
@@ -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}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user