Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b8e4b3a4
Commit
b8e4b3a4
authored
Aug 09, 2021
by
Diana Zubova
Committed by
Sean McGivern
Aug 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor show_plans helper
parent
8b030d4c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
ee/app/helpers/billing_plans_helper.rb
ee/app/helpers/billing_plans_helper.rb
+11
-3
ee/spec/helpers/billing_plans_helper_spec.rb
ee/spec/helpers/billing_plans_helper_spec.rb
+0
-2
No files found.
ee/app/helpers/billing_plans_helper.rb
View file @
b8e4b3a4
...
...
@@ -89,9 +89,13 @@ module BillingPlansHelper
end
def
show_plans?
(
namespace
)
return
false
if
namespace
.
free_personal?
namespace
.
trial_active?
||
!
(
namespace
.
gold_plan?
||
namespace
.
ultimate_plan?
)
if
namespace
.
free_personal?
false
elsif
namespace
.
trial_active?
true
else
!
highest_tier?
(
namespace
)
end
end
def
show_trial_banner?
(
namespace
)
...
...
@@ -190,6 +194,10 @@ module BillingPlansHelper
.
execute
end
end
def
highest_tier?
(
namespace
)
namespace
.
gold_plan?
||
namespace
.
ultimate_plan?
end
end
BillingPlansHelper
.
prepend_mod
ee/spec/helpers/billing_plans_helper_spec.rb
View file @
b8e4b3a4
...
...
@@ -561,8 +561,6 @@ RSpec.describe BillingPlansHelper do
false
|
true
|
false
|
true
|
true
false
|
false
|
true
|
true
|
false
false
|
true
|
true
|
true
|
true
false
|
true
|
true
|
true
|
true
false
|
true
|
true
|
true
|
true
true
|
true
|
true
|
true
|
false
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment