Skip to content

Commit ecd783c

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Refactor and update mail templates (go-gitea#35150) Disable Field count validation of CSV viewer (go-gitea#35228) split admin config settings templates to make it maintain easier (go-gitea#35294) Update tools/package.json dependencies, remove imagemin-zopfli (go-gitea#35406)
2 parents aca6989 + 0734763 commit ecd783c

Some content is hidden

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

42 files changed

+475
-1841
lines changed

modules/csv/csv.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ func CreateReader(input io.Reader, delimiter rune) *stdcsv.Reader {
3030
// thus would change `\t\t` to just `\t` or ` ` (two spaces) to just ` ` (single space)
3131
rd.TrimLeadingSpace = true
3232
}
33+
// Don't force validation of every row to have the same number of entries as the first row.
34+
rd.FieldsPerRecord = -1
3335
return rd
3436
}
3537

modules/csv/csv_test.go

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@ j, ,\x20
9494
},
9595
expectedDelimiter: ',',
9696
},
97+
// case 3 - every delimiter used, default to comma and handle differing number of fields per record
98+
{
99+
csv: `col1,col2
100+
a;b
101+
c@e
102+
f g
103+
h|i
104+
jkl`,
105+
expectedRows: [][]string{
106+
{"col1", "col2"},
107+
{"a;b"},
108+
{"c@e"},
109+
{"f g"},
110+
{"h|i"},
111+
{"jkl"},
112+
},
113+
expectedDelimiter: ',',
114+
},
97115
}
98116

99117
for n, c := range cases {
@@ -119,21 +137,6 @@ func TestDetermineDelimiterShortBufferError(t *testing.T) {
119137
assert.Nil(t, rd, "CSV reader should be mnil")
120138
}
121139

122-
func TestDetermineDelimiterReadAllError(t *testing.T) {
123-
rd, err := CreateReaderAndDetermineDelimiter(nil, strings.NewReader(`col1,col2
124-
a;b
125-
c@e
126-
f g
127-
h|i
128-
jkl`))
129-
assert.NoError(t, err, "CreateReaderAndDetermineDelimiter() shouldn't throw error")
130-
assert.NotNil(t, rd, "CSV reader should not be mnil")
131-
rows, err := rd.ReadAll()
132-
assert.Error(t, err, "RaadAll() should throw error")
133-
assert.ErrorIs(t, err, csv.ErrFieldCount)
134-
assert.Empty(t, rows, "rows should be empty")
135-
}
136-
137140
func TestDetermineDelimiter(t *testing.T) {
138141
cases := []struct {
139142
csv string

options/locale/locale_en-US.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,14 @@ repo.transfer.body = To accept or reject it, visit %s or just ignore it.
551551
repo.collaborator.added.subject = %s added you to %s
552552
repo.collaborator.added.text = You have been added as a collaborator of repository:
553553
554+
repo.actions.run.failed = Run failed
555+
repo.actions.run.succeeded = Run succeeded
556+
repo.actions.run.cancelled = Run cancelled
557+
repo.actions.jobs.all_succeeded = All jobs have succeeded
558+
repo.actions.jobs.all_failed = All jobs have failed
559+
repo.actions.jobs.some_not_successful = Some jobs were not successful
560+
repo.actions.jobs.all_cancelled = All jobs have been cancelled
561+
554562
team_invite.subject = %[1]s has invited you to join the %[2]s organization
555563
team_invite.text_1 = %[1]s has invited you to join team %[2]s in organization %[3]s.
556564
team_invite.text_2 = Please click the following link to join the team:
3.54 KB
Loading
2.74 KB
Loading

public/assets/img/favicon.png

2.5 KB
Loading

public/assets/img/logo.png

6.74 KB
Loading

routers/web/admin/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
const (
2929
tplConfig templates.TplName = "admin/config"
30-
tplConfigSettings templates.TplName = "admin/config_settings"
30+
tplConfigSettings templates.TplName = "admin/config_settings/config_settings"
3131
)
3232

3333
// SendTestMail send test mail to confirm mail service is OK

services/mailer/mail_issue_common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,18 @@ func actionToTemplate(issue *issues_model.Issue, actionType activities_model.Act
260260
}
261261
}
262262

263-
template = typeName + "/" + name
263+
template = "repo/" + typeName + "/" + name
264264
ok := LoadedTemplates().BodyTemplates.Lookup(template) != nil
265265
if !ok && typeName != "issue" {
266-
template = "issue/" + name
266+
template = "repo/issue/" + name
267267
ok = LoadedTemplates().BodyTemplates.Lookup(template) != nil
268268
}
269269
if !ok {
270-
template = typeName + "/default"
270+
template = "repo/" + typeName + "/default"
271271
ok = LoadedTemplates().BodyTemplates.Lookup(template) != nil
272272
}
273273
if !ok {
274-
template = "issue/default"
274+
template = "repo/issue/default"
275275
}
276276
return typeName, name, template
277277
}

services/mailer/mail_release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
sender_service "code.gitea.io/gitea/services/mailer/sender"
2020
)
2121

22-
const tplNewReleaseMail templates.TplName = "release"
22+
const tplNewReleaseMail templates.TplName = "repo/release"
2323

2424
func generateMessageIDForRelease(release *repo_model.Release) string {
2525
return fmt.Sprintf("<%s/releases/%d@%s>", release.Repo.FullName(), release.ID, setting.Domain)

0 commit comments

Comments
 (0)