Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search issue or PR by its id / index number #4109

Closed
5 tasks
HerrHase opened this issue Jun 4, 2018 · 11 comments
Closed
5 tasks

Search issue or PR by its id / index number #4109

HerrHase opened this issue Jun 4, 2018 · 11 comments
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@HerrHase
Copy link

HerrHase commented Jun 4, 2018

  • Gitea version (or commit ref): 1.3.2
  • Git version:
  • Operating system: Ubuntu
  • Database (use [x]):
    • PostgreSQL
    • [*] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [*] Not relevant
  • Log gist:

Description

I have often the Problem that i want to search by the ID. Is there a way to add a search like this, "#"?

@techknowlogick techknowlogick added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/enhancement An improvement of existing functionality labels Jun 4, 2018
@Aviortheking
Copy link

+1 & maybe make it work too for this part
image

@alexanderadam
Copy link

@Charliekenney23, I'm just curious: do you have any open PR regarding this issue?

@0xch4z
Copy link

0xch4z commented Jul 3, 2019

@alexanderadam Ah sorry, totally forgot about this. I got really busy after saying I'd take this. Anyone else is welcome to pick it up.

@wxiaoguang wxiaoguang changed the title Improve Search Issue Search issue or PR by its id / index number Apr 13, 2022
@tyroneyeh
Copy link
Contributor

tyroneyeh commented May 28, 2022

Hello

Could try the script to search issue #ID or PR #ID

image

Below code please paste to custom/templates/custom/footer.tmpl

<script>
!function(){var e,t;if("/milestones"!=location.pathname&&(e=document.querySelector(".search"))&&(t=e.querySelector("button"))){var n,o,i,r=document.querySelector("input[name=q]"),c=document.querySelector(".form");t.type="button",c.addEventListener("submit",(function(e){""!=c.q.value&&e.preventDefault()})),r.addEventListener("keydown",(function(e){var t=r.value.trim(),n=t.match(/([\w/]+)#(\d+)/);if(13==e.keyCode&&t){if(""==t.replace(/[#0-9]/g,"")&&!i.disabled||-1!=t.indexOf("#"))return i.click();c.submit()}else n&&(i.disabled=!1)})),t.addEventListener("click",(function(){c.submit()})),((n=document.querySelector(".filter .blue.button.repo"))||document.querySelector(".page-content.repository"))&&(o=location.pathname,n&&(o=n.title+location.pathname),i=t.cloneNode(),n&&!n.title&&(i.disabled=!0),i.type="button",i.textContent="#",i.title="#ID search",i.style.padding="10px",i.addEventListener("click",(function(){var e,t=r.value.trim(),n=t.match(/([\w/]+)#(\d+)/);return""==t.replace(/[#0-9]/g,"")?location=o+(t?"/"+t.replace("#",""):""):n&&n.length&&(e=document.querySelector("[title*='"+n[1]+"']",document.querySelector(".filter")))?location=e.title+location.pathname+(n[2]?"/"+n[2]:""):void c.submit()})),e.appendChild(i))}}();
</script>

@tyroneyeh
Copy link
Contributor

Demo Videos:

hashtagsearch-2022-05-30_11.07.46.mp4

@wxiaoguang wxiaoguang mentioned this issue May 30, 2022
7 tasks
@lunny
Copy link
Member

lunny commented May 31, 2022

Demo Videos:

hashtagsearch-2022-05-30_11.07.46.mp4

Looks interesting.

@nicorac
Copy link

nicorac commented Aug 24, 2022

Could try the script to search issue #ID or PR #ID

That's great, and it works perfectly... till the function will be implemented in Gitea 😉
Thank you very much!

@tyroneyeh
Copy link
Contributor

There are other options for this, but it's still a draft #19646

@yp05327
Copy link
Contributor

yp05327 commented Apr 28, 2023

I think what we need in issue/pr list page is Go To #xxxx issue's page, not search issue by id, it will cause a lot of problems in search algorism.
When I want to access a issue which I know the issue id, I will open another issue and edit the issue id in the url, then press Enter. This is not friendly I think.

@tyroneyeh's idea looks good to me. Can you create a PR ?

@tyroneyeh
Copy link
Contributor

Hi @yp05327

Please check #24479

@lunny
Copy link
Member

lunny commented May 3, 2023

We should follow GH to have a domain search language like number:69 but not mix the keyword and the number.

lunny pushed a commit that referenced this issue May 7, 2023
for
#4109 (comment)

Supports format:
`#1234`
`Org/Repo#1234`

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

10 participants