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
0957a281
Commit
0957a281
authored
Jan 13, 2022
by
dzubova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show expiration date for non-prorated purchases
parent
39b7314a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
ee/app/assets/javascripts/subscriptions/buy_addons_shared/components/order_summary.vue
...scriptions/buy_addons_shared/components/order_summary.vue
+2
-0
ee/app/assets/javascripts/subscriptions/buy_addons_shared/components/order_summary/summary_details.vue
...ddons_shared/components/order_summary/summary_details.vue
+8
-2
ee/spec/frontend/subscriptions/buy_addons_shared/components/order_summary/summary_details_spec.js
...s_shared/components/order_summary/summary_details_spec.js
+12
-1
No files found.
ee/app/assets/javascripts/subscriptions/buy_addons_shared/components/order_summary.vue
View file @
0957a281
...
...
@@ -154,6 +154,7 @@ export default {
:quantity=
"quantity"
:tax-rate=
"$options.taxRate"
:subscription-end-date=
"endDate"
:has-expiration=
"purchaseHasExpiration"
>
<template
#price-per-unit
="
{ price }">
<slot
name=
"price-per-unit"
:price=
"price"
></slot>
...
...
@@ -178,6 +179,7 @@ export default {
:quantity=
"quantity"
:tax-rate=
"$options.taxRate"
:subscription-end-date=
"endDate"
:has-expiration=
"purchaseHasExpiration"
>
<
template
#price-per-unit=
"{ price }"
>
<slot
name=
"price-per-unit"
:price=
"price"
></slot>
...
...
ee/app/assets/javascripts/subscriptions/buy_addons_shared/components/order_summary/summary_details.vue
View file @
0957a281
...
...
@@ -52,6 +52,11 @@ export default {
required
:
false
,
default
:
''
,
},
hasExpiration
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
data
()
{
return
{
...
...
@@ -61,7 +66,8 @@ export default {
computed
:
{
endDate
()
{
return
(
this
.
subscriptionEndDate
||
this
.
startDate
.
setFullYear
(
this
.
startDate
.
getFullYear
()
+
1
)
this
.
subscriptionEndDate
||
new
Date
(
this
.
startDate
).
setFullYear
(
this
.
startDate
.
getFullYear
()
+
1
)
);
},
hasPositiveQuantity
()
{
...
...
@@ -107,7 +113,7 @@ export default {
<
div
class
=
"
gl-text-gray-500
"
data
-
testid
=
"
price-per-unit
"
>
<
slot
name
=
"
price-per-unit
"
:
price
=
"
formattedPrice
"
><
/slot
>
<
/div
>
<
div
v
-
if
=
"
subscriptionEndDate
"
class
=
"
gl-text-gray-500
"
data
-
testid
=
"
subscription-period
"
>
<
div
v
-
if
=
"
hasExpiration
"
class
=
"
gl-text-gray-500
"
data
-
testid
=
"
subscription-period
"
>
{{
sprintf
(
$options
.
i18n
.
dates
,
{
startDate
:
formatDate
(
startDate
),
...
...
ee/spec/frontend/subscriptions/buy_addons_shared/components/order_summary/summary_details_spec.js
View file @
0957a281
...
...
@@ -83,7 +83,18 @@ describe('SummaryDetails', () => {
describe
(
'
when subscription has expiration
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
subscriptionEndDate
:
'
2021-02-06
'
});
wrapper
=
createComponent
({
hasExpiration
:
true
});
});
it
(
'
renders subscription period
'
,
()
=>
{
expect
(
findSubscriptionPeriod
().
isVisible
()).
toBe
(
true
);
expect
(
findSubscriptionPeriod
().
text
()).
toBe
(
'
Jul 6, 2020 - Jul 6, 2021
'
);
});
});
describe
(
'
when subscription has expiration and the end date provided
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
subscriptionEndDate
:
'
2021-02-06
'
,
hasExpiration
:
true
});
});
it
(
'
renders subscription period
'
,
()
=>
{
...
...
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