From 15a33a958e065fc36a4673316fe631a147d641bf Mon Sep 17 00:00:00 2001 From: Bram Hagens Date: Mon, 29 Jan 2024 16:23:35 +0100 Subject: [PATCH] rename draft -> wip --- modules/structs/issue.go | 6 +++--- services/convert/issue.go | 4 ++-- templates/swagger/v1_json.tmpl | 8 ++++---- web_src/js/components/ContextPopup.vue | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/structs/issue.go b/modules/structs/issue.go index b134fb142fbdb..bac78fd1e2f26 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -26,9 +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"` - IsDraft bool `json:"draft"` + HasMerged bool `json:"merged"` + Merged *time.Time `json:"merged_at"` + IsWorkInProgress bool `json:"wip"` } // RepositoryMeta basic repository information diff --git a/services/convert/issue.go b/services/convert/issue.go index 8fc13bf60e053..e50053ddcb1f6 100644 --- a/services/convert/issue.go +++ b/services/convert/issue.go @@ -98,8 +98,8 @@ func toIssue(ctx context.Context, issue *issues_model.Issue, getDownloadURL func } if issue.PullRequest != nil { apiIssue.PullRequest = &api.PullRequestMeta{ - HasMerged: issue.PullRequest.HasMerged, - IsDraft: issue.PullRequest.IsWorkInProgress(ctx), + HasMerged: issue.PullRequest.HasMerged, + IsWorkInProgress: issue.PullRequest.IsWorkInProgress(ctx), } if issue.PullRequest.HasMerged { apiIssue.PullRequest.Merged = issue.PullRequest.MergedUnix.AsTimePtr() diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index a589fc8c011a4..1b1b60876e90d 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -21610,10 +21610,6 @@ "description": "PullRequestMeta PR info if an issue is a PR", "type": "object", "properties": { - "draft": { - "type": "boolean", - "x-go-name": "IsDraft" - }, "merged": { "type": "boolean", "x-go-name": "HasMerged" @@ -21622,6 +21618,10 @@ "type": "string", "format": "date-time", "x-go-name": "Merged" + }, + "wip": { + "type": "boolean", + "x-go-name": "IsWorkInProgress" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue index 87cdb060ecfcb..50149f286206f 100644 --- a/web_src/js/components/ContextPopup.vue +++ b/web_src/js/components/ContextPopup.vue @@ -30,8 +30,8 @@ export default { icon() { if (this.issue.pull_request !== null) { if (this.issue.state === 'open') { - if (this.issue.pull_request.draft === true) { - return 'octicon-git-pull-request-draft'; // Draft PR + if (this.issue.pull_request.wip === true) { + return 'octicon-git-pull-request-draft'; // WIP PR } return 'octicon-git-pull-request'; // Open PR } else if (this.issue.pull_request.merged === true) { @@ -46,8 +46,8 @@ export default { color() { if (this.issue.pull_request !== null) { - if (this.issue.pull_request.draft === true) { - return 'grey'; // Draft PR + if (this.issue.pull_request.wip === true) { + return 'grey'; // WIP PR } else if (this.issue.pull_request.merged === true) { return 'purple'; // Merged PR }