diff --git a/models/issues/issue.go b/models/issues/issue.go index a0af16db838..ca76dabc3ac 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -81,7 +81,7 @@ type Issue struct { PullRequest *PullRequest `xorm:"-"` NumComments int - // TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" + // TODO: ISSUE-SIDEBAR-REF-SELECTOR: see "repo/issue/branch_selector_field.tmpl" Ref string PinOrder int `xorm:"-"` // 0 means not loaded, -1 means loaded but not pinned diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index 96575d2c49e..8a787e1499c 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -1,12 +1,14 @@ -{{/* 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. -PR: https://github.com/go-gitea/gitea/pull/32744 +{{/* TODO: ISSUE-SIDEBAR-REF-SELECTOR: Although we proposed to remove the Issue.Ref, +> 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, +> or sometimes auto-close a ref-matched issue by a commit message when CloseIssuesViaCommitInAnyBranch=false. -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, -or sometimes auto-close a ref-matched issue by a commit message when CloseIssuesViaCommitInAnyBranch=false. - -There are still users using it: -* @didim99: it is a really useful feature to specify a branch in which issue found. +Actually, there are still enough real users who are interested in it: +* @didim99: it is a really useful feature to specify a branch in which issue found (also: https://github.com/go-gitea/gitea/pull/32744) +* @AliceLafox: https://github.com/go-gitea/gitea/issues/39746 +* @mscott-smartuq, @r10r, @@chklemenz, @Smithor, @@JanJurik: https://github.com/go-gitea/gitea/issues/35505 +* Forum: https://forum.gitea.com/t/alternative-to-github-for-reporting-bugs/11684 +So we still keep it and mainain it. Still needs to figure out: * Could the "recording branch/tag name" be replaced by other approaches? diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 71d5028e615..8794827363e 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -47,7 +47,7 @@
- {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} + {{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 4dff5084952..71aceed63f5 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -1,5 +1,5 @@
- {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}} + {{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 838caeb7b28..c363171a3ff 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -88,7 +88,7 @@ {{$project.Title}} {{end}} - {{if .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}} + {{if .Ref}}{{/* TODO: ISSUE-SIDEBAR-REF-SELECTOR: see "repo/issue/branch_selector_field.tmpl" */}} {{svg "octicon-git-branch" 14}} {{index $.IssueRefEndNames .ID}} diff --git a/web_src/js/features/repo-issue-sidebar.ts b/web_src/js/features/repo-issue-sidebar.ts index c2a5ea0f769..7b845099e27 100644 --- a/web_src/js/features/repo-issue-sidebar.ts +++ b/web_src/js/features/repo-issue-sidebar.ts @@ -11,12 +11,11 @@ import type {FomanticApiResponse, Issue} from '../types.ts'; const {appSubUrl} = window.config; function initRepoIssueBranchSelector(elSidebar: HTMLElement) { - // TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" + // TODO: ISSUE-SIDEBAR-REF-SELECTOR: see "repo/issue/branch_selector_field.tmpl" const elSelectBranch = elSidebar.querySelector('.ui.dropdown.select-branch.branch-selector-dropdown'); if (!elSelectBranch) return; const urlUpdateIssueRef = elSelectBranch.getAttribute('data-url-update-issueref'); - const elBranchMenu = elSelectBranch.querySelector('.reference-list-menu')!; - queryElems(elBranchMenu, '.item:not(.no-select)', (el) => el.addEventListener('click', async function (e) { + queryElems(elSelectBranch, '.reference-list-menu .item:not(.no-select)', (el) => el.addEventListener('click', async function (e) { e.preventDefault(); const selectedValue = this.getAttribute('data-id')!; // eg: "refs/heads/my-branch" const selectedText = this.getAttribute('data-name'); // eg: "my-branch"