Commit f95109d0 authored by Tim Zallmann's avatar Tim Zallmann

Updates based on MR feedback

parent bbbfbb2c
class Groups::AnalyticsController < Groups::ApplicationController class Groups::AnalyticsController < Groups::ApplicationController
include LicenseHelper
before_action :group before_action :group
before_action :check_contribution_analytics_available! && !LicenseHelper.show_promotions?
layout 'group' layout 'group'
......
...@@ -86,7 +86,7 @@ module LicenseHelper ...@@ -86,7 +86,7 @@ module LicenseHelper
end end
end end
def show_project_feature_promotion?(project_feature, callout_id) def show_project_feature_promotion?(project_feature, callout_id = '')
!@project.feature_available?(project_feature) && show_promotions? && show_callout?(callout_id) !@project.feature_available?(project_feature) && show_promotions? && show_callout?(callout_id)
end end
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%span %span
Activity Activity
- if @group.feature_available?(:contribution_analytics) - if @group.feature_available?(:contribution_analytics) || show_promotions?
= nav_link(path: 'analytics#show') do = nav_link(path: 'analytics#show') do
= link_to group_analytics_path(@group), title: 'Contribution Analytics', data: {placement: 'right'} do = link_to group_analytics_path(@group), title: 'Contribution Analytics', data: {placement: 'right'} do
%span %span
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
= render "projects/settings/head" = render "projects/settings/head"
- unless @project.feature_available?(:audit_events) && show_promotions? - if show_project_feature_promotion?(:audit_events)
= render 'shared/promotions/promote_audit_events' = render 'shared/promotions/promote_audit_events'
%h3.page-title Project Audit Events %h3.page-title Project Audit 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 show_project_feature_promotion?(:fast_forward_merge, 'promote_mr_approval_dismissed') - if show_project_feature_promotion?(:merge_request_approvers, '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
......
...@@ -26,5 +26,4 @@ ...@@ -26,5 +26,4 @@
= render @deploy_keys = render @deploy_keys
- if show_promotions? && show_callout?('promote_repository_features_dismissed') = render 'shared/promotions/promote_repository_features'
= render 'shared/promotions/promote_repository_features'
= nav_link(controller: :audit_events) do - if @project.feature_available?(:audit_events) || show_promotions?
= link_to project_audit_events_path(@project), title: "Audit Events" do = nav_link(controller: :audit_events) do
%span = link_to project_audit_events_path(@project), title: "Audit Events" do
Audit Events %span
Audit Events
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if current_application_settings.should_check_namespace_plan?
- if @project.group ? can?(current_user, :admin_group, @project.group) : @project.owner == current_user - if @project.group ? can?(current_user, :admin_group, @project.group) : @project.owner == current_user
Upgrade your plan to improve milestone with Burndown Charts. Upgrade your plan to improve milestones with Burndown Charts.
- elsif @project.group - elsif @project.group
Upgrade { @project.group.name }'s plan to improve milestone with Burndown Charts. Upgrade the plan for #{ @project.group.name } to improve milestones with Burndown Charts.
- else - else
- owner = @project.namespace.owner - owner = @project.namespace.owner
Upgrade { @project.group.name }'s plan to improve milestone with Burndown Charts. Upgrade #{ owner.name }'s plan to improve milestones with Burndown Charts.
- else - else
Improve milestone with Burndown Charts. Improve milestones with Burndown Charts.
%p %p
Burndown Charts are visual representations of the progress of completing a milestone. At a glance, you see the current state for the completion a given milestone. Without them, you would have to organize the data from the milestone and plot it yourself to have the same sense of progress. Burndown Charts are visual representations of the progress of completing a milestone. At a glance, you see the current state for the completion a given milestone. Without them, you would have to organize the data from the milestone and plot it yourself to have the same sense of progress.
= link_to 'Read more', help_page_path('user/project/milestones/burndown_charts.html'), target: '_blank' = link_to 'Read more', help_page_path('user/project/milestones/burndown_charts.html'), target: '_blank'
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
.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 activate Contribution Analytics. - if @project.group ? can?(current_user, :admin_group, @project.group) : @project.owner == current_user
Upgrade your plan to activate Contribution Analytics.
- elsif @project.group
Upgrade the plan for #{ @project.group.name } to activate Contribution Analytics.
- else
- owner = @project.namespace.owner
Upgrade #{ owner.name }'s plan to activate Contribution Analytics.
- else - else
Track activity with Contribution Analytics. Track activity with Contribution Analytics.
%p %p
......
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
- else - else
Improve Merge Requests and customer support with GitLab Enterprise Edition. Improve Merge Requests and customer support with GitLab Enterprise Edition.
%ul %ul
%li - if !@project.feature_available?(:merge_request_approvers)
= link_to 'Merge Request Approvals', help_page_path('user/project/merge_requests/merge_request_approvals.html'), target: '_blank' %li
%p = link_to 'Merge Request Approvals', help_page_path('user/project/merge_requests/merge_request_approvals.html'), target: '_blank'
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. %p
%li 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.
= link_to 'Fast-forward Merge', help_page_path('user/project/merge_requests/fast_forward_merge.html'), target: '_blank' - if !@project.feature_available?(:fast_forward_merge)
%p %li
If you prefer a linear Git history and a way to accept merge requests without creating merge commits, you can configure this on a per-project basis. = link_to 'Fast-forward Merge', help_page_path('user/project/merge_requests/fast_forward_merge.html'), target: '_blank'
%p
If you prefer a linear Git history and a way to accept merge requests without creating merge commits, you can configure this on a per-project basis.
= render 'shared/promotions/promotion_link_project' = render 'shared/promotions/promotion_link_project'
.user-callout.promotion-callout{ id: 'promote_repository_features', data: { uid: 'promote_repository_features_dismissed' } } - if show_promotions? && show_callout?('promote_repository_features_dismissed') && (!@project.feature_available?(:push_rules) || !@project.feature_available?(:repository_mirrors) || !@project.feature_available?(:protected_refs_for_users))
.bordered-box.content-block .user-callout.promotion-callout{ id: 'promote_repository_features', data: { uid: 'promote_repository_features_dismissed' } }
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss repository features promotion' } .bordered-box.content-block
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss repository features promotion' }
.svg-container = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
= custom_icon('icon_push_rules') .svg-container
.user-callout-copy = custom_icon('icon_push_rules')
%h4 .user-callout-copy
- if current_application_settings.should_check_namespace_plan? %h4
Upgrade your plan to improve repositories. - if current_application_settings.should_check_namespace_plan?
- else Upgrade your plan to improve repositories.
Improve repositories with GitLab Enterprise Edition. - else
%ul Improve repositories with GitLab Enterprise Edition.
- unless @project.feature_available?(:push_rules) %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
- unless @project.feature_available?(:repository_mirrors) Push Rules are defined per project so you can have different rules applied to different projects depends on your needs.
%li - unless @project.feature_available?(:repository_mirrors)
= link_to 'Repository Mirroring', help_page_path('workflow/repository_mirroring.html'), target: '_blank' %li
%p = link_to 'Repository Mirroring', help_page_path('workflow/repository_mirroring.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) 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.
%li - unless @project.feature_available?(:protected_refs_for_users)
= link_to 'Better Protected Branches', help_page_path('user/project/protected_branches.html'), target: '_blank' %li
%p = link_to 'Better Protected Branches', help_page_path('user/project/protected_branches.html'), target: '_blank'
You can restrict access to protected branches by choosing a role (Masters, Developers) as well as certain users. %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'
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- else - else
- owner = @project.namespace.owner - owner = @project.namespace.owner
%p Contact owner #{ link_to(owner.name, user_path(owner)) } to upgrade the plan. %p Contact owner #{ link_to(owner.name, user_path(owner)) } to upgrade the plan.
- elsif current_user && current_user.admin? - elsif current_user&.admin?
- if License.current&.expired? - if License.current&.expired?
= link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary' = link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary'
- else - else
......
...@@ -79,7 +79,6 @@ describe 'Promotions', js: true do ...@@ -79,7 +79,6 @@ 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_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.' expect(find('#promote_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.'
expect(find('#promote_service_desk')).to have_content 'GitLab Service Desk is a simple way to allow people to create issues in your GitLab instance without needing their own user account.'
end end
it 'does not show when cookie is set' do it 'does not show when cookie is set' do
...@@ -106,7 +105,6 @@ describe 'Promotions', js: true do ...@@ -106,7 +105,6 @@ 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 Requests 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.'
end end
it 'does not show when cookie is set' do it 'does not show when cookie is set' do
...@@ -134,7 +132,6 @@ describe 'Promotions', js: true do ...@@ -134,7 +132,6 @@ describe 'Promotions', js: true do
visit project_settings_repository_path(project) visit project_settings_repository_path(project)
expect(find('#promote_repository_features')).to have_content 'Improve repositories with GitLab Enterprise Edition' expect(find('#promote_repository_features')).to have_content 'Improve repositories with GitLab Enterprise Edition'
expect(find('#promote_repository_features')).to have_content 'Push Rules are defined per project so you can have different rules applied to different projects depends on your needs.'
end end
it 'does not show when cookie is set' do it 'does not show when cookie is set' do
...@@ -161,7 +158,6 @@ describe 'Promotions', js: true do ...@@ -161,7 +158,6 @@ describe 'Promotions', js: true do
it 'should appear in new MR page' do it 'should appear in new MR page' do
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature' })
expect(find('#promote_squash_commits')).to have_content 'Improve Merge Requests with Squash Commit and GitLab Enterprise Edition.' expect(find('#promote_squash_commits')).to have_content 'Improve Merge Requests with Squash Commit and GitLab Enterprise Edition.'
expect(find('#promote_squash_commits')).to have_content 'Squashing lets you tidy up the commit history of a branch when accepting a merge request.'
end end
it 'does not show when cookie is set' do it 'does not show when cookie is set' do
...@@ -188,7 +184,6 @@ describe 'Promotions', js: true do ...@@ -188,7 +184,6 @@ describe 'Promotions', js: true do
it 'should appear in milestone page' do it 'should appear in milestone page' do
visit project_milestone_path(project, milestone) visit project_milestone_path(project, milestone)
expect(find('#promote_burndown_charts')).to have_content 'Improve milestone with Burndown Charts.' expect(find('#promote_burndown_charts')).to have_content 'Improve milestone with Burndown Charts.'
expect(find('#promote_burndown_charts')).to have_content 'Burndown Charts are visual representations of the progress of completing a milestone.'
end end
it 'does not show when cookie is set' do it 'does not show when cookie is set' do
...@@ -216,7 +211,6 @@ describe 'Promotions', js: true do ...@@ -216,7 +211,6 @@ describe 'Promotions', js: true do
visit project_issues_path(project) visit project_issues_path(project)
click_on 'Export as CSV' click_on 'Export as CSV'
expect(find('.issues-export-modal')).to have_content 'Export issues with GitLab Enterprise Edition.' expect(find('.issues-export-modal')).to have_content 'Export issues with GitLab Enterprise Edition.'
expect(find('.issues-export-modal')).to have_content 'Export Issues to CSV enables you and your team to export all the data collected from issues into a comma-separated values (CSV) file'
end end
end end
...@@ -231,7 +225,6 @@ describe 'Promotions', js: true do ...@@ -231,7 +225,6 @@ 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 way to keep track of important events that happened in GitLab.'
end end
end end
...@@ -246,7 +239,6 @@ describe 'Promotions', js: true do ...@@ -246,7 +239,6 @@ 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.' 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.'
end end
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