Skip to content

Commit 945ed48

Browse files
committed
revert the selector and fix bug
1 parent 1cc889b commit 945ed48

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

templates/repo/issue/branch_selector_field.tmpl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
{{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really uses it.
1+
{{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really needs it or there could be better alternative then.
2+
PR: https://github.com/go-gitea/gitea/pull/32744
3+
24
The Issue.Ref was added by Add possibility to record branch or tag information in an issue (#780)
35
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.
6+
7+
There are still users using it:
8+
* @didim99: it is a really useful feature to specify a branch in which issue found.
9+
10+
Still needs to figure out:
11+
* Could the "recording branch/tag name" be replaced by other approaches?
12+
* Write the branch name in the issue title/body then it will still be displayed, eg: `[bug] (fix/ui-broken-bug) there is a bug ....`
13+
* Is "GitHub-like development sidebar (`#31899`)" good enough (or better) for your usage?
714
*/}}
815
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
916
<input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}">
@@ -36,7 +43,7 @@ So there is a plan to remove it:
3643
{{range .Branches}}
3744
<div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector" title="{{.}}">{{.}}</div>
3845
{{else}}
39-
<div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
46+
<div class="item disabled">{{ctx.Locale.Tr "no_results_found"}}</div>
4047
{{end}}
4148
</div>
4249
<div id="tag-list" class="scrolling menu reference-list-menu tw-hidden">
@@ -46,7 +53,7 @@ So there is a plan to remove it:
4653
{{range .Tags}}
4754
<div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div>
4855
{{else}}
49-
<div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
56+
<div class="item disabled">{{ctx.Locale.Tr "no_results_found"}}</div>
5057
{{end}}
5158
</div>
5259
</div>

templates/repo/issue/new_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</div>
4848

4949
<div class="issue-content-right ui segment">
50-
{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
50+
{{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
5151

5252
{{if .PageIsComparePull}}
5353
{{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="issue-content-right ui segment">
2-
{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
2+
{{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
33

44
{{if .Issue.IsPull}}
55
{{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}

templates/shared/issuelist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
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" */}}
102+
{{if .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}}
103103
<a class="ref flex-text-inline tw-max-w-[300px]" {{if $.RepoLink}}href="{{index $.IssueRefURLs .ID}}"{{else}}href="{{.Repo.Link}}{{index $.IssueRefURLs .ID}}"{{end}}>
104104
{{svg "octicon-git-branch" 14}}
105105
<span class="gt-ellipsis">{{index $.IssueRefEndNames .ID}}</span>

0 commit comments

Comments
 (0)