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
15a176ee
Commit
15a176ee
authored
May 03, 2021
by
Shreyas Agarwal
Committed by
James Lopez
May 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow trial plans to behave paid plan
parent
90f218ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+10
-2
ee/app/models/ee/plan.rb
ee/app/models/ee/plan.rb
+3
-1
ee/changelogs/unreleased/322043-behave-trial-as-paid-plan.yml
...hangelogs/unreleased/322043-behave-trial-as-paid-plan.yml
+5
-0
ee/spec/factories/gitlab_subscriptions.rb
ee/spec/factories/gitlab_subscriptions.rb
+8
-0
No files found.
ee/app/models/ee/namespace.rb
View file @
15a176ee
...
...
@@ -12,8 +12,8 @@ module EE
NAMESPACE_PLANS_TO_LICENSE_PLANS
=
{
::
Plan
::
BRONZE
=>
License
::
STARTER_PLAN
,
[
::
Plan
::
SILVER
,
::
Plan
::
PREMIUM
]
=>
License
::
PREMIUM_PLAN
,
[
::
Plan
::
GOLD
,
::
Plan
::
ULTIMATE
]
=>
License
::
ULTIMATE_PLAN
[
::
Plan
::
SILVER
,
::
Plan
::
PREMIUM
,
::
Plan
::
PREMIUM_TRIAL
]
=>
License
::
PREMIUM_PLAN
,
[
::
Plan
::
GOLD
,
::
Plan
::
ULTIMATE
,
::
Plan
::
ULTIMATE_TRIAL
]
=>
License
::
ULTIMATE_PLAN
}.
freeze
LICENSE_PLANS_TO_NAMESPACE_PLANS
=
NAMESPACE_PLANS_TO_LICENSE_PLANS
.
invert
.
freeze
...
...
@@ -342,6 +342,10 @@ module EE
actual_plan_name
==
::
Plan
::
PREMIUM
end
def
premium_trial_plan?
actual_plan_name
==
::
Plan
::
PREMIUM_TRIAL
end
def
gold_plan?
actual_plan_name
==
::
Plan
::
GOLD
end
...
...
@@ -350,6 +354,10 @@ module EE
actual_plan_name
==
::
Plan
::
ULTIMATE
end
def
ultimate_trial_plan?
actual_plan_name
==
::
Plan
::
ULTIMATE_TRIAL
end
def
plan_eligible_for_trial?
::
Plan
::
PLANS_ELIGIBLE_FOR_TRIAL
.
include?
(
actual_plan_name
)
end
...
...
ee/app/models/ee/plan.rb
View file @
15a176ee
...
...
@@ -12,9 +12,11 @@ module EE
PREMIUM
=
'premium'
GOLD
=
'gold'
ULTIMATE
=
'ultimate'
ULTIMATE_TRIAL
=
'ultimate_trial'
PREMIUM_TRIAL
=
'premium_trial'
EE_DEFAULT_PLANS
=
(
const_get
(
:DEFAULT_PLANS
,
false
)
+
[
FREE
]).
freeze
PAID_HOSTED_PLANS
=
[
BRONZE
,
SILVER
,
PREMIUM
,
GOLD
,
ULTIMATE
].
freeze
PAID_HOSTED_PLANS
=
[
BRONZE
,
SILVER
,
PREMIUM
,
GOLD
,
ULTIMATE
,
ULTIMATE_TRIAL
,
PREMIUM_TRIAL
].
freeze
EE_ALL_PLANS
=
(
EE_DEFAULT_PLANS
+
PAID_HOSTED_PLANS
).
freeze
PLANS_ELIGIBLE_FOR_TRIAL
=
EE_DEFAULT_PLANS
...
...
ee/changelogs/unreleased/322043-behave-trial-as-paid-plan.yml
0 → 100644
View file @
15a176ee
---
title
:
Allow trial plans to behave paid plan
merge_request
:
60496
author
:
type
:
added
ee/spec/factories/gitlab_subscriptions.rb
View file @
15a176ee
...
...
@@ -53,5 +53,13 @@ FactoryBot.define do
trait
:ultimate
do
association
:hosted_plan
,
factory: :ultimate_plan
end
trait
:premium_trial
do
association
:hosted_plan
,
factory: :premium_trial_plan
end
trait
:ultimate_trial
do
association
:hosted_plan
,
factory: :ultimate_trial_plan
end
end
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