Commit 66fba9a3 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '332641-aqualls-wording-fix' into 'master'

Revise UI phrasing around force pushes

See merge request gitlab-org/gitlab!63310
parents eb407660 60031515
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
.flash-container .flash-container
%table.table.table-bordered %table.table.table-bordered
%colgroup %colgroup
%col{ width: "30%" }
%col{ width: "20%" } %col{ width: "20%" }
%col{ width: "20%" } %col{ width: "20%" }
%col{ width: "20%" } %col{ width: "10%" }
%col{ width: "20%" } %col{ width: "10%" }
- if can_admin_project - if can_admin_project
%col %col
%thead %thead
...@@ -23,8 +24,8 @@ ...@@ -23,8 +24,8 @@
%th %th
= s_("ProtectedBranch|Allowed to push") = s_("ProtectedBranch|Allowed to push")
%th %th
= s_("ProtectedBranch|Allow force push") = s_("ProtectedBranch|Allowed to force push")
%span.has-tooltip{ data: { container: 'body' }, title: s_('ProtectedBranch|Allow force push for all users with push access.'), 'aria-hidden': 'true' } %span.has-tooltip{ data: { container: 'body' }, title: s_('ProtectedBranch|Allow all users with push access to force push.'), 'aria-hidden': 'true' }
= sprite_icon('question', size: 16, css_class: 'gl-text-gray-500') = sprite_icon('question', size: 16, css_class: 'gl-text-gray-500')
= render_if_exists 'projects/protected_branches/ee/code_owner_approval_table_head' = render_if_exists 'projects/protected_branches/ee/code_owner_approval_table_head'
......
...@@ -22,11 +22,13 @@ ...@@ -22,11 +22,13 @@
.col-md-10 .col-md-10
= yield :push_access_levels = yield :push_access_levels
.form-group.row .form-group.row
= f.label :allow_force_push, s_("ProtectedBranch|Allow force push:"), class: 'col-md-2 gl-text-left text-md-right' = f.label :allow_force_push, s_("ProtectedBranch|Allowed to force push:"), class: 'col-md-2 gl-text-left text-md-right'
.col-md-10 .col-md-10
= render "shared/buttons/project_feature_toggle", class_list: "js-force-push-toggle project-feature-toggle" = render "shared/buttons/project_feature_toggle", class_list: "js-force-push-toggle project-feature-toggle"
.form-text.gl-text-gray-600.gl-mt-0 .form-text.gl-text-gray-600.gl-mt-0
= s_("ProtectedBranch|Allow force push for all users with push access.") - force_push_docs_url = help_page_url('topics/git/git_rebase', anchor: 'force-push')
- force_push_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: force_push_docs_url }
= (s_("ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}.") % { tag_start: force_push_link_start, tag_end: '</a>' }).html_safe
= render_if_exists 'projects/protected_branches/ee/code_owner_approval_form', f: f = render_if_exists 'projects/protected_branches/ee/code_owner_approval_form', f: f
.card-footer .card-footer
= f.submit s_('ProtectedBranch|Protect'), class: 'gl-button btn btn-confirm', disabled: true, data: { qa_selector: 'protect_button' } = f.submit s_('ProtectedBranch|Protect'), class: 'gl-button btn btn-confirm', disabled: true, data: { qa_selector: 'protect_button' }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%ul %ul
%li Allow only users with Maintainer #{link_to "permissions", help_page_path("user/permissions")} to create new protected branches. %li Allow only users with Maintainer #{link_to "permissions", help_page_path("user/permissions")} to create new protected branches.
%li Allow only users with Maintainer permissions to push code. %li Allow only users with Maintainer permissions to push code.
%li Prevent <strong>anyone</strong> from force-pushing to the branch. %li Prevent <strong>anyone</strong> from #{link_to "force-pushing", help_page_path('topics/git/git_rebase', anchor: 'force-push')} to the branch.
%li Prevent <strong>anyone</strong> from deleting the branch. %li Prevent <strong>anyone</strong> from deleting the branch.
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
......
...@@ -34,4 +34,4 @@ ...@@ -34,4 +34,4 @@
= _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence } = _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence }
%td %td
= render "shared/buttons/project_feature_toggle", is_checked: protected_branch.allow_force_push, label: s_("ProtectedBranch|Toggle allow force push"), class_list: "js-force-push-toggle project-feature-toggle", data: { qa_selector: 'force_push_toggle_button', qa_branch_name: protected_branch.name } = render "shared/buttons/project_feature_toggle", is_checked: protected_branch.allow_force_push, label: s_("ProtectedBranch|Toggle allowed to force push"), class_list: "js-force-push-toggle project-feature-toggle", data: { qa_selector: 'force_push_toggle_button', qa_branch_name: protected_branch.name }
...@@ -204,7 +204,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla ...@@ -204,7 +204,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla
| `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, Maintainer role) | | `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, Maintainer role) |
| `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, Maintainer role) | | `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, Maintainer role) |
| `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, Maintainer role) | | `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, Maintainer role) |
| `allow_force_push` | boolean | no | Allow force push for all users with push access. (defaults: false) | | `allow_force_push` | boolean | no | Allow all users with push access to force push. (default: `false`) |
| `allowed_to_push` | array | no | **(PREMIUM)** Array of access levels allowed to push, with each described by a hash | | `allowed_to_push` | array | no | **(PREMIUM)** Array of access levels allowed to push, with each described by a hash |
| `allowed_to_merge` | array | no | **(PREMIUM)** Array of access levels allowed to merge, with each described by a hash | | `allowed_to_merge` | array | no | **(PREMIUM)** Array of access levels allowed to merge, with each described by a hash |
| `allowed_to_unprotect` | array | no | **(PREMIUM)** Array of access levels allowed to unprotect, with each described by a hash | | `allowed_to_unprotect` | array | no | **(PREMIUM)** Array of access levels allowed to unprotect, with each described by a hash |
......
...@@ -184,17 +184,17 @@ command line or a Git client application. ...@@ -184,17 +184,17 @@ command line or a Git client application.
WARNING: WARNING:
This feature might not be available to you. Check the **version history** note above for details. This feature might not be available to you. Check the **version history** note above for details.
You can allow force pushes to protected branches by either setting **Allow force push** You can allow [force pushes](../../topics/git/git_rebase.md#force-push) to
protected branches by either setting **Allowed to force push**
when you protect a new branch, or by configuring an already-protected branch. when you protect a new branch, or by configuring an already-protected branch.
To protect a new branch and enable Force push: To protect a new branch and enable Force push:
1. Navigate to your project's **Settings > Repository**. 1. Navigate to your project's **Settings > Repository**.
1. Expand **Protected branches**, and scroll to **Protect a branch**. 1. Expand **Protected branches**, and scroll to **Protect a branch**.
![Code Owners approval - new protected branch](img/code_owners_approval_new_protected_branch_v13_10.png)
1. Select a **Branch** or wildcard you'd like to protect. 1. Select a **Branch** or wildcard you'd like to protect.
1. Select the user levels **Allowed to merge** and **Allowed to push**. 1. Select the user levels **Allowed to merge** and **Allowed to push**.
1. To allow all users with push access to force push, toggle the **Allow force push** slider. 1. To allow all users with push access to force push, toggle the **Allowed to force push** slider.
1. To reject code pushes that change files listed in the `CODEOWNERS` file, toggle 1. To reject code pushes that change files listed in the `CODEOWNERS` file, toggle
**Require approval from code owners**. **Require approval from code owners**.
1. Click **Protect**. 1. Click **Protect**.
...@@ -203,8 +203,7 @@ To enable force pushes on branches already protected: ...@@ -203,8 +203,7 @@ To enable force pushes on branches already protected:
1. Navigate to your project's **Settings > Repository**. 1. Navigate to your project's **Settings > Repository**.
1. Expand **Protected branches** and scroll to **Protected branch**. 1. Expand **Protected branches** and scroll to **Protected branch**.
![Code Owners approval - branch already protected](img/code_owners_approval_protected_branch_v13_10.png) 1. Toggle the **Allowed to force push** slider for the chosen branch.
1. Toggle the **Allow force push** slider for the chosen branch.
When enabled, members who are allowed to push to this branch can also force push. When enabled, members who are allowed to push to this branch can also force push.
...@@ -224,15 +223,11 @@ To protect a new branch and enable Code Owner's approval: ...@@ -224,15 +223,11 @@ To protect a new branch and enable Code Owner's approval:
1. Scroll down to **Protect a branch**, select a **Branch** or wildcard you'd like to protect, select who's **Allowed to merge** and **Allowed to push**, and toggle the **Require approval from code owners** slider. 1. Scroll down to **Protect a branch**, select a **Branch** or wildcard you'd like to protect, select who's **Allowed to merge** and **Allowed to push**, and toggle the **Require approval from code owners** slider.
1. Click **Protect**. 1. Click **Protect**.
![Code Owners approval - new protected branch](img/code_owners_approval_new_protected_branch_v13_10.png)
To enable Code Owner's approval to branches already protected: To enable Code Owner's approval to branches already protected:
1. Navigate to your project's **Settings > Repository** and expand **Protected branches**. 1. Navigate to your project's **Settings > Repository** and expand **Protected branches**.
1. Scroll down to **Protected branch** and toggle the **Code owner approval** slider for the chosen branch. 1. Scroll down to **Protected branch** and toggle the **Code owner approval** slider for the chosen branch.
![Code Owners approval - branch already protected](img/code_owners_approval_protected_branch_v13_10.png)
When enabled, all merge requests targeting these branches require approval When enabled, all merge requests targeting these branches require approval
by a Code Owner per matched rule before they can be merged. by a Code Owner per matched rule before they can be merged.
Additionally, direct pushes to the protected branch are denied if a rule is matched. Additionally, direct pushes to the protected branch are denied if a rule is matched.
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= render partial: 'projects/settings/ee/access_level_dropdown', locals: { protected_branch: protected_branch, access_levels: protected_branch.push_access_levels, level_frequencies: access_level_frequencies(protected_branch.push_access_levels), input_basic_name: 'push_access_levels', disabled: !can_unprotect, toggle_class: 'js-allowed-to-push' } = render partial: 'projects/settings/ee/access_level_dropdown', locals: { protected_branch: protected_branch, access_levels: protected_branch.push_access_levels, level_frequencies: access_level_frequencies(protected_branch.push_access_levels), input_basic_name: 'push_access_levels', disabled: !can_unprotect, toggle_class: 'js-allowed-to-push' }
%td %td
= render "shared/buttons/project_feature_toggle", is_checked: protected_branch.allow_force_push, label: s_("ProtectedBranch|Toggle allow force push"), class_list: "js-force-push-toggle project-feature-toggle", data: { qa_selector: 'force_push_toggle_button', qa_branch_name: protected_branch.name } = render "shared/buttons/project_feature_toggle", is_checked: protected_branch.allow_force_push, label: s_("ProtectedBranch|Toggle allowed to force push"), class_list: "js-force-push-toggle project-feature-toggle", data: { qa_selector: 'force_push_toggle_button', qa_branch_name: protected_branch.name }
...@@ -26651,13 +26651,16 @@ msgstr "" ...@@ -26651,13 +26651,16 @@ msgstr ""
msgid "ProtectedBranch|%{wildcards_link_start}Wildcards%{wildcards_link_end} such as %{code_tag_start}*-stable%{code_tag_end} or %{code_tag_start}production/*%{code_tag_end} are supported." msgid "ProtectedBranch|%{wildcards_link_start}Wildcards%{wildcards_link_end} such as %{code_tag_start}*-stable%{code_tag_end} or %{code_tag_start}production/*%{code_tag_end} are supported."
msgstr "" msgstr ""
msgid "ProtectedBranch|Allow force push" msgid "ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}."
msgstr "" msgstr ""
msgid "ProtectedBranch|Allow force push for all users with push access." msgid "ProtectedBranch|Allow all users with push access to force push."
msgstr "" msgstr ""
msgid "ProtectedBranch|Allow force push:" msgid "ProtectedBranch|Allowed to force push"
msgstr ""
msgid "ProtectedBranch|Allowed to force push:"
msgstr "" msgstr ""
msgid "ProtectedBranch|Allowed to merge" msgid "ProtectedBranch|Allowed to merge"
...@@ -26702,7 +26705,7 @@ msgstr "" ...@@ -26702,7 +26705,7 @@ msgstr ""
msgid "ProtectedBranch|There are currently no protected branches, protect a branch with the form above." msgid "ProtectedBranch|There are currently no protected branches, protect a branch with the form above."
msgstr "" msgstr ""
msgid "ProtectedBranch|Toggle allow force push" msgid "ProtectedBranch|Toggle allowed to force push"
msgstr "" msgstr ""
msgid "ProtectedBranch|Toggle code owner approval" msgid "ProtectedBranch|Toggle code owner approval"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment