1
0
Fork 0
forked from forgejo/forgejo

Split out repository unit settings

This splits out the repository unit settings (formerly "Advanced
settings" under the repository settings page) into their own, separate
page.

The primary reason for this is that the settings page became long and
complicated, with a structure that not always made sense. A secondary
reason is that toggling units on and off should not necessarily be an
"advanced" setting. We want to make doing that easier, and having the
units on their own page helps with that.

This is basically a refactor, there is no new functionality introduced,
just an extra pair of routes for the new page, and the supporting code.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2024-01-23 10:46:34 +01:00
parent a4ca473d33
commit fa73375e13
No known key found for this signature in database
11 changed files with 586 additions and 510 deletions

View file

@ -130,6 +130,24 @@ type RepoSettingForm struct {
EnablePrune bool
// Advanced settings
IsArchived bool
// Signing Settings
TrustModel string
// Admin settings
EnableHealthCheck bool
RequestReindexType string
}
// Validate validates the fields
func (f *RepoSettingForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// RepoUnitSettingForm form for changing repository unit settings
type RepoUnitSettingForm struct {
EnableCode bool
EnableWiki bool
GloballyWriteableWiki bool
@ -161,18 +179,10 @@ type RepoSettingForm struct {
EnableTimetracker bool
AllowOnlyContributorsToTrackTime bool
EnableIssueDependencies bool
IsArchived bool
// Signing Settings
TrustModel string
// Admin settings
EnableHealthCheck bool
RequestReindexType string
}
// Validate validates the fields
func (f *RepoSettingForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
func (f *RepoUnitSettingForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}