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
dc9c50d7
Commit
dc9c50d7
authored
Jan 23, 2021
by
Ammar Alakkad
Committed by
Vitaly Slobodin
Jan 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use plan name instead of plan code in new subscription app
parent
062788e5
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
14 deletions
+19
-14
ee/app/assets/javascripts/subscriptions/new/store/state.js
ee/app/assets/javascripts/subscriptions/new/store/state.js
+1
-1
ee/app/helpers/subscriptions_helper.rb
ee/app/helpers/subscriptions_helper.rb
+1
-1
ee/changelogs/unreleased/aalakkad-use-plan-name-instead-of-code.yml
...ogs/unreleased/aalakkad-use-plan-name-instead-of-code.yml
+5
-0
ee/spec/frontend/subscriptions/new/components/checkout/order_summary_spec.js
...bscriptions/new/components/checkout/order_summary_spec.js
+3
-3
ee/spec/frontend/subscriptions/new/components/checkout/subscription_details_spec.js
...ions/new/components/checkout/subscription_details_spec.js
+2
-2
ee/spec/frontend/subscriptions/new/store/state_spec.js
ee/spec/frontend/subscriptions/new/store/state_spec.js
+4
-4
ee/spec/helpers/subscriptions_helper_spec.rb
ee/spec/helpers/subscriptions_helper_spec.rb
+3
-3
No files found.
ee/app/assets/javascripts/subscriptions/new/store/state.js
View file @
dc9c50d7
...
@@ -5,7 +5,7 @@ import { STEPS, TAX_RATE } from '../constants';
...
@@ -5,7 +5,7 @@ import { STEPS, TAX_RATE } from '../constants';
const
parsePlanData
=
(
planData
)
=>
const
parsePlanData
=
(
planData
)
=>
JSON
.
parse
(
planData
).
map
((
plan
)
=>
({
JSON
.
parse
(
planData
).
map
((
plan
)
=>
({
value
:
plan
.
id
,
value
:
plan
.
id
,
text
:
capitalizeFirstCharacter
(
plan
.
cod
e
),
text
:
capitalizeFirstCharacter
(
plan
.
nam
e
),
pricePerUserPerYear
:
plan
.
price_per_year
,
pricePerUserPerYear
:
plan
.
price_per_year
,
}));
}));
...
...
ee/app/helpers/subscriptions_helper.rb
View file @
dc9c50d7
...
@@ -34,7 +34,7 @@ module SubscriptionsHelper
...
@@ -34,7 +34,7 @@ module SubscriptionsHelper
FetchSubscriptionPlansService
.
new
(
plan: :free
).
execute
FetchSubscriptionPlansService
.
new
(
plan: :free
).
execute
.
map
(
&
:symbolize_keys
)
.
map
(
&
:symbolize_keys
)
.
reject
{
|
plan_data
|
plan_data
[
:free
]
}
.
reject
{
|
plan_data
|
plan_data
[
:free
]
}
.
map
{
|
plan_data
|
plan_data
.
slice
(
:id
,
:code
,
:price_per_year
,
:deprecated
)
}
.
map
{
|
plan_data
|
plan_data
.
slice
(
:id
,
:code
,
:price_per_year
,
:deprecated
,
:name
)
}
end
end
def
subscription_available_plans
def
subscription_available_plans
...
...
ee/changelogs/unreleased/aalakkad-use-plan-name-instead-of-code.yml
0 → 100644
View file @
dc9c50d7
---
title
:
Use plan name instead of plan code in new subscription app
merge_request
:
52414
author
:
type
:
other
ee/spec/frontend/subscriptions/new/components/checkout/order_summary_spec.js
View file @
dc9c50d7
...
@@ -11,9 +11,9 @@ describe('Order Summary', () => {
...
@@ -11,9 +11,9 @@ describe('Order Summary', () => {
let
wrapper
;
let
wrapper
;
const
availablePlans
=
[
const
availablePlans
=
[
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
},
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
,
name
:
'
bronze plan
'
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
,
name
:
'
silver plan
'
},
{
id
:
'
thirdPlanId
'
,
code
:
'
gold
'
,
price_per_year
:
1188
},
{
id
:
'
thirdPlanId
'
,
code
:
'
gold
'
,
price_per_year
:
1188
,
name
:
'
gold plan
'
},
];
];
const
initialData
=
{
const
initialData
=
{
...
...
ee/spec/frontend/subscriptions/new/components/checkout/subscription_details_spec.js
View file @
dc9c50d7
...
@@ -14,8 +14,8 @@ describe('Subscription Details', () => {
...
@@ -14,8 +14,8 @@ describe('Subscription Details', () => {
let
wrapper
;
let
wrapper
;
const
availablePlans
=
[
const
availablePlans
=
[
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
},
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
,
name
:
'
bronze
'
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
,
name
:
'
silver
'
},
];
];
const
groupData
=
[
const
groupData
=
[
...
...
ee/spec/frontend/subscriptions/new/store/state_spec.js
View file @
dc9c50d7
...
@@ -6,8 +6,8 @@ constants.TAX_RATE = 0;
...
@@ -6,8 +6,8 @@ constants.TAX_RATE = 0;
describe
(
'
projectsSelector default state
'
,
()
=>
{
describe
(
'
projectsSelector default state
'
,
()
=>
{
const
availablePlans
=
[
const
availablePlans
=
[
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
},
{
id
:
'
firstPlanId
'
,
code
:
'
bronze
'
,
price_per_year
:
48
,
name
:
'
Bronze Plan
'
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
},
{
id
:
'
secondPlanId
'
,
code
:
'
silver
'
,
price_per_year
:
228
,
name
:
'
silver Plan
'
},
];
];
const
groupData
=
[
const
groupData
=
[
...
@@ -38,8 +38,8 @@ describe('projectsSelector default state', () => {
...
@@ -38,8 +38,8 @@ describe('projectsSelector default state', () => {
describe
(
'
availablePlans
'
,
()
=>
{
describe
(
'
availablePlans
'
,
()
=>
{
it
(
'
sets the availablePlans to the provided parsed availablePlans
'
,
()
=>
{
it
(
'
sets the availablePlans to the provided parsed availablePlans
'
,
()
=>
{
expect
(
state
.
availablePlans
).
toEqual
([
expect
(
state
.
availablePlans
).
toEqual
([
{
value
:
'
firstPlanId
'
,
text
:
'
Bronze
'
,
pricePerUserPerYear
:
48
},
{
value
:
'
firstPlanId
'
,
text
:
'
Bronze
Plan
'
,
pricePerUserPerYear
:
48
},
{
value
:
'
secondPlanId
'
,
text
:
'
Silver
'
,
pricePerUserPerYear
:
228
},
{
value
:
'
secondPlanId
'
,
text
:
'
Silver
Plan
'
,
pricePerUserPerYear
:
228
},
]);
]);
});
});
...
...
ee/spec/helpers/subscriptions_helper_spec.rb
View file @
dc9c50d7
...
@@ -45,7 +45,7 @@ RSpec.describe SubscriptionsHelper do
...
@@ -45,7 +45,7 @@ RSpec.describe SubscriptionsHelper do
it
{
is_expected
.
to
include
(
setup_for_company:
'false'
)
}
it
{
is_expected
.
to
include
(
setup_for_company:
'false'
)
}
it
{
is_expected
.
to
include
(
full_name:
'First Last'
)
}
it
{
is_expected
.
to
include
(
full_name:
'First Last'
)
}
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0}]'
)
}
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0
,"name":"Bronze Plan"
}]'
)
}
it
{
is_expected
.
to
include
(
plan_id:
'bronze_id'
)
}
it
{
is_expected
.
to
include
(
plan_id:
'bronze_id'
)
}
it
{
is_expected
.
to
include
(
namespace_id:
group
.
id
.
to_s
)
}
it
{
is_expected
.
to
include
(
namespace_id:
group
.
id
.
to_s
)
}
it
{
is_expected
.
to
include
(
group_data:
%Q{[{"id":
#{
group
.
id
}
,"name":"My Namespace","users":1}]}
)
}
it
{
is_expected
.
to
include
(
group_data:
%Q{[{"id":
#{
group
.
id
}
,"name":"My Namespace","users":1}]}
)
}
...
@@ -78,7 +78,7 @@ RSpec.describe SubscriptionsHelper do
...
@@ -78,7 +78,7 @@ RSpec.describe SubscriptionsHelper do
}
}
end
end
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0,"deprecated":true}]'
)
}
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0,"deprecated":true
,"name":"Bronze Plan"
}]'
)
}
end
end
context
'when ff purchase_deprecated_plans is enabled'
do
context
'when ff purchase_deprecated_plans is enabled'
do
...
@@ -86,7 +86,7 @@ RSpec.describe SubscriptionsHelper do
...
@@ -86,7 +86,7 @@ RSpec.describe SubscriptionsHelper do
stub_feature_flags
(
hide_deprecated_billing_plans:
true
)
stub_feature_flags
(
hide_deprecated_billing_plans:
true
)
end
end
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0}]'
)
}
it
{
is_expected
.
to
include
(
available_plans:
'[{"id":"bronze_id","code":"bronze","price_per_year":48.0
,"name":"Bronze Plan"
}]'
)
}
context
'when bronze_plan is deprecated'
do
context
'when bronze_plan is deprecated'
do
let
(
:bronze_plan
)
do
let
(
:bronze_plan
)
do
...
...
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