Commit 8c6047a4 authored by Tim Zallmann's avatar Tim Zallmann

Rest of Changes, Updated SPecs

parent 92d6cad9
...@@ -86,5 +86,9 @@ module LicenseHelper ...@@ -86,5 +86,9 @@ module LicenseHelper
end end
end end
def show_project_feature_promotion?(project_feature, callout_id)
!@project.feature_available?(project_feature) && show_promotions? && show_callout?(callout_id)
end
extend self extend self
end end
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
%h3.page-title Project Audit Events %h3.page-title Project Audit Events
%p.light Events in #{@project.full_path} %p.light Events in #{@project.full_path}
- if @project.feature_available?(:audit_events) - if @project.feature_available?(:audit_events)
= render 'shared/audit_events/event_table', events: @events = render 'shared/audit_events/event_table', events: @events
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
%p %p
Customize your merge request restrictions. Customize your merge request restrictions.
.settings-content.no-animate{ class: ('expanded' if expanded) } .settings-content.no-animate{ class: ('expanded' if expanded) }
- if !@project.feature_available?(:fast_forward_merge) && show_promotions? && show_callout?('promote_mr_approval_dismissed') - if show_project_feature_promotion?(:fast_forward_merge, 'promote_mr_approval_dismissed')
= render 'shared/promotions/promote_mr_approval' = render 'shared/promotions/promote_mr_approval'
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
= render 'merge_request_settings', form: f = render 'merge_request_settings', form: f
......
.user-callout.promotion-callout.append-bottom-20.js-mr-approval-callout{ id: 'promote_mr_approval', data: { uid: 'promote_mr_approval_dismissed' } } .user-callout.promotion-callout.append-bottom-20.js-mr-approval-callout#promote_mr_approval{ data: { uid: 'promote_mr_approval_dismissed' } }
.bordered-box.content-block .bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Merge Request promotion' } %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Merge Request promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
......
...@@ -7,21 +7,24 @@ ...@@ -7,21 +7,24 @@
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if current_application_settings.should_check_namespace_plan?
Upgrade your plan improve repositories. Upgrade your plan to improve repositories.
- else - else
Improve repositories with GitLab Enterprise Edition. Improve repositories with GitLab Enterprise Edition.
%ul %ul
%li - unless @project.feature_available?(:push_rules)
= link_to 'Push Rules', help_page_path('push_rules/push_rules.md#push-rules'), target: '_blank' %li
%p = link_to 'Push Rules', help_page_path('push_rules/push_rules.md#push-rules'), target: '_blank'
Push Rules are defined per project so you can have different rules applied to different projects depends on your needs. %p
%li Push Rules are defined per project so you can have different rules applied to different projects depends on your needs.
= link_to 'Repository Mirroring', help_page_path('workflow/repository_mirroring.html'), target: '_blank' - unless @project.feature_available?(:repository_mirrors)
%p %li
Repository Mirroring is a way to mirror repositories from external sources. It can be used to mirror all branches, tags, and commits that you have in your repository. = link_to 'Repository Mirroring', help_page_path('workflow/repository_mirroring.html'), target: '_blank'
%li %p
= link_to 'Protected Branches', help_page_path('user/project/protected_branches.html'), target: '_blank' Repository Mirroring is a way to mirror repositories from external sources. It can be used to mirror all branches, tags, and commits that you have in your repository.
%p - unless @project.feature_available?(:protected_refs_for_users)
With GitLab Enterprise Edition you can restrict access to protected branches by choosing a role (Masters, Developers) as well as certain users. %li
= link_to 'Better Protected Branches', help_page_path('user/project/protected_branches.html'), target: '_blank'
%p
You can restrict access to protected branches by choosing a role (Masters, Developers) as well as certain users.
= render 'shared/promotions/promotion_link_project' = render 'shared/promotions/promotion_link_project'
.user-callout.promotion-callout.js-service-desk-callout{ id: 'promote_service_desk', data: { uid: 'promote_service_desk_dismissed' } } .user-callout.promotion-callout.js-service-desk-callout#promote_service_desk{ data: { uid: 'promote_service_desk_dismissed' } }
.bordered-box.content-block .bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Service Desk promotion' } %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Service Desk promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
......
.user-callout.promotion-callout.prepend-top-10{ id: 'promote_squash_commits', data: { uid: 'promote_squash_commits_dismissed' } } .user-callout.promotion-callout.prepend-top-10#promote_squash_commits{ data: { uid: 'promote_squash_commits_dismissed' } }
.bordered-box.content-block .bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss merge request promotion' } %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss merge request promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if current_application_settings.should_check_namespace_plan?
Upgrade your plan to improve Merge Requests with squash commit. Upgrade your plan to improve Merge Requests with Squash Commit.
- else - else
Improve Merge Requests with squash commit and GitLab Enterprise Edition. Improve Merge Requests with Squash Commit and GitLab Enterprise Edition.
%p %p
Squashing lets you tidy up the commit history of a branch when accepting a merge request. It applies all of the changes in the merge request as a single commit, and then merges that commit using the merge method set for the project. Squashing lets you tidy up the commit history of a branch when accepting a merge request. It applies all of the changes in the merge request as a single commit, and then merges that commit using the merge method set for the project.
= link_to 'Read more', help_page_path('user/project/merge_requests/squash_and_merge.html'), target: '_blank' = link_to 'Read more', help_page_path('user/project/merge_requests/squash_and_merge.html'), target: '_blank'
......
...@@ -105,7 +105,7 @@ describe 'Promotions', js: true do ...@@ -105,7 +105,7 @@ describe 'Promotions', js: true do
it 'should appear in project edit page' do it 'should appear in project edit page' do
visit edit_project_path(project) visit edit_project_path(project)
expect(find('#promote_mr_approval')).to have_content 'Improve Merge Request and customer support' expect(find('#promote_mr_approval')).to have_content 'Improve Merge Requests and customer support'
expect(find('#promote_mr_approval')).to have_content 'Merge request approvals allow you to set the number of necessary approvals and predefine a list of approvers that will need to approve every merge request in a project.' expect(find('#promote_mr_approval')).to have_content 'Merge request approvals allow you to set the number of necessary approvals and predefine a list of approvers that will need to approve every merge request in a project.'
end end
...@@ -231,7 +231,7 @@ describe 'Promotions', js: true do ...@@ -231,7 +231,7 @@ describe 'Promotions', js: true do
it 'should appear on the page' do it 'should appear on the page' do
visit project_audit_events_path(project) visit project_audit_events_path(project)
expect(find('.user-callout-copy')).to have_content 'Track your project with Audit Events' expect(find('.user-callout-copy')).to have_content 'Track your project with Audit Events'
expect(find('.user-callout-copy')).to have_content 'Audit Events is a tool for GitLab Enterprise Edition administrators to be able to track important events such as user access level, target user, and user addition or removal.' expect(find('.user-callout-copy')).to have_content 'Audit Events is a way to keep track of important events that happened in GitLab.'
end end
end end
...@@ -245,7 +245,7 @@ describe 'Promotions', js: true do ...@@ -245,7 +245,7 @@ describe 'Promotions', js: true do
it 'should appear on the page' do it 'should appear on the page' do
visit group_analytics_path(group) visit group_analytics_path(group)
expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution analytics and GitLab Enterprise Edition.' expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution Analytics.'
expect(find('.user-callout-copy')).to have_content 'With contribution analytics you can have an overview for the activity of issues, merge requests and push events of your organization and its members.' expect(find('.user-callout-copy')).to have_content 'With contribution analytics you can have an overview for the activity of issues, merge requests and push events of your organization and its members.'
end end
end end
......
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