From 410422f9bd7a2c39f0fd83273a9352ed15e93137 Mon Sep 17 00:00:00 2001 From: hiifong Date: Sat, 7 Dec 2024 15:39:57 +0800 Subject: [PATCH 1/3] only hide in ui --- templates/repo/issue/new_form.tmpl | 1 - templates/repo/issue/view_content/sidebar.tmpl | 2 -- templates/shared/issuelist.tmpl | 6 ------ 3 files changed, 9 deletions(-) diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index ceaaebc4d5440..bdc38acc40cb3 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -47,7 +47,6 @@
- {{template "repo/issue/branch_selector_field" $}} {{if .PageIsComparePull}} {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 02f5d3e2df90f..8d92f93d59abd 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -1,6 +1,4 @@
- {{template "repo/issue/branch_selector_field" $}} - {{if .Issue.IsPull}} {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}} {{template "repo/issue/sidebar/wip_switch" $}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index fe5184e7d224f..a71fb2e79bae7 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -99,12 +99,6 @@ {{.Project.Title}} {{end}} - {{if .Ref}} - - {{svg "octicon-git-branch" 14}} - {{index $.IssueRefEndNames .ID}} - - {{end}} {{$tasks := .GetTasks}} {{if gt $tasks 0}} {{$tasksDone := .GetTasksDone}} From 2b6b9caa441e0395a0cc28626eec8b928b5970fe Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 7 Dec 2024 15:55:56 +0800 Subject: [PATCH 2/3] add comments --- models/issues/issue.go | 7 +++++-- templates/repo/issue/branch_selector_field.tmpl | 7 +++++++ templates/repo/issue/new_form.tmpl | 2 ++ templates/repo/issue/view_content/sidebar.tmpl | 2 ++ templates/shared/issuelist.tmpl | 6 ++++++ web_src/js/features/repo-issue-sidebar.ts | 1 + 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/models/issues/issue.go b/models/issues/issue.go index 64fc20cc05e99..fe347c271560e 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -125,8 +125,11 @@ type Issue struct { IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not. PullRequest *PullRequest `xorm:"-"` NumComments int - Ref string - PinOrder int `xorm:"DEFAULT 0"` + + // TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" + Ref string + + PinOrder int `xorm:"DEFAULT 0"` DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"` diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index 286ac0cd051df..6d329f84e2492 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -1,3 +1,10 @@ +{{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really uses it. +The Issue.Ref was added by Add possibility to record branch or tag information in an issue (#780) +After 8 years, this "branch selector" does nothing more than saving the branch/tag name into database and displays it. +So there is a plan to remove it: +* Only hide it from the UI in 1.23, and collect feedbacks. +* If nobody complains and explains how to use it, remove code and drop database column in next release. +*/}} {{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
- {{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} + {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} {{if .PageIsComparePull}} {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 2d98b3a3dfa2c..987a882be7be5 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -1,5 +1,5 @@
- {{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} + {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} {{if .Issue.IsPull}} {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 6231d2b5c407b..a2b802f2a2d0f 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -99,7 +99,7 @@ {{.Project.Title}} {{end}} - {{if and false .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}} + {{if .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}} {{svg "octicon-git-branch" 14}} {{index $.IssueRefEndNames .ID}}