Commit 9ea25a71 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'dz/2374-update-min-users-selectable-for-subscription' into 'master'

Refactor show_plans helper

See merge request gitlab-org/gitlab!67675
parents 81481724 b8e4b3a4
...@@ -89,9 +89,13 @@ module BillingPlansHelper ...@@ -89,9 +89,13 @@ module BillingPlansHelper
end end
def show_plans?(namespace) def show_plans?(namespace)
return false if namespace.free_personal? if namespace.free_personal?
false
namespace.trial_active? || !(namespace.gold_plan? || namespace.ultimate_plan?) elsif namespace.trial_active?
true
else
!highest_tier?(namespace)
end
end end
def show_trial_banner?(namespace) def show_trial_banner?(namespace)
...@@ -190,6 +194,10 @@ module BillingPlansHelper ...@@ -190,6 +194,10 @@ module BillingPlansHelper
.execute .execute
end end
end end
def highest_tier?(namespace)
namespace.gold_plan? || namespace.ultimate_plan?
end
end end
BillingPlansHelper.prepend_mod BillingPlansHelper.prepend_mod
...@@ -561,8 +561,6 @@ RSpec.describe BillingPlansHelper do ...@@ -561,8 +561,6 @@ RSpec.describe BillingPlansHelper do
false | true | false | true | true false | true | false | true | true
false | false | true | true | false false | false | true | true | false
false | true | true | true | true false | true | true | true | true
false | true | true | true | true
false | true | true | true | true
true | true | true | true | false true | true | true | true | false
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