-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Refactor authors dropdown (send get request from frontend to avoid long wait time) #23890
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
Merged
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
2b37b10
save changes
HesterG c7ae8bf
Merge branch 'go-gitea:main' into get-posters-fe
HesterG b737121
save
HesterG 0840d53
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 62c030c
save changes
HesterG 0cc99b1
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 9601ec6
move position of get posters
HesterG 5d01552
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 5c55c62
comment
HesterG 0a28191
lints
HesterG cc66388
remove console
HesterG bb26b17
save changes for dropdown
HesterG 886543e
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 4634fa4
test native
HesterG e94588f
fomantic dropdown demo
HesterG f45d666
comment
HesterG 37e82fe
comment
HesterG d0c121a
Merge branch 'go-gitea:main' into get-posters-fe
HesterG fefb59e
use dropdown setting
HesterG e752acc
change posters to milestone
HesterG 7e9c9f1
Merge branch 'go-gitea:main' into get-posters-fe
HesterG d352b42
remove console logs
HesterG c6c485d
remove test
HesterG 823bcf7
Merge branch 'go-gitea:main' into get-posters-fe
HesterG e619f6a
remove comments
HesterG d30b3b4
add aria
HesterG f1e53c2
Merge branch 'go-gitea:main' into get-posters-fe
HesterG ad83d13
onresponse demo
HesterG 3abfabb
demo
HesterG f096140
modify
HesterG 5259ae9
save for now
HesterG cbde0de
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 02643be
remove onresponse demo
HesterG 9322b30
Merge branch 'go-gitea:main' into get-posters-fe
HesterG e08561c
fullname logic
HesterG 7e7868c
remove unnecessary
HesterG 33df17b
comments
HesterG 03a9654
comments
HesterG 4a27cd1
Merge branch 'go-gitea:main' into get-posters-fe
HesterG c168591
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 88dbd4f
fix pulls param
HesterG 1fa5f30
remove print
HesterG 8d41150
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 87e55e1
comments
HesterG 547b34a
Merge branch 'go-gitea:main' into get-posters-fe
HesterG 7eec9e7
use native for now
HesterG 8e8ab90
add tooltip
HesterG a9d4e01
tooltip add to milestone issues
HesterG c1f82df
reset input
HesterG 74f5a8f
lint
HesterG 1192718
comment
HesterG 5a6d303
add missing id to milestone issues
HesterG b184a07
move .length
HesterG 4fb76f5
move .length
HesterG 23831e5
fix lint
HesterG 2baaa7f
only get necesssary columns from database
HesterG bb97213
use builder.like
HesterG 3cda924
remove autocomplete
HesterG 1884ffd
Merge branch 'go-gitea:main' into get-posters-fe
HesterG e670baa
change orderby
HesterG cea1970
avoid using same name
HesterG 75ec73a
Merge branch 'main' into get-posters-fe
HesterG 76dc49d
update tooltip text
HesterG 4065249
refactor
wxiaoguang bebc99a
use aria framework to provide autocomplete=off
wxiaoguang 5d29c6e
refactor
wxiaoguang be6791f
refactor
wxiaoguang 8daf6bd
more fixes
wxiaoguang aa878d5
clean up
wxiaoguang 454091f
clean up
wxiaoguang dbbeb49
fine tune
wxiaoguang 2702687
fix lint
wxiaoguang 3e6451a
fix lint
wxiaoguang 1d396ad
modify dom css for options, remove data-selected-user-id, add throttle
HesterG 0851d20
Merge branch 'main' into get-posters-fe
HesterG 28594c8
add aria-hidden to avatar img, use DOM operation instead of for loop
wxiaoguang 8481c35
use onshow to show default options and add active class to selected o…
HesterG eaa90b8
respect selected user id
wxiaoguang ea440c2
always add self
wxiaoguang e0fba04
show self on top
wxiaoguang ca8b857
show self on top
wxiaoguang aa8dca3
revert mistakes
wxiaoguang 6789a61
patch fomantic api bug
wxiaoguang c0cd3a4
fix lint
wxiaoguang 61c0d9d
fine tune avatar size
wxiaoguang 4811e8a
fine tune avatar size
wxiaoguang 288f301
fix issue sidebar avatar
wxiaoguang 5bfd0b0
Update templates/repo/issue/list.tmpl
silverwind 37141e4
Update templates/repo/issue/milestone_issues.tmpl
silverwind cc4a1fa
add comment for adding self
wxiaoguang c1865b9
Merge branch 'main' into get-posters-fe
lunny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package repo | ||
|
||
import ( | ||
"sort" | ||
|
||
"code.gitea.io/gitea/models/user" | ||
"code.gitea.io/gitea/modules/context" | ||
) | ||
|
||
func makeSelfOnTop(ctx *context.Context, users []*user.User) []*user.User { | ||
if ctx.Doer != nil { | ||
sort.Slice(users, func(i, j int) bool { | ||
if users[i].ID == users[j].ID { | ||
return false | ||
} | ||
return users[i].ID == ctx.Doer.ID // if users[i] is self, put it before others, so less=true | ||
}) | ||
} | ||
return users | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package repo | ||
|
||
import ( | ||
"testing" | ||
|
||
"code.gitea.io/gitea/models/user" | ||
"code.gitea.io/gitea/modules/context" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestMakeSelfOnTop(t *testing.T) { | ||
users := makeSelfOnTop(&context.Context{}, []*user.User{{ID: 2}, {ID: 1}}) | ||
assert.Len(t, users, 2) | ||
assert.EqualValues(t, 2, users[0].ID) | ||
|
||
users = makeSelfOnTop(&context.Context{Doer: &user.User{ID: 1}}, []*user.User{{ID: 2}, {ID: 1}}) | ||
assert.Len(t, users, 2) | ||
assert.EqualValues(t, 1, users[0].ID) | ||
|
||
users = makeSelfOnTop(&context.Context{Doer: &user.User{ID: 2}}, []*user.User{{ID: 2}, {ID: 1}}) | ||
assert.Len(t, users, 2) | ||
assert.EqualValues(t, 2, users[0].ID) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.