adding assignee for tui
This commit is contained in:
@@ -54,7 +54,7 @@ func getTableColumns(width int) []tableColumn {
|
||||
{width: 20, label: "TITLE", key: "title"},
|
||||
{width: 15, label: "STATUS", key: "status"},
|
||||
}
|
||||
default:
|
||||
case width < 75:
|
||||
return []tableColumn{
|
||||
{width: 12, label: "ID", key: "id"},
|
||||
{width: 20, label: "TITLE", key: "title"},
|
||||
@@ -62,6 +62,15 @@ func getTableColumns(width int) []tableColumn {
|
||||
{width: 10, label: "TYPE", key: "type"},
|
||||
{width: 15, label: "PRIORITY", key: "priority"},
|
||||
}
|
||||
default:
|
||||
return []tableColumn{
|
||||
{width: 12, label: "ID", key: "id"},
|
||||
{width: 20, label: "TITLE", key: "title"},
|
||||
{width: 15, label: "STATUS", key: "status"},
|
||||
{width: 11, label: "TYPE", key: "type"},
|
||||
{width: 14, label: "PRIORITY", key: "priority"},
|
||||
{width: 12, label: "ASSIGNEE", key: "assignee"},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +108,12 @@ func renderHeaders(cols []tableColumn) string {
|
||||
return lipgloss.JoinHorizontal(lipgloss.Left, parts...)
|
||||
}
|
||||
|
||||
// IssueInputs bundles the common text inputs used for issue title, creation, and description.
|
||||
// IssueInputs bundles the common text inputs used for issue title, creation, description, and assignee.
|
||||
type IssueInputs struct {
|
||||
Title textinput.Model
|
||||
CreateTitle textinput.Model
|
||||
Description textarea.Model
|
||||
Assignee textinput.Model
|
||||
}
|
||||
|
||||
// NewIssueInputs creates initialized inputs for issue title, new issue title, and description.
|
||||
@@ -121,10 +131,15 @@ func NewIssueInputs() IssueInputs {
|
||||
descTa.SetWidth(56)
|
||||
descTa.SetHeight(8)
|
||||
|
||||
assigneeTi := textinput.New()
|
||||
assigneeTi.Placeholder = "Assignee name..."
|
||||
assigneeTi.CharLimit = 64
|
||||
|
||||
return IssueInputs{
|
||||
Title: ti,
|
||||
CreateTitle: createTi,
|
||||
Description: descTa,
|
||||
Assignee: assigneeTi,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,6 +429,8 @@ func getColumnValue(col tableColumn, issue ListIssue) string {
|
||||
return string(issue.Issue.IssueType)
|
||||
case "priority":
|
||||
return PriorityCodeName(issue.Issue.Priority)
|
||||
case "assignee":
|
||||
return issue.Assignee
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user