Skip to content

Commit 3b6754c

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated translations via Crowdin bump x/crypto & x/oauth2 (go-gitea#33704) Optimize user dashboard loading (go-gitea#33686) Add No Results Prompt Message on Issue List Page (go-gitea#33699)
2 parents ce3368f + 38ccc8e commit 3b6754c

File tree

7 files changed

+59
-19
lines changed

7 files changed

+59
-19
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ require (
117117
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
118118
github.com/yuin/goldmark-meta v1.1.0
119119
gitlab.com/gitlab-org/api/client-go v0.123.0
120-
golang.org/x/crypto v0.33.0
120+
golang.org/x/crypto v0.35.0
121121
golang.org/x/image v0.24.0
122122
golang.org/x/net v0.35.0
123-
golang.org/x/oauth2 v0.26.0
123+
golang.org/x/oauth2 v0.27.0
124124
golang.org/x/sync v0.11.0
125125
golang.org/x/sys v0.30.0
126126
golang.org/x/text v0.22.0

go.sum

+4-3
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,9 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
831831
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
832832
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
833833
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
834-
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
835834
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
835+
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
836+
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
836837
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrCPyJZ+eyRsABUPs1mz4=
837838
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
838839
golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ=
@@ -868,8 +869,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
868869
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
869870
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
870871
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
871-
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
872-
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
872+
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
873+
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
873874
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
874875
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
875876
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

models/activities/action.go

+19-11
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,24 @@ func ActivityReadable(user, doer *user_model.User) bool {
454454
doer != nil && (doer.IsAdmin || user.ID == doer.ID)
455455
}
456456

457+
func FeedDateCond(opts GetFeedsOptions) builder.Cond {
458+
cond := builder.NewCond()
459+
if opts.Date == "" {
460+
return cond
461+
}
462+
463+
dateLow, err := time.ParseInLocation("2006-01-02", opts.Date, setting.DefaultUILocation)
464+
if err != nil {
465+
log.Warn("Unable to parse %s, filter not applied: %v", opts.Date, err)
466+
} else {
467+
dateHigh := dateLow.Add(86399000000000) // 23h59m59s
468+
469+
cond = cond.And(builder.Gte{"`action`.created_unix": dateLow.Unix()})
470+
cond = cond.And(builder.Lte{"`action`.created_unix": dateHigh.Unix()})
471+
}
472+
return cond
473+
}
474+
457475
func ActivityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.Cond, error) {
458476
cond := builder.NewCond()
459477

@@ -534,17 +552,7 @@ func ActivityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.
534552
cond = cond.And(builder.Eq{"is_deleted": false})
535553
}
536554

537-
if opts.Date != "" {
538-
dateLow, err := time.ParseInLocation("2006-01-02", opts.Date, setting.DefaultUILocation)
539-
if err != nil {
540-
log.Warn("Unable to parse %s, filter not applied: %v", opts.Date, err)
541-
} else {
542-
dateHigh := dateLow.Add(86399000000000) // 23h59m59s
543-
544-
cond = cond.And(builder.Gte{"`action`.created_unix": dateLow.Unix()})
545-
cond = cond.And(builder.Lte{"`action`.created_unix": dateHigh.Unix()})
546-
}
547-
}
555+
cond = cond.And(FeedDateCond(opts))
548556

549557
return cond, nil
550558
}

models/activities/action_list.go

+25-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,31 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
208208
return nil, 0, fmt.Errorf("need at least one of these filters: RequestedUser, RequestedTeam, RequestedRepo")
209209
}
210210

211-
cond, err := ActivityQueryCondition(ctx, opts)
212-
if err != nil {
213-
return nil, 0, err
211+
var err error
212+
var cond builder.Cond
213+
// if the actor is the requested user or is an administrator, we can skip the ActivityQueryCondition
214+
if opts.Actor != nil && opts.RequestedUser != nil && (opts.Actor.IsAdmin || opts.Actor.ID == opts.RequestedUser.ID) {
215+
cond = builder.Eq{
216+
"user_id": opts.RequestedUser.ID,
217+
}.And(
218+
FeedDateCond(opts),
219+
)
220+
221+
if !opts.IncludeDeleted {
222+
cond = cond.And(builder.Eq{"is_deleted": false})
223+
}
224+
225+
if !opts.IncludePrivate {
226+
cond = cond.And(builder.Eq{"is_private": false})
227+
}
228+
if opts.OnlyPerformedBy {
229+
cond = cond.And(builder.Eq{"act_user_id": opts.RequestedUser.ID})
230+
}
231+
} else {
232+
cond, err = ActivityQueryCondition(ctx, opts)
233+
if err != nil {
234+
return nil, 0, err
235+
}
214236
}
215237

216238
actions := make([]*Action, 0, opts.PageSize)

options/locale/locale_en-US.ini

+2
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,8 @@ issues.filter_milestones = Filter Milestone
14651465
issues.filter_projects = Filter Project
14661466
issues.filter_labels = Filter Label
14671467
issues.filter_reviewers = Filter Reviewer
1468+
issues.filter_no_results = No results
1469+
issues.filter_no_results_placeholder = Try adjusting your search filters.
14681470
issues.new = New Issue
14691471
issues.new.title_empty = Title cannot be empty
14701472
issues.new.labels = Labels

options/locale/locale_fr-FR.ini

+2
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,9 @@ issues.time_estimate_invalid=Le format du temps estimé est invalide
17011701
issues.start_tracking_history=`a commencé son travail %s.`
17021702
issues.tracker_auto_close=Le minuteur sera automatiquement arrêté quand le ticket sera fermé.
17031703
issues.tracking_already_started=`Vous avez déjà un minuteur en cours sur <a href="%s">un autre ticket</a> !`
1704+
issues.stop_tracking=Arrêter le minuteur
17041705
issues.stop_tracking_history=a travaillé sur <b>%[1]s</b> %[2]s
1706+
issues.cancel_tracking=Abandonner
17051707
issues.cancel_tracking_history=`a abandonné son minuteur %s.`
17061708
issues.del_time=Supprimer ce minuteur du journal
17071709
issues.add_time_history=a pointé du temps de travail sur <b>%[1]s</b>, %[2]s

templates/shared/issuelist.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@
153153
</div>
154154
{{end}}
155155
</div>
156+
{{else}}
157+
<div class="tw-text-center tw-p-8">
158+
<h3 class="tw-my-4">{{ctx.Locale.Tr "repo.issues.filter_no_results"}}</h3>
159+
<p class="tw-text-placeholder-text">{{ctx.Locale.Tr "repo.issues.filter_no_results_placeholder"}}</p>
160+
</div>
156161
{{end}}
157162
{{if .IssueIndexerUnavailable}}
158163
<div class="ui error message">

0 commit comments

Comments
 (0)