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

Add "no label" and "no milestone" filters #3407

Closed
1 task done
lofidevops opened this issue Jan 24, 2018 · 9 comments · Fixed by #24707
Closed
1 task done

Add "no label" and "no milestone" filters #3407

lofidevops opened this issue Jan 24, 2018 · 9 comments · Fixed by #24707
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@lofidevops
Copy link

  • Gitea version (or commit ref):
  • Git version: N/A
  • Operating system: N/A
  • Database (use [x]): N/A
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL) - URL pending
  • Log gist: N/A

Description

I am a project manager triaging issues. I want to filter for all issues without any label, and for all issues without any milestone, so that I know which issues I haven't yet triaged.

Related Gogs issues:

Suggested solution

  • To the label filter list:
    • Add "No label" option
    • Rename "No selected label" to "All labels"
  • To the milestone filter list:
    • Add "No milestone" option
    • Rename "No selected milestone" to "All milestones"
@dakira
Copy link
Contributor

dakira commented Jan 25, 2018

Yes, we need this. It would be such a time saver!

@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Jan 25, 2018
@lunny lunny added this to the 1.x.x milestone Jan 25, 2018
@bobemoe
Copy link
Contributor

bobemoe commented May 10, 2019

Any progress on this? Is there a workaround? Can I use the API to list the no-label and no-milestone issues or something?

@lunny
Copy link
Member

lunny commented May 11, 2019

Nobody are working on this I think.

@bobemoe
Copy link
Contributor

bobemoe commented May 11, 2019

Shame, it would be very useful.

I have found a way to do it with the API and the Linux JSON parser jq

curl -sX GET "https://gitea.example.com/api/v1/repos/USER/REPO/issues" -H "accept: application/json" | jq '.[] | select(.labels|length==0) | .number'

This will list the issue numbers of all issues with no labels. It can quite easily be modified to work with milestones rather than labels.

@zeripath
Copy link
Contributor

It's likely a very easy pr...

@bobemoe
Copy link
Contributor

bobemoe commented May 11, 2019

Maybe if you've got a dev env set up and are familiar with go and gitea ;) I'm thinking it would be much easier for me to extend the script to use the API to add a "needs attention" label to all the issues with no label OR milestone.

If I did that, could I add it to Gitea as a maintenance task or hook somehow without having to modify the code? (or cron it lol)

@kraptor
Copy link

kraptor commented Jul 31, 2019

This feature would be very nice to have...

@j123b567
Copy link
Contributor

Also "no assignee" would be very helpfull.

@lunny lunny modified the milestones: 1.16.0, 1.17.0 Nov 11, 2021
@lunny lunny modified the milestones: 1.17.0, 1.18.0 May 16, 2022
@tyroneyeh
Copy link
Contributor

tyroneyeh commented Jun 17, 2022

Hello

Could try this patch

  • 909cdc360f657daedf9a6cf23ad98f86e51eb1f6
  • c0d8f5a8edb5963b4732abedc54d714f52d92e75
  • 304025c69b3e7749dbfd97fcb10b7e5773373a88
  • 4e0b9d6b53fab8b890957cfe4d92f9544929c862

image
image

and in custom/templates/footer.tmpl add below script

    var btn, a;
    if (btn = document.querySelector(".label-filter a")) {
        a = document.createElement("a");
        a.className = "item";
        a.textContent = "No labels";
        a.addEventListener("click", function() {
            const labelids = "-"+ [...document.querySelectorAll(".label-filter-item")].map(function(i) { return i.getAttribute("data-label-id"); }).join(",-");;
            var labelsurl = "labels=", labelpos;
            if ((labelpos = location.search.indexOf(labelsurl)) > 0) {
                labelsurl = location.search.slice(labelpos);
                if ((labelpos = labelsurl.indexOf("&")) > 0)
                    return location.search = location.search.replace(labelsurl.slice(0, labelpos), "labels="+ labelids);
                return location.search = location.search.replace(labelsurl, "labels="+ labelids);
            }
            return location.search += (location.search.indexOf("?") == -1 ? "?" : "&") + labelsurl + labelids;
        });
        btn.parentNode.insertBefore(a, btn.nextSibling);
    }
    if (btn = document.querySelector(".assignee-filter a")) {
        a = document.createElement("a");
        a.className = "item";
        a.textContent = "No assignees";
        a.addEventListener("click", function() {
            const assigneeids = "-"+ [...document.querySelectorAll(".assignee-filter-item")].map(function(i) { return i.getAttribute("data-assignee-id"); }).join(",-");
            var assigneeurl = "assignee=", assigneepos;
            if ((assigneepos = location.search.indexOf(assigneeurl)) > 0) {
                assigneeurl = location.search.slice(assigneepos);
                if ((assigneepos = assigneeurl.indexOf("&")) > 0)
                    return location.search = location.search.replace(assigneeurl.slice(0, assigneepos), "assignee="+ assigneeids);
                return location.search = location.search.replace(assigneeurl, "assignee="+ assigneeids);
            }
            return location.search += (location.search.indexOf("?") == -1 ? "?" : "&") + assigneeurl + assigneeids;
        });
        btn.parentNode.insertBefore(a, btn.nextSibling);
    }

lunny added a commit that referenced this issue May 17, 2023
…24707)

Since milestones has been implemented, this PR will fix #3407

---------

Co-authored-by: Jason Song <i@wolfogre.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
10 participants