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

Hide archived labels when filtering by labels on the issue list #27115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1e3fd9b
Empty-Commit
puni9869 Sep 18, 2023
fd968e7
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 18, 2023
cb9777c
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 18, 2023
9ae479c
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 19, 2023
3c8bd6b
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 20, 2023
e59222e
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 23, 2023
e5d7c2b
Adding the archived label checkbox in ui issue filter
puni9869 Sep 23, 2023
a53cffb
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 23, 2023
d82a130
Fix Spacing in file
puni9869 Sep 23, 2023
2b7e751
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 23, 2023
9dce826
Adding filter functionality for archived label
puni9869 Sep 24, 2023
eba3cce
* Splitting issue filter actions into different template
puni9869 Sep 24, 2023
f6a1c09
Reverting the unnecessary code change
puni9869 Sep 24, 2023
a2754ab
* Adding the archived flag in issue url labels
puni9869 Sep 24, 2023
6e568f7
* Adding archivedLabel true in all the filters
puni9869 Sep 24, 2023
2606f44
* Adding `archive=true` in open/close tabs
puni9869 Sep 24, 2023
298e57c
Update options/locale/locale_en-US.ini
puni9869 Sep 24, 2023
8391fe8
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 25, 2023
8cff26f
* Taking the filter functionality client side in js.
puni9869 Sep 25, 2023
9558658
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 27, 2023
9d6bd3a
Adding the new translation `ctx.Locale.Tr`
puni9869 Sep 27, 2023
979171b
Enhancing user experience.
puni9869 Sep 27, 2023
383ef58
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 28, 2023
d045c0f
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 28, 2023
ccb1945
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 28, 2023
ca9a4b0
Removing dead code
puni9869 Sep 28, 2023
f05329e
Issue filter functionality
puni9869 Sep 28, 2023
4b6ac99
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 28, 2023
3689e1b
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 28, 2023
4538dd8
Linting
puni9869 Sep 28, 2023
010e9b8
Adding archive label hide and show if they are selected :: we will sh…
puni9869 Sep 29, 2023
35d7ea9
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 29, 2023
d614d2a
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 29, 2023
784d389
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 29, 2023
498dc71
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 29, 2023
c272592
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 29, 2023
b474ead
Suggestions and fixed typo
puni9869 Sep 30, 2023
c74c849
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 30, 2023
ffe9e98
Update filters.tmpl
puni9869 Sep 30, 2023
ccf1d0a
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Sep 30, 2023
e4c1416
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Oct 1, 2023
6174205
Merge branch 'main' into punit/issue-filter-label-restructure
puni9869 Oct 1, 2023
0a847a4
Merge branch 'main' into punit/issue-filter-label-restructure
GiteaBot Oct 1, 2023
a90c6c2
Merge branch 'main' into punit/issue-filter-label-restructure
GiteaBot Oct 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,8 @@ issues.label_description = Description
issues.label_color = Color
issues.label_exclusive = Exclusive
issues.label_archive = Archive Label
issues.label_archive_tooltip= Archived labels are excluded from the label search when applying labels to an issue. Existing labels on issues remain unaffected, allowing you to retire obsolete labels without losing information.
issues.label_archived_filter = Show archived labels
issues.label_archive_tooltip = Archived labels are excluded by default from the suggestions when searching by label.
issues.label_exclusive_desc = Name the label <code>scope/item</code> to make it mutually exclusive with other <code>scope/</code> labels.
issues.label_exclusive_warning = Any conflicting scoped labels will be removed when editing the labels of an issue or pull request.
issues.label_count = %d labels
Expand Down
5 changes: 5 additions & 0 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
pager.AddParam(ctx, "project", "ProjectID")
pager.AddParam(ctx, "assignee", "AssigneeID")
pager.AddParam(ctx, "poster", "PosterID")

if ctx.FormBool("archived") {
ctx.Data["ShowArchivedLabels"] = true
pager.AddParam(ctx, "archived", "ShowArchivedLabels")
}
ctx.Data["Page"] = pager
}

Expand Down
130 changes: 130 additions & 0 deletions templates/repo/issue/filter_actions.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<div class="ui secondary filter menu">
{{if not .Repository.IsArchived}}
<!-- Action Button -->
{{if .IsShowClosed}}
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
{{else}}
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
{{end}}
{{if $.IsRepoAdmin}}
<button class="ui red button issue-action"
data-action="delete" data-url="{{$.RepoLink}}/issues/delete"
data-action-delete-confirm="{{ctx.Locale.Tr "confirm_delete_selected"}}"
>{{ctx.Locale.Tr "repo.issues.delete"}}</button>
{{end}}
<!-- Labels -->
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
<span class="text">
{{ctx.Locale.Tr "repo.issues.action_label"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item issue-action" data-action="clear" data-url="{{$.RepoLink}}/issues/labels">
{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}
</div>
{{$previousExclusiveScope := "_no_scope"}}
{{range .Labels}}
{{$exclusiveScope := .ExclusiveScope}}
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
<div class="divider"></div>
{{end}}
{{$previousExclusiveScope = $exclusiveScope}}
<div class="item issue-action gt-df gt-items-start" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
{{if SliceUtils.Contains $.SelLabelIDs .ID}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} {{RenderLabel $.Context .}}
{{if .IsArchived}}
<i data-tooltip-content={{ctx.Locale.Tr "archived"}}>{{svg "octicon-info"}}</i>
{{end}}
</div>
{{end}}
</div>
</div>

<!-- Milestone -->
<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item">
<span class="text">
{{ctx.Locale.Tr "repo.issues.action_milestone"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
{{ctx.Locale.Tr "repo.issues.action_milestone_no_select"}}
</div>
{{if .OpenMilestones}}
<div class="divider"></div>
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
{{range .OpenMilestones}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
{{.Name}}
</div>
{{end}}
{{end}}
{{if .ClosedMilestones}}
<div class="divider"></div>
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
{{range .ClosedMilestones}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
{{.Name}}
</div>
{{end}}
{{end}}
</div>
</div>

<!-- Projects -->
<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
<span class="text">
{{ctx.Locale.Tr "repo.project_board"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}
</div>
{{if .OpenProjects}}
<div class="divider"></div>
<div class="header">
{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
</div>
{{range .OpenProjects}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
</div>
{{end}}
{{end}}
{{if .ClosedProjects}}
<div class="divider"></div>
<div class="header">
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
</div>
{{range .ClosedProjects}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
</div>
{{end}}
{{end}}
</div>
</div>

<!-- Assignees -->
<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
<span class="text">
{{ctx.Locale.Tr "repo.issues.action_assignee"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item issue-action" data-action="clear" data-url="{{$.Link}}/assignee">
{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}
</div>
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
{{ctx.Locale.Tr "repo.issues.action_assignee_no_select"}}
</div>
{{range .Assignees}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
</div>
{{end}}
</div>
</div>
{{end}}
</div>

Loading