Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into cobra-update
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Dec 21, 2022
2 parents 607a087 + 1f85a92 commit fcd86c0
Show file tree
Hide file tree
Showing 7 changed files with 1,107 additions and 26 deletions.
50 changes: 29 additions & 21 deletions api/queries_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,38 @@ type IssuesAndTotalCount struct {
}

type Issue struct {
Typename string `json:"__typename"`
ID string
Number int
Title string
URL string
State string
StateReason string
Closed bool
Body string
CreatedAt time.Time
UpdatedAt time.Time
ClosedAt *time.Time
Comments Comments
Author Author
Assignees Assignees
Labels Labels
ProjectCards ProjectCards
Milestone *Milestone
ReactionGroups ReactionGroups
IsPinned bool
Typename string `json:"__typename"`
ID string
Number int
Title string
URL string
State string
StateReason string
Closed bool
Body string
ActiveLockReason string
Locked bool
CreatedAt time.Time
UpdatedAt time.Time
ClosedAt *time.Time
Comments Comments
Author Author
Assignees Assignees
Labels Labels
ProjectCards ProjectCards
Milestone *Milestone
ReactionGroups ReactionGroups
IsPinned bool
}

// return values for Issue.Typename
const (
TypeIssue string = "Issue"
TypePullRequest string = "PullRequest"
)

func (i Issue) IsPullRequest() bool {
return i.Typename == "PullRequest"
return i.Typename == TypePullRequest
}

type Assignees struct {
Expand Down
13 changes: 8 additions & 5 deletions pkg/cmd/issue/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
cmdDevelop "github.com/cli/cli/v2/pkg/cmd/issue/develop"
cmdEdit "github.com/cli/cli/v2/pkg/cmd/issue/edit"
cmdList "github.com/cli/cli/v2/pkg/cmd/issue/list"
cmdLock "github.com/cli/cli/v2/pkg/cmd/issue/lock"
cmdPin "github.com/cli/cli/v2/pkg/cmd/issue/pin"
cmdReopen "github.com/cli/cli/v2/pkg/cmd/issue/reopen"
cmdStatus "github.com/cli/cli/v2/pkg/cmd/issue/status"
Expand Down Expand Up @@ -42,22 +43,24 @@ func NewCmdIssue(f *cmdutil.Factory) *cobra.Command {
cmdutil.EnableRepoOverride(cmd, f)

cmdutil.AddGroup(cmd, "General commands",
cmdCreate.NewCmdCreate(f, nil),
cmdList.NewCmdList(f, nil),
cmdCreate.NewCmdCreate(f, nil),
cmdStatus.NewCmdStatus(f, nil),
)

cmdutil.AddGroup(cmd, "Targeted commands",
cmdClose.NewCmdClose(f, nil),
cmdReopen.NewCmdReopen(f, nil),
cmdView.NewCmdView(f, nil),
cmdComment.NewCmdComment(f, nil),
cmdDelete.NewCmdDelete(f, nil),
cmdEdit.NewCmdEdit(f, nil),
cmdTransfer.NewCmdTransfer(f, nil),
cmdClose.NewCmdClose(f, nil),
cmdReopen.NewCmdReopen(f, nil),
cmdDevelop.NewCmdDevelop(f, nil),
cmdTransfer.NewCmdTransfer(f, nil),
cmdLock.NewCmdLock(f, cmd.Name(), nil),
cmdLock.NewCmdUnlock(f, cmd.Name(), nil),
cmdPin.NewCmdPin(f, nil),
cmdUnpin.NewCmdUnpin(f, nil),
cmdDelete.NewCmdDelete(f, nil),
)

return cmd
Expand Down
Loading

0 comments on commit fcd86c0

Please sign in to comment.