Skip to content

Commit bc1d6fb

Browse files
authored
Merge branch 'main' into lunny/add_org_list
2 parents 95f6f3f + 5d57c28 commit bc1d6fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1265
-1208
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,12 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
377377
.PHONY: lint-js
378378
lint-js: node_modules
379379
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
380-
# npx tsc
380+
# npx vue-tsc
381381

382382
.PHONY: lint-js-fix
383383
lint-js-fix: node_modules
384384
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
385-
# npx tsc
385+
# npx vue-tsc
386386

387387
.PHONY: lint-css
388388
lint-css: node_modules
@@ -451,6 +451,10 @@ lint-templates: .venv node_modules
451451
lint-yaml: .venv
452452
@poetry run yamllint .
453453

454+
.PHONY: tsc
455+
tsc:
456+
npx vue-tsc
457+
454458
.PHONY: watch
455459
watch:
456460
@bash tools/watch.sh

assets/go-licenses.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/activities/action.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (a *Action) LoadActUser(ctx context.Context) {
200200
}
201201
}
202202

203-
func (a *Action) loadRepo(ctx context.Context) {
203+
func (a *Action) LoadRepo(ctx context.Context) {
204204
if a.Repo != nil {
205205
return
206206
}
@@ -250,7 +250,7 @@ func (a *Action) GetActDisplayNameTitle(ctx context.Context) string {
250250

251251
// GetRepoUserName returns the name of the action repository owner.
252252
func (a *Action) GetRepoUserName(ctx context.Context) string {
253-
a.loadRepo(ctx)
253+
a.LoadRepo(ctx)
254254
if a.Repo == nil {
255255
return "(non-existing-repo)"
256256
}
@@ -265,7 +265,7 @@ func (a *Action) ShortRepoUserName(ctx context.Context) string {
265265

266266
// GetRepoName returns the name of the action repository.
267267
func (a *Action) GetRepoName(ctx context.Context) string {
268-
a.loadRepo(ctx)
268+
a.LoadRepo(ctx)
269269
if a.Repo == nil {
270270
return "(non-existing-repo)"
271271
}
@@ -644,7 +644,7 @@ func NotifyWatchers(ctx context.Context, actions ...*Action) error {
644644
}
645645

646646
if repoChanged {
647-
act.loadRepo(ctx)
647+
act.LoadRepo(ctx)
648648
repo = act.Repo
649649

650650
// check repo owner exist.

models/issues/comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ func FindComments(ctx context.Context, opts *FindCommentsOptions) (CommentList,
11081108
sess.Join("INNER", "issue", "issue.id = comment.issue_id")
11091109
}
11101110

1111-
if opts.Page != 0 {
1111+
if opts.Page > 0 {
11121112
sess = db.SetSessionPagination(sess, opts)
11131113
}
11141114

models/issues/comment_code.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"context"
88

99
"code.gitea.io/gitea/models/db"
10+
"code.gitea.io/gitea/models/renderhelper"
1011
user_model "code.gitea.io/gitea/models/user"
11-
"code.gitea.io/gitea/modules/markup"
1212
"code.gitea.io/gitea/modules/markup/markdown"
1313

1414
"xorm.io/builder"
@@ -112,12 +112,8 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
112112
}
113113

114114
var err error
115-
rctx := markup.NewRenderContext(ctx).
116-
WithRepoFacade(issue.Repo).
117-
WithLinks(markup.Links{Base: issue.Repo.Link()}).
118-
WithMetas(issue.Repo.ComposeMetas(ctx))
119-
if comment.RenderedContent, err = markdown.RenderString(rctx,
120-
comment.Content); err != nil {
115+
rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo)
116+
if comment.RenderedContent, err = markdown.RenderString(rctx, comment.Content); err != nil {
121117
return nil, err
122118
}
123119
}

models/issues/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ func (issue *Issue) BlockedByDependencies(ctx context.Context, opts db.ListOptio
641641
Where("issue_id = ?", issue.ID).
642642
// sort by repo id then created date, with the issues of the same repo at the beginning of the list
643643
OrderBy("CASE WHEN issue.repo_id = ? THEN 0 ELSE issue.repo_id END, issue.created_unix DESC", issue.RepoID)
644-
if opts.Page != 0 {
644+
if opts.Page > 0 {
645645
sess = db.SetSessionPagination(sess, &opts)
646646
}
647647
err = sess.Find(&issueDeps)

models/issues/issue_watch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func GetIssueWatchers(ctx context.Context, issueID int64, listOptions db.ListOpt
105105
And("`user`.prohibit_login = ?", false).
106106
Join("INNER", "`user`", "`user`.id = `issue_watch`.user_id")
107107

108-
if listOptions.Page != 0 {
108+
if listOptions.Page > 0 {
109109
sess = db.SetSessionPagination(sess, &listOptions)
110110
watches := make([]*IssueWatch, 0, listOptions.PageSize)
111111
return watches, sess.Find(&watches)

models/issues/label.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func GetLabelsByRepoID(ctx context.Context, repoID int64, sortType string, listO
390390
sess.Asc("name")
391391
}
392392

393-
if listOptions.Page != 0 {
393+
if listOptions.Page > 0 {
394394
sess = db.SetSessionPagination(sess, &listOptions)
395395
}
396396

@@ -462,7 +462,7 @@ func GetLabelsByOrgID(ctx context.Context, orgID int64, sortType string, listOpt
462462
sess.Asc("name")
463463
}
464464

465-
if listOptions.Page != 0 {
465+
if listOptions.Page > 0 {
466466
sess = db.SetSessionPagination(sess, &listOptions)
467467
}
468468

models/issues/reaction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func FindReactions(ctx context.Context, opts FindReactionsOptions) (ReactionList
163163
Where(opts.toConds()).
164164
In("reaction.`type`", setting.UI.Reactions).
165165
Asc("reaction.issue_id", "reaction.comment_id", "reaction.created_unix", "reaction.id")
166-
if opts.Page != 0 {
166+
if opts.Page > 0 {
167167
sess = db.SetSessionPagination(sess, &opts)
168168

169169
reactions := make([]*Reaction, 0, opts.PageSize)

models/issues/stopwatch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func GetUIDsAndStopwatch(ctx context.Context) ([]*UserStopwatch, error) {
9696
func GetUserStopwatches(ctx context.Context, userID int64, listOptions db.ListOptions) ([]*Stopwatch, error) {
9797
sws := make([]*Stopwatch, 0, 8)
9898
sess := db.GetEngine(ctx).Where("stopwatch.user_id = ?", userID)
99-
if listOptions.Page != 0 {
99+
if listOptions.Page > 0 {
100100
sess = db.SetSessionPagination(sess, &listOptions)
101101
}
102102

0 commit comments

Comments
 (0)