diff options
author | Bram Hagens <bram@bramh.me> | 2024-02-04 23:37:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-04 22:37:45 +0000 |
commit | 50f55f11c4f785b72a39e59b0fc12ae70ab8d8b5 (patch) | |
tree | a8b995eb9082223a968b2fb86ade31bbb755ed0f /modules/structs | |
parent | 688d4a1f719d2df4d2626453f4bc042c1874a375 (diff) | |
download | gitea-50f55f11c4f785b72a39e59b0fc12ae70ab8d8b5.tar.gz gitea-50f55f11c4f785b72a39e59b0fc12ae70ab8d8b5.zip |
Show whether a PR is WIP inside popups (#28975)
Fixes https://codeberg.org/forgejo/forgejo/issues/2257
Draft status of a PR is currently not exposed by the API. This PR adds a
'draft' field to pull requests in the API, which is used to correctly
set the PR color/icon in a ContextPopup.
---
Before:

After:

Diffstat (limited to 'modules/structs')
-rw-r--r-- | modules/structs/issue.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/structs/issue.go b/modules/structs/issue.go index 1aec5cc6b8..34eae69329 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -26,8 +26,9 @@ const ( // PullRequestMeta PR info if an issue is a PR type PullRequestMeta struct { - HasMerged bool `json:"merged"` - Merged *time.Time `json:"merged_at"` + HasMerged bool `json:"merged"` + Merged *time.Time `json:"merged_at"` + IsWorkInProgress bool `json:"draft"` } // RepositoryMeta basic repository information |