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

Adjustments to calling logic

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