From cffd56f717570a33ca61e44348ae3319ebbfe91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Mon, 15 Jun 2020 15:58:07 -0500 Subject: [PATCH] Rename to mention --- api/queries_issue.go | 10 +++++----- command/issue.go | 6 +++--- command/issue_test.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/queries_issue.go b/api/queries_issue.go index 55d7515f0..76981f8d7 100644 --- a/api/queries_issue.go +++ b/api/queries_issue.go @@ -198,7 +198,7 @@ func IssueStatus(client *Client, repo ghrepo.Interface, currentUsername string) return &payload, nil } -func IssueList(client *Client, repo ghrepo.Interface, state string, labels []string, assigneeString string, limit int, authorString string, mentionedString string, milestoneString string) (*IssuesAndTotalCount, error) { +func IssueList(client *Client, repo ghrepo.Interface, state string, labels []string, assigneeString string, limit int, authorString string, mentionString string, milestoneString string) (*IssuesAndTotalCount, error) { var states []string switch state { case "open", "": @@ -212,10 +212,10 @@ func IssueList(client *Client, repo ghrepo.Interface, state string, labels []str } query := fragments + ` - query($owner: String!, $repo: String!, $limit: Int, $endCursor: String, $states: [IssueState!] = OPEN, $labels: [String!], $assignee: String, $author: String, $mentioned: String, $milestone: String) { + query($owner: String!, $repo: String!, $limit: Int, $endCursor: String, $states: [IssueState!] = OPEN, $labels: [String!], $assignee: String, $author: String, $mention: String, $milestone: String) { repository(owner: $owner, name: $repo) { hasIssuesEnabled - issues(first: $limit, after: $endCursor, orderBy: {field: CREATED_AT, direction: DESC}, states: $states, labels: $labels, filterBy: {assignee: $assignee, createdBy: $author, mentioned: $mentioned, milestone: $milestone}) { + issues(first: $limit, after: $endCursor, orderBy: {field: CREATED_AT, direction: DESC}, states: $states, labels: $labels, filterBy: {assignee: $assignee, createdBy: $author, mentioned: $mention, milestone: $milestone}) { totalCount nodes { ...issue @@ -243,8 +243,8 @@ func IssueList(client *Client, repo ghrepo.Interface, state string, labels []str if authorString != "" { variables["author"] = authorString } - if mentionedString != "" { - variables["mentioned"] = mentionedString + if mentionString != "" { + variables["mention"] = mentionString } if milestoneString != "" { variables["milestone"] = milestoneString diff --git a/command/issue.go b/command/issue.go index 1b4befd67..9dd031ee5 100644 --- a/command/issue.go +++ b/command/issue.go @@ -41,7 +41,7 @@ func init() { issueListCmd.Flags().StringP("state", "s", "open", "Filter by state: {open|closed|all}") issueListCmd.Flags().IntP("limit", "L", 30, "Maximum number of issues to fetch") issueListCmd.Flags().StringP("author", "A", "", "Filter by author") - issueListCmd.Flags().StringP("mentioned", "", "", "Filter by mention") + issueListCmd.Flags().StringP("mention", "", "", "Filter by mention") issueListCmd.Flags().StringP("milestone", "", "", "Filter by milestone") issueCmd.AddCommand(issueViewCmd) @@ -143,7 +143,7 @@ func issueList(cmd *cobra.Command, args []string) error { return err } - mentioned, err := cmd.Flags().GetString("mentioned") + mention, err := cmd.Flags().GetString("mention") if err != nil { return err } @@ -153,7 +153,7 @@ func issueList(cmd *cobra.Command, args []string) error { return err } - listResult, err := api.IssueList(apiClient, baseRepo, state, labels, assignee, limit, author, mentioned, milestone) + listResult, err := api.IssueList(apiClient, baseRepo, state, labels, assignee, limit, author, mention, milestone) if err != nil { return err } diff --git a/command/issue_test.go b/command/issue_test.go index 19ac94d01..b3cb1e5a4 100644 --- a/command/issue_test.go +++ b/command/issue_test.go @@ -153,7 +153,7 @@ func TestIssueList_withFlags(t *testing.T) { } } } `)) - output, err := RunCommand("issue list -a probablyCher -l web,bug -s open -A foo --mentioned me --milestone 1.x") + output, err := RunCommand("issue list -a probablyCher -l web,bug -s open -A foo --mention me --milestone 1.x") if err != nil { t.Errorf("error running command `issue list`: %v", err) } @@ -171,7 +171,7 @@ No issues match your search in OWNER/REPO Labels []string States []string Author string - Mentioned string + Mention string Milestone string } }{} @@ -181,7 +181,7 @@ No issues match your search in OWNER/REPO eq(t, reqBody.Variables.Labels, []string{"web", "bug"}) eq(t, reqBody.Variables.States, []string{"OPEN"}) eq(t, reqBody.Variables.Author, "foo") - eq(t, reqBody.Variables.Mentioned, "me") + eq(t, reqBody.Variables.Mention, "me") eq(t, reqBody.Variables.Milestone, "1.x") }