Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListPRColumns = []teax.Column[git.PullRequest]{ { Column: table.Column{Title: `Total: {{.Total}}`, Width: 6}, Extract: func(pr git.PullRequest) string { return pr.Project.Name }, }, { Column: table.Column{Title: "No.", Width: 1}, Extract: func(pr git.PullRequest) string { return strconv.Itoa(pr.Number) }, }, { Column: table.Column{Title: "Title (last update: {{.LastReload.Format \"15:04:05\" }}, Δ: {{.LoadedIn.String}})", Width: 16}, Extract: func(pr git.PullRequest) string { return pr.Title }, }, { Column: table.Column{Title: "Author", Width: 4}, Extract: func(pr git.PullRequest) string { return pr.Author.Username }, }, { Column: table.Column{Title: "Created At", Width: 3}, Extract: func(pr git.PullRequest) string { return pr.CreatedAt.Format("2006-01-02") }, }, { Column: table.Column{Title: "Threads", Width: 2}, Extract: func(pr git.PullRequest) string { resolved := lo.CountBy(pr.Threads, func(t git.Comment) bool { return t.Resolved }) return fmt.Sprintf("%d/%d (%s)", resolved, len(pr.Threads), checkmark(resolved == len(pr.Threads)), ) }, }, { Column: table.Column{Title: "Approvals", Width: 3}, Extract: func(pr git.PullRequest) string { return fmt.Sprintf("%d/%d (%s)", len(pr.Approvals.By), pr.Approvals.Required, checkmark(pr.Approvals.SatisfiesRules), ) }, }, }
ListPRColumns are the columns to show in the table.
Functions ¶
Types ¶
type ListPR ¶
type ListPR struct { ListPRParams tea.Model // contains filtered or unexported fields }
ListPR is a TUI to list merge requests.
func (*ListPR) Load ¶
func (l *ListPR) Load() ([]git.PullRequest, error)
Load loads the merge requests.
func (*ListPR) OnEnter ¶
func (l *ListPR) OnEnter(pr git.PullRequest) error
OnEnter either opens the merge request in the browser or copies the URL to the clipboard.
type ListPRParams ¶
type ListPRParams struct { Service PRStore Request service.ListPRsRequest OpenOnEnter bool PollInterval time.Duration Version string }
ListPRParams are the parameters to initialize a ListPR TUI.
type PRStore ¶
type PRStore interface {
ListPullRequests(ctx context.Context, req service.ListPRsRequest) ([]git.PullRequest, error)
}
PRStore is a store of pull requests.
Click to show internal directories.
Click to hide internal directories.