diff options
author | Brecht Van Lommel | 2023-02-13 07:09:52 +0100 |
---|---|---|
committer | GitHub | 2023-02-13 14:09:52 +0800 |
commit | 49919c636e4788a14f3762a0d9137ee2e0092790 (patch) | |
tree | acac92af0eff851eaea32416e17001ba0776032c /services | |
parent | b6d77229cfbab146da6445467acab2125e9e5edb (diff) |
Pull Requests: setting to allow edits by maintainers by default, tweak UI (#22862)
Add setting to allow edits by maintainers by default, to avoid having to
often ask contributors to enable this.
This also reorganizes the pull request settings UI to improve clarity.
It was unclear which checkbox options were there to control available
merge styles and which merge styles they correspond to.
Now there is a "Merge Styles" label followed by the merge style options
with the same name as in other menus. The remaining checkboxes were
moved to the bottom, ordered rougly by typical order of operations.
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/convert/repository.go | 3 | ||||
-rw-r--r-- | services/forms/repo_form.go | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/services/convert/repository.go b/services/convert/repository.go index ce53a6669..3ba604002 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -81,6 +81,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc allowRebaseUpdate := false defaultDeleteBranchAfterMerge := false defaultMergeStyle := repo_model.MergeStyleMerge + defaultAllowMaintainerEdit := false if unit, err := repo.GetUnit(ctx, unit_model.TypePullRequests); err == nil { config := unit.PullRequestsConfig() hasPullRequests = true @@ -92,6 +93,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc allowRebaseUpdate = config.AllowRebaseUpdate defaultDeleteBranchAfterMerge = config.DefaultDeleteBranchAfterMerge defaultMergeStyle = config.GetDefaultMergeStyle() + defaultAllowMaintainerEdit = config.DefaultAllowMaintainerEdit } hasProjects := false if _, err := repo.GetUnit(ctx, unit_model.TypeProjects); err == nil { @@ -182,6 +184,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc AllowRebaseUpdate: allowRebaseUpdate, DefaultDeleteBranchAfterMerge: defaultDeleteBranchAfterMerge, DefaultMergeStyle: string(defaultMergeStyle), + DefaultAllowMaintainerEdit: defaultAllowMaintainerEdit, AvatarURL: repo.AvatarLink(), Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate, MirrorInterval: mirrorInterval, diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index db336e25e..c1b580096 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -160,6 +160,7 @@ type RepoSettingForm struct { EnableAutodetectManualMerge bool PullsAllowRebaseUpdate bool DefaultDeleteBranchAfterMerge bool + DefaultAllowMaintainerEdit bool EnableTimetracker bool AllowOnlyContributorsToTrackTime bool EnableIssueDependencies bool |