diff --git a/app/components/layouts/settings_block_component.haml b/app/components/layouts/settings_block_component.haml index 0f4798b7f593f91e5cfa2b7e549a1d67fc920fd4..11973c17d4ff7918b09cb27d5b49bf58e1952e08 100644 --- a/app/components/layouts/settings_block_component.haml +++ b/app/components/layouts/settings_block_component.haml @@ -9,8 +9,12 @@ %h2{ class: title_classes, data: { 'settings-block-title': '' } } = heading || @heading - if description || @description - %p.gl-text-subtle.gl-m-0 - = description || @description + - if description.is_a?(String) || @description.is_a?(String) + %p.gl-text-subtle.gl-m-0 + = description || @description + - else + .gl-text-subtle.gl-m-0 + = description || @description .settings-content .gl-pl-7.sm:gl-pl-8.gl-mt-5 = body diff --git a/app/views/protected_branches/shared/_index.html.haml b/app/views/protected_branches/shared/_index.html.haml index 63bf5b6335437eb8650b3231b4f4024262efa296..9663a6bdb7fbc5fd88def626655b07fc90336f6f 100644 --- a/app/views/protected_branches/shared/_index.html.haml +++ b/app/views/protected_branches/shared/_index.html.haml @@ -8,14 +8,26 @@ - c.with_description do = s_("ProtectedBranch|Keep stable branches secure and force developers to use merge requests.") = link_to s_("ProtectedBranch|What are protected branches?"), help_page_path("user/project/repository/branches/protected.md") - - c.with_body do - .js-alert-protected-branch-created-container.gl-mt-5 + - if @project.present? + - branch_rules_docs_link_url = help_page_path('user/project/repository/branches/branch_rules.md') + - branch_rules_link_url = project_settings_repository_path(@project, anchor: 'js-branch-rules') + - branch_rules_link_start = ''.html_safe % { url: branch_rules_link_url } + + = render Pajamas::AlertComponent.new( alert_options: { class: 'gl-mr-7 gl-mt-5' }, + dismissible: false) do |c| + - c.with_body do + = s_("ProtectedBranch|Protected branches is moving to %{branch_rules_link_start}Branch rules%{branch_rules_link_end}.").html_safe % { branch_rules_link_start: branch_rules_link_start, branch_rules_link_end: ''.html_safe } + = s_("ProtectedBranch|You can now manage branch protections, approval rules, and status checks in one place.") + = link_to s_("ProtectedBranch|How do I use branch rules?"), branch_rules_docs_link_url, target: '_blank', rel: 'noopener noreferrer' + + - c.with_body do + .js-alert-protected-branch-created-container = render Pajamas::AlertComponent.new(variant: :warning, alert_options: { class: 'gl-mb-5' }, dismissible: false) do |c| - c.with_body do - = s_("ProtectedBranch|Giving merge rights to a protected branch also gives elevated permissions for certain CI/CD features.") + = s_("ProtectedBranch|Giving merge rights to a protected branch also gives elevated permissions for certain CI/CD features.") = link_to s_("ProtectedBranch|What are the security implications?"), help_page_path('ci/pipelines/_index.md', anchor: 'pipeline-security-on-protected-branches'), target: '_blank', rel: 'noopener noreferrer' = render ::Layouts::CrudComponent.new(s_("ProtectedBranch|Protected branches"), diff --git a/locale/gitlab.pot b/locale/gitlab.pot index e3602281c094ebf7e37f0b248e8bf0e00770735b..d56714d6d1c6f55e52814d0cfcb2663b80a3ec45 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -49008,6 +49008,9 @@ msgstr "" msgid "ProtectedBranch|Giving merge rights to a protected branch also gives elevated permissions for certain CI/CD features." msgstr "" +msgid "ProtectedBranch|How do I use branch rules?" +msgstr "" + msgid "ProtectedBranch|Inherited - This setting can be changed at the group level" msgstr "" @@ -49047,6 +49050,9 @@ msgstr "" msgid "ProtectedBranch|Protected branches" msgstr "" +msgid "ProtectedBranch|Protected branches is moving to %{branch_rules_link_start}Branch rules%{branch_rules_link_end}." +msgstr "" + msgid "ProtectedBranch|Reject code pushes that change files listed in the CODEOWNERS file." msgstr "" @@ -49095,6 +49101,9 @@ msgstr "" msgid "ProtectedBranch|You can add only groups that have this project shared. %{learn_more_link}" msgstr "" +msgid "ProtectedBranch|You can now manage branch protections, approval rules, and status checks in one place." +msgstr "" + msgid "ProtectedBranch|default" msgstr ""