Change magic number since -2 has some internal meaning

This commit is contained in:
Andreas Svanberg 2025-02-23 20:28:02 +01:00
parent dbab806c2d
commit 6929edabb9
No known key found for this signature in database
GPG Key ID: 729B051CFFD42F92
3 changed files with 6 additions and 6 deletions

View File

@ -32,8 +32,8 @@ const NoConditionID int64 = -1
// AnyConditionID means a condition to filter the records which match any id.
// The inverse of the above NoConditionID
// eg: "assignee_id=-2" means "find the issues with an assignee"
const AnyConditionID int64 = -2
// eg: "assignee_id=-1000001" means "find the issues with an assignee"
const AnyConditionID int64 = -1000001
// NonExistingID means a condition to match no result (eg: a non-existing user)
// It doesn't use -1 or -2 because they are used as builtin users.

View File

@ -6,7 +6,7 @@
* TextFilterTitle
* TextZeroValue: the text for "all issues"
* TextNegativeOne: the text for "issues with no assignee"
* TextNegativeTwo: the text for "issues with any assignee"
* TextAnyCondition: the text for "issues with any assignee"
*/}}
{{$queryLink := .QueryLink}}
<div class="item ui dropdown jump {{if not .UserSearchList}}disabled{{end}}">
@ -22,8 +22,8 @@
{{if $.TextNegativeOne}}
<a class="item {{if eq .SelectedUserId -1}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey -1}}">{{$.TextNegativeOne}}</a>
{{end}}
{{if $.TextNegativeTwo}}
<a class="item {{if eq .SelectedUserId -2}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey -2}}">{{$.TextNegativeTwo}}</a>
{{if $.TextAnyCondition}}
<a class="item {{if eq .SelectedUserId -1000001}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey -1000001}}">{{$.TextAnyCondition}}</a>
{{end}}
<div class="divider"></div>
{{range .UserSearchList}}

View File

@ -96,7 +96,7 @@
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
"TextZeroValue" (ctx.Locale.Tr "repo.issues.filter_assginee_no_select")
"TextNegativeOne" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
"TextNegativeTwo" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
"TextAnyCondition" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
}}
{{if .IsSigned}}