mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-27 03:21:25 +01:00
feat(issue): gh-style issue list, view, create, edit, close and reopen
issue list renders through the shared table: a context line, ID TITLE LABELS [STATE] [KIND] AUTHOR UPDATED with relative times on a terminal, the ID colored by state and linked, and a stable tab-separated column set when piped; empty results say so on stderr. It gains -s -L -l -a -A -m -S -w, @me, comma-separated label and milestone filters, and --web. issue view, edit, close and reopen accept #N, OWNER/REPO#N and issue URLs. Mutations report "✓ Created/Edited/Closed issue alice/x#5 (title)" on a terminal; issue create prints the new issue's URL on stdout (also as issue new), and close and reopen skip issues already in that state with a ! line and take -c/--comment. issue create and edit gain the gh short flags and singular --add-label, --remove-label, --add-assignee and --remove-assignee (the plural names still work), and create gains --web. The interactive create form asks for the title and body, then "What's next?" (submit, add metadata or cancel), without a confirmation after it; the edit form names the issue it edits. Every issue command has help text with examples and completes its flags and issue numbers. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
18 files changed
+789
-376
No files matched your search
@@ -46,6 +46,7 @@ func TestIssueEditImplicitInteractiveForm(t *testing.T) {
|
||||
deps, out, diagnostics := serverDeps(t, server.URL)
|
||||
deps.IssueEditForm = issueEditFormFunc(func(_ context.Context, choices terminal.IssueEditFormChoices) (terminal.IssueEditFormValues, error) {
|
||||
require.NotNil(t, choices.EditBody)
|
||||
require.Equal(t, "Editing alice/project#5 (Old)", choices.Heading)
|
||||
calls++
|
||||
require.Equal(t, "Old", choices.Title)
|
||||
require.Equal(t, "Old body", choices.Body)
|
||||
@@ -64,7 +65,7 @@ func TestIssueEditImplicitInteractiveForm(t *testing.T) {
|
||||
deps.Streams.InTTY, deps.Streams.ErrTTY = true, true
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"issue", "edit", "5", "-R", "alice/project", "--json=number,title", "--interactive"}))
|
||||
require.Equal(t, 1, calls)
|
||||
require.Len(t, prompt.confirmations, 1)
|
||||
require.Empty(t, prompt.confirmations)
|
||||
require.Equal(t, "Edited", patchPayload["title"])
|
||||
require.Equal(t, "New body", patchPayload["body"])
|
||||
require.Equal(t, []any{"bob"}, patchPayload["assignees"])
|
||||
|
||||
Reference in new issue
Block a user