Skip to content

Commit 2b6b9ca

Browse files
committed
add comments
1 parent 410422f commit 2b6b9ca

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

models/issues/issue.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ type Issue struct {
125125
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
126126
PullRequest *PullRequest `xorm:"-"`
127127
NumComments int
128-
Ref string
129-
PinOrder int `xorm:"DEFAULT 0"`
128+
129+
// TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
130+
Ref string
131+
132+
PinOrder int `xorm:"DEFAULT 0"`
130133

131134
DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"`
132135

templates/repo/issue/branch_selector_field.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
{{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really uses it.
2+
The Issue.Ref was added by Add possibility to record branch or tag information in an issue (#780)
3+
After 8 years, this "branch selector" does nothing more than saving the branch/tag name into database and displays it.
4+
So there is a plan to remove it:
5+
* Only hide it from the UI in 1.23, and collect feedbacks.
6+
* If nobody complains and explains how to use it, remove code and drop database column in next release.
7+
*/}}
18
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
29
<input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}">
310
<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-items-nowrap {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}"

templates/repo/issue/new_form.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
</div>
4848

4949
<div class="issue-content-right ui segment">
50+
{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
51+
5052
{{if .PageIsComparePull}}
5153
{{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}
5254
<div class="divider"></div>

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<div class="issue-content-right ui segment">
2+
{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
3+
24
{{if .Issue.IsPull}}
35
{{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}
46
{{template "repo/issue/sidebar/wip_switch" $}}

templates/shared/issuelist.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
<span class="gt-ellipsis">{{.Project.Title}}</span>
100100
</a>
101101
{{end}}
102+
{{if and false .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}}
103+
<a class="ref flex-text-inline tw-max-w-[300px]" {{if $.RepoLink}}href="{{index $.IssueRefURLs .ID}}"{{else}}href="{{.Repo.Link}}{{index $.IssueRefURLs .ID}}"{{end}}>
104+
{{svg "octicon-git-branch" 14}}
105+
<span class="gt-ellipsis">{{index $.IssueRefEndNames .ID}}</span>
106+
</a>
107+
{{end}}
102108
{{$tasks := .GetTasks}}
103109
{{if gt $tasks 0}}
104110
{{$tasksDone := .GetTasksDone}}

web_src/js/features/repo-issue-sidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {queryElems, toggleElem} from '../utils/dom.ts';
44
import {initIssueSidebarComboList} from './repo-issue-sidebar-combolist.ts';
55

66
function initBranchSelector() {
7+
// TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
78
const elSelectBranch = document.querySelector('.ui.dropdown.select-branch');
89
if (!elSelectBranch) return;
910

0 commit comments

Comments
 (0)