From dc812f8ba5bf1c123fa948afed15c4309da8fb45 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 1 Jun 2020 23:01:55 +0200 Subject: [PATCH] Issue/Pull expose IsLocked Property on API (#11708) Expose IsLocked Property --- modules/convert/issue.go | 1 + modules/convert/pull.go | 1 + modules/structs/issue.go | 1 + modules/structs/pull.go | 1 + templates/swagger/v1_json.tmpl | 8 ++++++++ 5 files changed, 12 insertions(+) diff --git a/modules/convert/issue.go b/modules/convert/issue.go index ab1f9f1e6..a335f6326 100644 --- a/modules/convert/issue.go +++ b/modules/convert/issue.go @@ -36,6 +36,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue { Body: issue.Content, Labels: ToLabelList(issue.Labels), State: issue.State(), + IsLocked: issue.IsLocked, Comments: issue.NumComments, Created: issue.CreatedUnix.AsTime(), Updated: issue.UpdatedUnix.AsTime(), diff --git a/modules/convert/pull.go b/modules/convert/pull.go index 6ff88c4d8..2fa22efcb 100644 --- a/modules/convert/pull.go +++ b/modules/convert/pull.go @@ -53,6 +53,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest { Assignee: apiIssue.Assignee, Assignees: apiIssue.Assignees, State: apiIssue.State, + IsLocked: apiIssue.IsLocked, Comments: apiIssue.Comments, HTMLURL: pr.Issue.HTMLURL(), DiffURL: pr.Issue.DiffURL(), diff --git a/modules/structs/issue.go b/modules/structs/issue.go index eed5bb500..dc633dedc 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -55,6 +55,7 @@ type Issue struct { // type: string // enum: open,closed State StateType `json:"state"` + IsLocked bool `json:"is_locked"` Comments int `json:"comments"` // swagger:strfmt date-time Created time.Time `json:"created_at"` diff --git a/modules/structs/pull.go b/modules/structs/pull.go index c4ec7d416..8dea51f2c 100644 --- a/modules/structs/pull.go +++ b/modules/structs/pull.go @@ -21,6 +21,7 @@ type PullRequest struct { Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` State StateType `json:"state"` + IsLocked bool `json:"is_locked"` Comments int `json:"comments"` HTMLURL string `json:"html_url"` diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 4f9c45832..1f159d64a 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -12828,6 +12828,10 @@ "format": "int64", "x-go-name": "ID" }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, "labels": { "type": "array", "items": { @@ -13501,6 +13505,10 @@ "format": "int64", "x-go-name": "ID" }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, "labels": { "type": "array", "items": {