Commit 30f0909c authored by Tim Zallmann's avatar Tim Zallmann

Adjustments to calling logic

parent 6e362e9c
......@@ -76,21 +76,21 @@ module LicenseHelper
end
def show_promotions?(selected_user = current_user)
if selected_user
return @show_promotions if defined?(@show_promotions)
return false unless selected_user
@show_promotions =
if current_application_settings.should_check_namespace_plan?
true
else
license = License.current
license.nil? || license.expired?
end
end
return @show_promotions if defined?(@show_promotions)
@show_promotions =
if current_application_settings.should_check_namespace_plan?
true
else
license = License.current
license.nil? || license.expired?
end
end
def show_project_feature_promotion?(project_feature, callout_id = '')
!@project.feature_available?(project_feature) && show_promotions? && show_callout?(callout_id)
def show_project_feature_promotion?(project_feature, callout_id = nil)
!@project.feature_available?(project_feature) && show_promotions? && !callout_id.nil? && show_callout?(callout_id)
end
extend self
......
......@@ -8,7 +8,7 @@
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
- if @project.group ? can?(current_user, :admin_group, @project.group) : @project.owner == current_user
- if can?(current_user, :admin_namespace, @project.namespace)
Upgrade your plan to improve milestones with Burndown Charts.
- elsif @project.group
Upgrade the plan for #{ @project.group.name } to improve milestones with Burndown Charts.
......
......@@ -4,7 +4,7 @@
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
- if @project.group ? can?(current_user, :admin_group, @project.group) : @project.owner == current_user
- if can?(current_user, :admin_namespace, @project.namespace)
Upgrade your plan to activate Contribution Analytics.
- elsif @project.group
Upgrade the plan for #{ @project.group.name } to activate Contribution Analytics.
......
- if show_project_feature_promotion?(:merge_request_approvers, 'promote_mr_features_dismissed') || show_project_feature_promotion?(:fast_forward_merge, 'promote_mr_features_dismissed')
- if show_promotions? && show_callout?('promote_mr_features_dismissed') && (!@project.feature_available?(:merge_request_approvers) || !@project.feature_available?(:fast_forward_merge))
.user-callout.promotion-callout.append-bottom-20.js-mr-approval-callout#promote_mr_features{ data: { uid: 'promote_mr_features_dismissed' } }
.bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Merge Request promotion' }
......
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