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
9e9b5e69
Commit
9e9b5e69
authored
Feb 11, 2020
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show Progress Bar for new users
When existing users are buying a plan, do not show the progress bar.
parent
fcc2bdb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
5 deletions
+50
-5
ee/app/assets/javascripts/subscriptions/new/components/checkout.vue
...ets/javascripts/subscriptions/new/components/checkout.vue
+5
-1
ee/app/assets/javascripts/subscriptions/new/store/state.js
ee/app/assets/javascripts/subscriptions/new/store/state.js
+5
-4
ee/spec/frontend/subscriptions/new/components/checkout_spec.js
...ec/frontend/subscriptions/new/components/checkout_spec.js
+40
-0
No files found.
ee/app/assets/javascripts/subscriptions/new/components/checkout.vue
View file @
9e9b5e69
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
{
PROGRESS_STEPS
}
from
'
../constants
'
;
import
{
mapState
}
from
'
vuex
'
;
import
ProgressBar
from
'
./checkout/progress_bar.vue
'
;
import
SubscriptionDetails
from
'
./checkout/subscription_details.vue
'
;
import
BillingAddress
from
'
./checkout/billing_address.vue
'
;
...
...
@@ -14,6 +15,9 @@ export default {
step
:
PROGRESS_STEPS
.
checkout
,
};
},
computed
:
{
...
mapState
([
'
newUser
'
]),
},
i18n
:
{
checkout
:
s__
(
'
Checkout|Checkout
'
),
},
...
...
@@ -22,7 +26,7 @@ export default {
<
template
>
<div
class=
"checkout d-flex flex-column justify-content-between w-100"
>
<div
class=
"full-width"
>
<progress-bar
:step=
"step"
/>
<progress-bar
v-if=
"newUser"
:step=
"step"
/>
<div
class=
"flash-container"
></div>
<h2
class=
"mt-4 mb-3 mb-lg-5"
>
{{
$options
.
i18n
.
checkout
}}
</h2>
<subscription-details
/>
...
...
ee/app/assets/javascripts/subscriptions/new/store/state.js
View file @
9e9b5e69
...
...
@@ -16,14 +16,15 @@ const determineSelectedPlan = (planId, plans) => {
return
plans
[
0
]
&&
plans
[
0
].
value
;
};
export
default
({
planData
=
'
[]
'
,
planId
,
setupForCompany
,
fullName
})
=>
{
const
p
lans
=
parsePlanData
(
planData
);
export
default
({
planData
=
'
[]
'
,
planId
,
setupForCompany
,
fullName
,
newUser
})
=>
{
const
availableP
lans
=
parsePlanData
(
planData
);
return
{
currentStep
:
STEPS
[
0
],
availablePlans
:
plans
,
selectedPlan
:
determineSelectedPlan
(
planId
,
plans
),
isSetupForCompany
:
parseBoolean
(
setupForCompany
),
availablePlans
,
selectedPlan
:
determineSelectedPlan
(
planId
,
availablePlans
),
newUser
:
parseBoolean
(
newUser
),
fullName
,
organizationName
:
null
,
numberOfUsers
:
parseBoolean
(
setupForCompany
)
?
0
:
1
,
...
...
ee/spec/frontend/subscriptions/new/components/checkout_spec.js
0 → 100644
View file @
9e9b5e69
import
Vuex
from
'
vuex
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
createStore
from
'
ee/subscriptions/new/store
'
;
import
Component
from
'
ee/subscriptions/new/components/checkout.vue
'
;
import
ProgressBar
from
'
ee/subscriptions/new/components/checkout/progress_bar.vue
'
;
describe
(
'
Checkout
'
,
()
=>
{
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
let
store
;
let
wrapper
;
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
Component
,
{
store
,
});
};
const
findProgressBar
=
()
=>
wrapper
.
find
(
ProgressBar
);
beforeEach
(()
=>
{
store
=
createStore
();
createComponent
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
describe
.
each
([[
true
,
true
],
[
false
,
false
]])(
'
when newUser=%s
'
,
(
newUser
,
visible
)
=>
{
beforeEach
(()
=>
{
store
.
state
.
newUser
=
newUser
;
});
it
(
`progress bar visibility is
${
visible
}
`
,
()
=>
{
expect
(
findProgressBar
().
exists
()).
toBe
(
visible
);
});
});
});
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