Skip to content

Commit 96da512

Browse files
authored
Merge branch 'main' into feat/support-preview-3d-file
2 parents b28f478 + f74a136 commit 96da512

Some content is hidden

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

49 files changed

+316
-339
lines changed

models/db/context.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ func WithTx(parentCtx context.Context, f func(ctx context.Context) error) error
178178
return txWithNoCheck(parentCtx, f)
179179
}
180180

181+
// WithTx2 is similar to WithTx, but it has two return values: result and error.
182+
func WithTx2[T any](parentCtx context.Context, f func(ctx context.Context) (T, error)) (ret T, errRet error) {
183+
errRet = WithTx(parentCtx, func(ctx context.Context) (errInner error) {
184+
ret, errInner = f(ctx)
185+
return errInner
186+
})
187+
return ret, errRet
188+
}
189+
181190
func txWithNoCheck(parentCtx context.Context, f func(ctx context.Context) error) error {
182191
sess := xormEngine.NewSession()
183192
defer sess.Close()

modules/structs/admin_user.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import "time"
88

99
// CreateUserOption create user options
1010
type CreateUserOption struct {
11-
SourceID int64 `json:"source_id"`
11+
SourceID int64 `json:"source_id"`
12+
// identifier of the user, provided by the external authenticator (if configured)
13+
// default: empty
1214
LoginName string `json:"login_name"`
15+
// username of the user
1316
// required: true
1417
Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
1518
FullName string `json:"full_name" binding:"MaxSize(100)"`
@@ -32,6 +35,8 @@ type CreateUserOption struct {
3235
type EditUserOption struct {
3336
// required: true
3437
SourceID int64 `json:"source_id"`
38+
// identifier of the user, provided by the external authenticator (if configured)
39+
// default: empty
3540
// required: true
3641
LoginName string `json:"login_name" binding:"Required"`
3742
// swagger:strfmt email

modules/structs/hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ type PayloadUser struct {
7171
// Full name of the commit author
7272
Name string `json:"name"`
7373
// swagger:strfmt email
74-
Email string `json:"email"`
74+
Email string `json:"email"`
75+
// username of the user
7576
UserName string `json:"username"`
7677
}
7778

modules/structs/issue_tracked_time.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type AddTimeOption struct {
1414
Time int64 `json:"time" binding:"Required"`
1515
// swagger:strfmt date-time
1616
Created time.Time `json:"created"`
17-
// User who spent the time (optional)
17+
// username of the user who spent the time working on the issue (optional)
1818
User string `json:"user_name"`
1919
}
2020

@@ -26,7 +26,8 @@ type TrackedTime struct {
2626
// Time in seconds
2727
Time int64 `json:"time"`
2828
// deprecated (only for backwards compatibility)
29-
UserID int64 `json:"user_id"`
29+
UserID int64 `json:"user_id"`
30+
// username of the user
3031
UserName string `json:"user_name"`
3132
// deprecated (only for backwards compatibility)
3233
IssueID int64 `json:"issue_id"`

modules/structs/org.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type Organization struct {
1515
Location string `json:"location"`
1616
Visibility string `json:"visibility"`
1717
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
18+
// username of the organization
1819
// deprecated
1920
UserName string `json:"username"`
2021
}
@@ -30,6 +31,7 @@ type OrganizationPermissions struct {
3031

3132
// CreateOrgOption options for creating an organization
3233
type CreateOrgOption struct {
34+
// username of the organization
3335
// required: true
3436
UserName string `json:"username" binding:"Required;Username;MaxSize(40)"`
3537
FullName string `json:"full_name" binding:"MaxSize(100)"`

modules/structs/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
type User struct {
1616
// the user's id
1717
ID int64 `json:"id"`
18-
// the user's username
18+
// login of the user, same as `username`
1919
UserName string `json:"login"`
20-
// the user's authentication sign-in name.
20+
// identifier of the user, provided by the external authenticator (if configured)
2121
// default: empty
2222
LoginName string `json:"login_name"`
2323
// The ID of the user's Authentication Source

modules/structs/user_email.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Email struct {
1111
Verified bool `json:"verified"`
1212
Primary bool `json:"primary"`
1313
UserID int64 `json:"user_id"`
14+
// username of the user
1415
UserName string `json:"username"`
1516
}
1617

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,6 @@ pulls.cmd_instruction_checkout_title=Checkout
19171917
pulls.cmd_instruction_checkout_desc=Z vašeho repositáře projektu se podívejte na novou větev a vyzkoušejte změny.
19181918
pulls.cmd_instruction_merge_title=Sloučit
19191919
pulls.cmd_instruction_merge_desc=Slučte změny a aktualizujte je na Gitea.
1920-
pulls.cmd_instruction_merge_warning=Varování: Tato operace nemůže sloučit požadavek na natažení, protože „autodetekce manuálních sloučení“ nebyla povolena
19211920
pulls.clear_merge_message=Vymazat zprávu o sloučení
19221921
pulls.clear_merge_message_hint=Vymazání zprávy o sloučení odstraní pouze obsah zprávy a ponechá generované přídavky gitu jako "Co-AuthoreBy …".
19231922

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,6 @@ pulls.cmd_instruction_checkout_title=Checkout
19531953
pulls.cmd_instruction_checkout_desc=Wechsle auf einen neuen Branch in deinem lokalen Repository und teste die Änderungen.
19541954
pulls.cmd_instruction_merge_title=Mergen
19551955
pulls.cmd_instruction_merge_desc=Die Änderungen mergen und auf Gitea aktualisieren.
1956-
pulls.cmd_instruction_merge_warning=Warnung: Dieser Vorgang kann den Pull-Request nicht mergen, da "manueller Merge" nicht aktiviert wurde
19571956
pulls.clear_merge_message=Merge-Nachricht löschen
19581957
pulls.clear_merge_message_hint=Das Löschen der Merge-Nachricht wird nur den Inhalt der Commit-Nachricht entfernen und generierte Git-Trailer wie "Co-Authored-By …" erhalten.
19591958

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ pulls.cmd_instruction_checkout_title = Checkout
19691969
pulls.cmd_instruction_checkout_desc = From your project repository, check out a new branch and test the changes.
19701970
pulls.cmd_instruction_merge_title = Merge
19711971
pulls.cmd_instruction_merge_desc = Merge the changes and update on Gitea.
1972-
pulls.cmd_instruction_merge_warning = Warning: This operation can not merge pull request because "autodetect manual merge" was not enable
1972+
pulls.cmd_instruction_merge_warning = Warning: This operation cannot merge pull request because "autodetect manual merge" is not enabled.
19731973
pulls.clear_merge_message = Clear merge message
19741974
pulls.clear_merge_message_hint = Clearing the merge message will only remove the commit message content and keep generated git trailers such as "Co-Authored-By …".
19751975

0 commit comments

Comments
 (0)