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
fa55b7e7
Commit
fa55b7e7
authored
Jul 08, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preselect plan on mount
parent
394d1a47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
ee/app/assets/javascripts/subscriptions/buy_minutes/components/checkout.vue
...scripts/subscriptions/buy_minutes/components/checkout.vue
+20
-0
ee/app/assets/javascripts/subscriptions/buy_minutes/components/checkout/confirm_order.vue
...iptions/buy_minutes/components/checkout/confirm_order.vue
+0
-13
ee/app/assets/javascripts/subscriptions/buy_minutes/utils.js
ee/app/assets/javascripts/subscriptions/buy_minutes/utils.js
+2
-2
No files found.
ee/app/assets/javascripts/subscriptions/buy_minutes/components/checkout.vue
View file @
fa55b7e7
<
script
>
import
updateState
from
'
ee/subscriptions/graphql/mutations/update_state.mutation.graphql
'
;
import
{
GENERAL_ERROR_MESSAGE
}
from
'
ee/vue_shared/purchase_flow/constants
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
AddonPurchaseDetails
from
'
./checkout/addon_purchase_details.vue
'
;
import
BillingAddress
from
'
./checkout/billing_address.vue
'
;
...
...
@@ -13,6 +16,23 @@ export default {
required
:
true
,
},
},
mounted
()
{
this
.
updateSelectedPlanId
(
this
.
plan
.
id
);
},
methods
:
{
updateSelectedPlanId
(
planId
)
{
this
.
$apollo
.
mutate
({
mutation
:
updateState
,
variables
:
{
input
:
{
selectedPlanId
:
planId
},
},
})
.
catch
((
error
)
=>
{
createFlash
({
message
:
GENERAL_ERROR_MESSAGE
,
error
,
captureError
:
true
});
});
},
},
i18n
:
{
checkout
:
s__
(
'
Checkout|Checkout
'
),
},
...
...
ee/app/assets/javascripts/subscriptions/buy_minutes/components/checkout/confirm_order.vue
View file @
fa55b7e7
...
...
@@ -31,21 +31,8 @@ export default {
confirmOrderParams
:
{
query
:
stateQuery
,
update
(
data
)
{
const
{
customer
}
=
data
;
return
{
setup_for_company
:
data
.
isSetupForCompany
,
selected_group
:
data
.
subscription
.
namespaceId
,
new_user
:
data
.
isNewUser
,
customer
:
{
country
:
customer
.
country
,
address_1
:
customer
.
address1
,
address_2
:
customer
.
address2
,
city
:
customer
.
city
,
state
:
customer
.
state
,
zip_code
:
customer
.
zipCode
,
company
:
customer
.
company
,
},
subscription
:
{
plan_id
:
data
.
selectedPlanId
,
payment_method_id
:
data
.
paymentMethod
.
id
,
...
...
ee/app/assets/javascripts/subscriptions/buy_minutes/utils.js
View file @
fa55b7e7
...
...
@@ -11,7 +11,7 @@ function arrayToGraphqlArray(arr, typename) {
}
export
function
writeInitialDataToApolloCache
(
apolloProvider
,
dataset
)
{
const
{
groupData
,
namespaceId
,
planId
=
null
}
=
dataset
;
const
{
groupData
,
namespaceId
}
=
dataset
;
// eslint-disable-next-line @gitlab/require-i18n-strings
const
namespaces
=
arrayToGraphqlArray
(
JSON
.
parse
(
groupData
),
'
Namespace
'
);
...
...
@@ -21,7 +21,7 @@ export function writeInitialDataToApolloCache(apolloProvider, dataset) {
isNewUser
:
false
,
fullName
:
null
,
isSetupForCompany
:
false
,
selectedPlanId
:
planId
,
selectedPlanId
:
null
,
namespaces
,
subscription
:
{
quantity
:
1
,
...
...
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