adding assignee for tui
This commit is contained in:
@@ -53,6 +53,9 @@ type Model struct {
|
||||
priorityIssueID string
|
||||
choosingType bool // true while choosing a type
|
||||
typeIssueID string
|
||||
editingAssignee bool // true while editing assignee
|
||||
assigneeInput textinput.Model
|
||||
assigneeIssueID string
|
||||
feedbackChan chan models.ValidationFeedback
|
||||
quitChan chan bool
|
||||
submitChan chan<- struct{}
|
||||
@@ -89,6 +92,7 @@ func NewDashboard(app *app.App, feedbackChan chan models.ValidationFeedback, qui
|
||||
m.titleInput = inputs.Title
|
||||
m.createTitleInput = inputs.CreateTitle
|
||||
m.descriptionInput = inputs.Description
|
||||
m.assigneeInput = inputs.Assignee
|
||||
|
||||
if selected := m.todoList.SelectedItem(); selected.ID != "" {
|
||||
m.issueDetail.SetIssue(selected.Issue)
|
||||
@@ -142,6 +146,13 @@ func (m *Model) startChooseType(selected ListIssue) {
|
||||
m.typeIssueID = selected.ID
|
||||
}
|
||||
|
||||
func (m *Model) startEditAssignee(selected ListIssue) {
|
||||
m.editingAssignee = true
|
||||
m.assigneeIssueID = selected.ID
|
||||
m.assigneeInput.SetValue(selected.Assignee)
|
||||
m.assigneeInput.CursorEnd()
|
||||
}
|
||||
|
||||
func (m *Model) Init() tea.Cmd {
|
||||
return components.ListenForValidation(m.feedbackChan)
|
||||
}
|
||||
@@ -149,7 +160,7 @@ func (m *Model) Init() tea.Cmd {
|
||||
// IsInModal returns true when a modal (edit, create, delete confirm, choose status/priority/type) is active.
|
||||
func (m *Model) IsInModal() bool {
|
||||
return m.editingTitle || m.creatingIssue || m.editingDescription ||
|
||||
m.choosingStatus || m.choosingPriority || m.confirmingDelete || m.choosingType
|
||||
m.choosingStatus || m.choosingPriority || m.confirmingDelete || m.choosingType || m.editingAssignee
|
||||
}
|
||||
|
||||
func (m *Model) IsFocusedOnList() bool {
|
||||
|
||||
Reference in New Issue
Block a user