Skip to content

Commit 56f1611

Browse files
author
Earl Warren
committed
Merge pull request '[gitea] cherry-pick' (go-gitea#2337) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2337 Reviewed-by: Otto <[email protected]>
2 parents 41cc978 + e9e6c61 commit 56f1611

File tree

11 files changed

+189
-161
lines changed

11 files changed

+189
-161
lines changed

.eslintrc.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ rules:
558558
prefer-rest-params: [2]
559559
prefer-spread: [2]
560560
prefer-template: [2]
561-
quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
562561
radix: [2, as-needed]
563562
regexp/confusing-quantifier: [2]
564563
regexp/control-character-escape: [2]

models/issues/comment.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,15 @@ func (c *Comment) LoadReactions(ctx context.Context, repo *repo_model.Repository
695695
}
696696

697697
func (c *Comment) loadReview(ctx context.Context) (err error) {
698+
if c.ReviewID == 0 {
699+
return nil
700+
}
698701
if c.Review == nil {
699702
if c.Review, err = GetReviewByID(ctx, c.ReviewID); err != nil {
703+
// review request which has been replaced by actual reviews doesn't exist in database anymore, so ignorem them.
704+
if c.Type == CommentTypeReviewRequest {
705+
return nil
706+
}
700707
return err
701708
}
702709
}

models/issues/comment_list.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ func (comments CommentList) loadReviews(ctx context.Context) error {
430430
for _, comment := range comments {
431431
comment.Review = reviews[comment.ReviewID]
432432
if comment.Review == nil {
433-
if comment.ReviewID > 0 {
433+
// review request which has been replaced by actual reviews doesn't exist in database anymore, so don't log errors for them.
434+
if comment.ReviewID > 0 && comment.Type != CommentTypeReviewRequest {
434435
log.Error("comment with review id [%d] but has no review record", comment.ReviewID)
435436
}
436437
continue

models/issues/review.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,9 @@ func AddReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_mo
621621
return nil, err
622622
}
623623

624+
// func caller use the created comment to retrieve created review too.
625+
comment.Review = review
626+
624627
return comment, committer.Commit()
625628
}
626629

options/locale/locale_el-GR.ini

Lines changed: 38 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

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

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
"jquery": "3.7.1",
3030
"katex": "0.16.9",
3131
"license-checker-webpack-plugin": "0.2.1",
32-
"mermaid": "10.7.0",
32+
"mermaid": "10.8.0",
3333
"mini-css-extract-plugin": "2.8.0",
3434
"minimatch": "9.0.3",
35-
"monaco-editor": "0.45.0",
35+
"monaco-editor": "0.46.0",
3636
"monaco-editor-webpack-plugin": "7.1.0",
3737
"pdfobject": "2.2.12",
3838
"pretty-ms": "9.0.0",
3939
"sortablejs": "1.15.2",
40-
"swagger-ui-dist": "5.11.2",
40+
"swagger-ui-dist": "5.11.3",
4141
"throttle-debounce": "5.0.0",
4242
"tinycolor2": "1.6.0",
4343
"tippy.js": "6.3.7",
4444
"toastify-js": "1.12.0",
4545
"tributejs": "5.1.3",
4646
"uint8-to-base64": "0.2.0",
47-
"vue": "3.4.15",
47+
"vue": "3.4.18",
4848
"vue-bar-graph": "2.0.0",
4949
"vue-loader": "17.4.2",
5050
"vue3-calendar-heatmap": "2.0.5",
@@ -54,11 +54,11 @@
5454
},
5555
"devDependencies": {
5656
"@eslint-community/eslint-plugin-eslint-comments": "4.1.0",
57-
"@playwright/test": "1.41.1",
57+
"@playwright/test": "1.41.2",
5858
"@stoplight/spectral-cli": "6.11.0",
59-
"@stylistic/eslint-plugin-js": "1.5.4",
59+
"@stylistic/eslint-plugin-js": "1.6.1",
6060
"@stylistic/stylelint-plugin": "2.0.0",
61-
"@vitejs/plugin-vue": "5.0.3",
61+
"@vitejs/plugin-vue": "5.0.4",
6262
"eslint": "8.56.0",
6363
"eslint-plugin-array-func": "4.0.0",
6464
"eslint-plugin-i": "2.29.1",
@@ -67,8 +67,8 @@
6767
"eslint-plugin-no-use-extend-native": "0.5.0",
6868
"eslint-plugin-regexp": "2.2.0",
6969
"eslint-plugin-sonarjs": "0.23.0",
70-
"eslint-plugin-unicorn": "50.0.1",
71-
"eslint-plugin-vitest": "0.3.21",
70+
"eslint-plugin-unicorn": "51.0.1",
71+
"eslint-plugin-vitest": "0.3.22",
7272
"eslint-plugin-vitest-globals": "1.4.0",
7373
"eslint-plugin-vue": "9.21.1",
7474
"eslint-plugin-vue-scoped-css": "2.7.2",
@@ -80,8 +80,8 @@
8080
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
8181
"stylelint-declaration-strict-value": "1.10.4",
8282
"svgo": "3.2.0",
83-
"updates": "15.1.1",
84-
"vite-string-plugin": "1.1.3",
83+
"updates": "15.1.2",
84+
"vite-string-plugin": "1.1.5",
8585
"vitest": "1.2.2"
8686
},
8787
"browserslist": [

poetry.lock

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ python = "^3.8"
99

1010
[tool.poetry.group.dev.dependencies]
1111
djlint = "1.34.1"
12-
yamllint = "1.33.0"
12+
yamllint = "1.34.0"
1313

1414
[tool.djlint]
1515
profile="golang"

templates/repo/commits_list.tmpl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@
7878
{{end}}
7979
<td class="text right aligned gt-py-0">
8080
<button class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
81-
{{if $.FileName}}
82-
<a class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) (PathEscapeSegments $.FileName)}}">{{svg "octicon-file-code"}}</a>
83-
{{end}}
81+
<a
82+
class="btn interact-bg gt-p-3"
83+
data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}"
84+
href="{{if $.FileName}}{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) (PathEscapeSegments $.FileName)}}{{else}}{{printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}{{end}}">
85+
{{svg "octicon-file-code"}}
86+
</a>
8487
</td>
8588
</tr>
8689
{{end}}

templates/repo/settings/navbar.tmpl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
{{ctx.Locale.Tr "repo.settings.hooks"}}
3030
</a>
3131
{{end}}
32-
{{if and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (not .Repository.IsEmpty)}}
33-
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
34-
{{ctx.Locale.Tr "repo.settings.branches"}}
35-
</a>
32+
{{if .Repository.UnitEnabled $.Context $.UnitTypeCode}}
33+
{{if not .Repository.IsEmpty}}
34+
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
35+
{{ctx.Locale.Tr "repo.settings.branches"}}
36+
</a>
37+
{{end}}
3638
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
3739
{{ctx.Locale.Tr "repo.settings.tags"}}
3840
</a>

0 commit comments

Comments
 (0)