summaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
authorBram Hagens <bram@bramh.me>2024-02-04 23:37:45 +0100
committerGitHub <noreply@github.com>2024-02-04 22:37:45 +0000
commit50f55f11c4f785b72a39e59b0fc12ae70ab8d8b5 (patch)
treea8b995eb9082223a968b2fb86ade31bbb755ed0f /modules/structs
parent688d4a1f719d2df4d2626453f4bc042c1874a375 (diff)
downloadgitea-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: ![image](https://github.com/go-gitea/gitea/assets/5541521/72cbd30e-1175-4338-aa97-ac99c46c5118) After: ![image](https://github.com/go-gitea/gitea/assets/5541521/111c9eba-460e-4d57-bcca-23a151c3a4f1)
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/issue.go5
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