From 49919c636e4788a14f3762a0d9137ee2e0092790 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Feb 2023 07:09:52 +0100 Subject: 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 --- templates/repo/issue/new_form.tmpl | 2 +- templates/repo/settings/options.tmpl | 66 +++++++++++++++++++++--------------- templates/swagger/v1_json.tmpl | 9 +++++ 3 files changed, 49 insertions(+), 28 deletions(-) (limited to 'templates') diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index ed1fd4778f..2e55686725 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -238,7 +238,7 @@
- +
{{end}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 6715a3c4eb..7b8f9923af 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -478,59 +478,41 @@
-
- - -
+

+ {{.locale.Tr "repo.settings.merge_style_desc"}} +

- +
- +
- +
- +
- -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - +
+

{{.locale.Tr "repo.settings.default_merge_style_desc"}} @@ -564,6 +546,36 @@

+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
{{end}} diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 5b07965d2a..e096faf3f3 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16497,6 +16497,11 @@ "type": "boolean", "x-go-name": "AutodetectManualMerge" }, + "default_allow_maintainer_edit": { + "description": "set to `true` to allow edits from maintainers by default", + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, "default_branch": { "description": "sets the default branch for this repository.", "type": "string", @@ -19015,6 +19020,10 @@ "format": "date-time", "x-go-name": "Created" }, + "default_allow_maintainer_edit": { + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, "default_branch": { "type": "string", "x-go-name": "DefaultBranch" -- cgit v1.2.3