Skip to content

Commit 83ac984

Browse files
authored
Merge branch 'main' into fix-scoped-label-ui
2 parents 5f80c81 + 14ed553 commit 83ac984

File tree

21 files changed

+313
-716
lines changed

21 files changed

+313
-716
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ module.exports = {
674674
'no-this-before-super': [2],
675675
'no-throw-literal': [2],
676676
'no-undef-init': [2],
677-
'no-undef': [0],
677+
'no-undef': [2], // it is still needed by eslint & IDE to prompt undefined names in real time
678678
'no-undefined': [0],
679679
'no-underscore-dangle': [0],
680680
'no-unexpected-multiline': [2],

options/locale/locale_pt-PT.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,8 +1922,8 @@ pulls.close=Encerrar pedido de integração
19221922
pulls.closed_at=`fechou este pedido de integração <a id="%[1]s" href="#%[1]s">%[2]s</a>`
19231923
pulls.reopened_at=`reabriu este pedido de integração <a id="%[1]s" href="#%[1]s">%[2]s</a>`
19241924
pulls.cmd_instruction_hint=`Ver <a class="show-instruction">instruções para a linha de comandos</a>.`
1925-
pulls.cmd_instruction_checkout_title=Conferir
1926-
pulls.cmd_instruction_checkout_desc=No seu repositório, irá criar um novo ramo para que possa testar as modificações.
1925+
pulls.cmd_instruction_checkout_title=Checkout
1926+
pulls.cmd_instruction_checkout_desc=A partir do seu repositório, crie um novo ramo e teste nele as modificações.
19271927
pulls.cmd_instruction_merge_title=Integrar
19281928
pulls.cmd_instruction_merge_desc=Integrar as modificações e enviar para o Gitea.
19291929
pulls.cmd_instruction_merge_warning=Aviso: Esta operação não pode executar pedidos de integração porque "auto-identificar integração manual" não estava habilitado
@@ -1946,6 +1946,8 @@ pulls.delete.title=Eliminar este pedido de integração?
19461946
pulls.delete.text=Tem a certeza que quer eliminar este pedido de integração? Isso irá remover todo o conteúdo permanentemente. Como alternativa considere fechá-lo, se pretender mantê-lo em arquivo.
19471947

19481948
pulls.recently_pushed_new_branches=Enviou para o ramo <strong>%[1]s</strong> %[2]s
1949+
pulls.upstream_diverging_prompt_behind_1=Este ramo está %[1]d cometimento atrás de %[2]s
1950+
pulls.upstream_diverging_prompt_behind_n=Este ramo está %[1]d cometimentos atrás de %[2]s
19491951
pulls.upstream_diverging_prompt_base_newer=O ramo base %s tem novas modificações
19501952
pulls.upstream_diverging_merge=Sincronizar derivação
19511953

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"eslint": "8.57.0",
8787
"eslint-import-resolver-typescript": "3.7.0",
8888
"eslint-plugin-array-func": "4.0.0",
89-
"eslint-plugin-github": "5.1.4",
89+
"eslint-plugin-github": "5.0.2",
9090
"eslint-plugin-import-x": "4.6.1",
9191
"eslint-plugin-no-jquery": "3.1.0",
9292
"eslint-plugin-no-use-extend-native": "0.5.0",

routers/web/devtest/devtest.go

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import (
99
"strings"
1010
"time"
1111

12+
"code.gitea.io/gitea/models/asymkey"
13+
"code.gitea.io/gitea/models/db"
14+
user_model "code.gitea.io/gitea/models/user"
15+
"code.gitea.io/gitea/modules/git"
1216
"code.gitea.io/gitea/modules/templates"
1317
"code.gitea.io/gitea/services/context"
1418
)
@@ -41,16 +45,85 @@ func FetchActionTest(ctx *context.Context) {
4145
ctx.JSONRedirect("")
4246
}
4347

44-
func Tmpl(ctx *context.Context) {
45-
now := time.Now()
46-
ctx.Data["TimeNow"] = now
47-
ctx.Data["TimePast5s"] = now.Add(-5 * time.Second)
48-
ctx.Data["TimeFuture5s"] = now.Add(5 * time.Second)
49-
ctx.Data["TimePast2m"] = now.Add(-2 * time.Minute)
50-
ctx.Data["TimeFuture2m"] = now.Add(2 * time.Minute)
51-
ctx.Data["TimePast1y"] = now.Add(-1 * 366 * 86400 * time.Second)
52-
ctx.Data["TimeFuture1y"] = now.Add(1 * 366 * 86400 * time.Second)
48+
func prepareMockData(ctx *context.Context) {
49+
if ctx.Req.URL.Path == "/devtest/gitea-ui" {
50+
now := time.Now()
51+
ctx.Data["TimeNow"] = now
52+
ctx.Data["TimePast5s"] = now.Add(-5 * time.Second)
53+
ctx.Data["TimeFuture5s"] = now.Add(5 * time.Second)
54+
ctx.Data["TimePast2m"] = now.Add(-2 * time.Minute)
55+
ctx.Data["TimeFuture2m"] = now.Add(2 * time.Minute)
56+
ctx.Data["TimePast1y"] = now.Add(-1 * 366 * 86400 * time.Second)
57+
ctx.Data["TimeFuture1y"] = now.Add(1 * 366 * 86400 * time.Second)
58+
}
59+
60+
if ctx.Req.URL.Path == "/devtest/commit-sign-badge" {
61+
var commits []*asymkey.SignCommit
62+
mockUsers, _ := db.Find[user_model.User](ctx, user_model.SearchUserOptions{ListOptions: db.ListOptions{PageSize: 1}})
63+
mockUser := mockUsers[0]
64+
commits = append(commits, &asymkey.SignCommit{
65+
Verification: &asymkey.CommitVerification{},
66+
UserCommit: &user_model.UserCommit{
67+
Commit: &git.Commit{ID: git.Sha1ObjectFormat.EmptyObjectID()},
68+
},
69+
})
70+
commits = append(commits, &asymkey.SignCommit{
71+
Verification: &asymkey.CommitVerification{
72+
Verified: true,
73+
Reason: "name / key-id",
74+
SigningUser: mockUser,
75+
SigningKey: &asymkey.GPGKey{KeyID: "12345678"},
76+
TrustStatus: "trusted",
77+
},
78+
UserCommit: &user_model.UserCommit{
79+
User: mockUser,
80+
Commit: &git.Commit{ID: git.Sha1ObjectFormat.EmptyObjectID()},
81+
},
82+
})
83+
commits = append(commits, &asymkey.SignCommit{
84+
Verification: &asymkey.CommitVerification{
85+
Verified: true,
86+
Reason: "name / key-id",
87+
SigningUser: mockUser,
88+
SigningSSHKey: &asymkey.PublicKey{Fingerprint: "aa:bb:cc:dd:ee"},
89+
TrustStatus: "untrusted",
90+
},
91+
UserCommit: &user_model.UserCommit{
92+
User: mockUser,
93+
Commit: &git.Commit{ID: git.Sha1ObjectFormat.EmptyObjectID()},
94+
},
95+
})
96+
commits = append(commits, &asymkey.SignCommit{
97+
Verification: &asymkey.CommitVerification{
98+
Verified: true,
99+
Reason: "name / key-id",
100+
SigningUser: mockUser,
101+
SigningSSHKey: &asymkey.PublicKey{Fingerprint: "aa:bb:cc:dd:ee"},
102+
TrustStatus: "other(unmatch)",
103+
},
104+
UserCommit: &user_model.UserCommit{
105+
User: mockUser,
106+
Commit: &git.Commit{ID: git.Sha1ObjectFormat.EmptyObjectID()},
107+
},
108+
})
109+
commits = append(commits, &asymkey.SignCommit{
110+
Verification: &asymkey.CommitVerification{
111+
Warning: true,
112+
Reason: "gpg.error",
113+
SigningEmail: "[email protected]",
114+
},
115+
UserCommit: &user_model.UserCommit{
116+
User: mockUser,
117+
Commit: &git.Commit{ID: git.Sha1ObjectFormat.EmptyObjectID()},
118+
},
119+
})
120+
121+
ctx.Data["MockCommits"] = commits
122+
}
123+
}
53124

125+
func Tmpl(ctx *context.Context) {
126+
prepareMockData(ctx)
54127
if ctx.Req.Method == "POST" {
55128
_ = ctx.Req.ParseForm()
56129
ctx.Flash.Info("form: "+ctx.Req.Method+" "+ctx.Req.RequestURI+"<br>"+
@@ -60,6 +133,5 @@ func Tmpl(ctx *context.Context) {
60133
)
61134
time.Sleep(2 * time.Second)
62135
}
63-
64136
ctx.HTML(http.StatusOK, templates.TplName("devtest"+path.Clean("/"+ctx.PathParam("sub"))))
65137
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{template "devtest/devtest-header"}}
2+
<div class="page-content devtest ui container">
3+
<div>
4+
<h1>Commit Sign Badges</h1>
5+
{{range $commit := .MockCommits}}
6+
<div class="flex-text-block tw-my-2">
7+
{{template "repo/commit_sign_badge" dict "Commit" $commit "CommitBaseLink" "/devtest/commit" "CommitSignVerification" $commit.Verification}}
8+
{{template "repo/commit_sign_badge" dict "CommitSignVerification" $commit.Verification}}
9+
</div>
10+
{{end}}
11+
</div>
12+
</div>
13+
{{template "devtest/devtest-footer"}}

0 commit comments

Comments
 (0)