mirror of https://github.com/go-gitea/gitea.git
Merge branch 'main' into xormigrate
This commit is contained in:
commit
980a813d2c
2
Makefile
2
Makefile
|
@ -887,6 +887,8 @@ update-js: node-check | node_modules
|
|||
npx updates -u -f package.json
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install --package-lock
|
||||
npx nolyfill install
|
||||
npm install --package-lock
|
||||
@touch node_modules
|
||||
|
||||
.PHONY: update-py
|
||||
|
|
|
@ -44,6 +44,12 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
|
|||
searchOpt.ProjectID = optional.Some[int64](0) // Those issues with no project(projectid==0)
|
||||
}
|
||||
|
||||
if opts.AssigneeID > 0 {
|
||||
searchOpt.AssigneeID = optional.Some(opts.AssigneeID)
|
||||
} else if opts.AssigneeID == -1 { // FIXME: this is inconsistent from other places
|
||||
searchOpt.AssigneeID = optional.Some[int64](0)
|
||||
}
|
||||
|
||||
// See the comment of issues_model.SearchOptions for the reason why we need to convert
|
||||
convertID := func(id int64) optional.Option[int64] {
|
||||
if id > 0 {
|
||||
|
@ -57,7 +63,6 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
|
|||
|
||||
searchOpt.ProjectColumnID = convertID(opts.ProjectColumnID)
|
||||
searchOpt.PosterID = convertID(opts.PosterID)
|
||||
searchOpt.AssigneeID = convertID(opts.AssigneeID)
|
||||
searchOpt.MentionID = convertID(opts.MentionedID)
|
||||
searchOpt.ReviewedID = convertID(opts.ReviewedID)
|
||||
searchOpt.ReviewRequestedID = convertID(opts.ReviewRequestedID)
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/issues"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
"code.gitea.io/gitea/modules/indexer/issues/internal"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
|
@ -188,6 +189,11 @@ func searchIssueByID(t *testing.T) {
|
|||
},
|
||||
expectedIDs: []int64{6, 1},
|
||||
},
|
||||
{
|
||||
// NOTE: This tests no assignees filtering and also ToSearchOptions() to ensure it will set AssigneeID to 0 when it is passed as -1.
|
||||
opts: *ToSearchOptions("", &issues.IssuesOptions{AssigneeID: -1}),
|
||||
expectedIDs: []int64{22, 21, 16, 15, 14, 13, 12, 11, 20, 5, 19, 18, 10, 7, 4, 9, 8, 3, 2},
|
||||
},
|
||||
{
|
||||
opts: SearchOptions{
|
||||
MentionID: optional.Some(int64(4)),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
|
@ -100,6 +100,7 @@
|
|||
"eslint-plugin-wc": "2.1.0",
|
||||
"happy-dom": "14.12.3",
|
||||
"markdownlint-cli": "0.41.0",
|
||||
"nolyfill": "1.0.39",
|
||||
"postcss-html": "1.7.0",
|
||||
"stylelint": "16.6.1",
|
||||
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
|
||||
|
@ -112,5 +113,23 @@
|
|||
},
|
||||
"browserslist": [
|
||||
"defaults"
|
||||
]
|
||||
],
|
||||
"overrides": {
|
||||
"array-includes": "npm:@nolyfill/array-includes@^1",
|
||||
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@^1",
|
||||
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@^1",
|
||||
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@^1",
|
||||
"deep-equal": "npm:@nolyfill/deep-equal@^1",
|
||||
"es-aggregate-error": "npm:@nolyfill/es-aggregate-error@^1",
|
||||
"es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@^1",
|
||||
"hasown": "npm:@nolyfill/hasown@^1",
|
||||
"object.assign": "npm:@nolyfill/object.assign@^1",
|
||||
"object.entries": "npm:@nolyfill/object.entries@^1",
|
||||
"object.fromentries": "npm:@nolyfill/object.fromentries@^1",
|
||||
"object.groupby": "npm:@nolyfill/object.groupby@^1",
|
||||
"object.values": "npm:@nolyfill/object.values@^1",
|
||||
"safe-regex-test": "npm:@nolyfill/safe-regex-test@^1",
|
||||
"string.prototype.includes": "npm:@nolyfill/string.prototype.includes@^1",
|
||||
"is-core-module": "npm:@nolyfill/is-core-module@^1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue