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
3e3ec645
Commit
3e3ec645
authored
Jul 26, 2021
by
Jason Goodman
Committed by
Kushal Pandya
Jul 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Duplication of Trial on Billing Page Subscription Header
parent
1cc201fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
ee/app/assets/javascripts/billings/constants.js
ee/app/assets/javascripts/billings/constants.js
+2
-0
ee/app/assets/javascripts/billings/subscriptions/components/subscription_table.vue
.../billings/subscriptions/components/subscription_table.vue
+4
-1
ee/spec/frontend/billings/subscriptions/components/subscription_table_spec.js
...lings/subscriptions/components/subscription_table_spec.js
+23
-3
No files found.
ee/app/assets/javascripts/billings/constants.js
View file @
3e3ec645
...
...
@@ -8,3 +8,5 @@ export const HEADER_PAGE_NUMBER = 'x-page';
export
const
HEADER_ITEMS_PER_PAGE
=
'
x-per-page
'
;
export
const
DAYS_FOR_RENEWAL
=
15
;
export
const
PLAN_TITLE_TRIAL_TEXT
=
'
Trial
'
;
ee/app/assets/javascripts/billings/subscriptions/components/subscription_table.vue
View file @
3e3ec645
...
...
@@ -7,6 +7,7 @@ import {
TABLE_TYPE_FREE
,
TABLE_TYPE_TRIAL
,
DAYS_FOR_RENEWAL
,
PLAN_TITLE_TRIAL_TEXT
,
}
from
'
ee/billings/constants
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
...
...
@@ -68,7 +69,9 @@ export default {
return
!
this
.
isFreePlan
;
},
subscriptionHeader
()
{
const
planName
=
this
.
isFreePlan
?
s__
(
'
SubscriptionTable|Free
'
)
:
escape
(
this
.
planName
);
const
planName
=
this
.
isFreePlan
?
s__
(
'
SubscriptionTable|Free
'
)
:
escape
(
this
.
planName
.
replace
(
PLAN_TITLE_TRIAL_TEXT
,
''
));
const
suffix
=
this
.
isSubscription
&&
this
.
plan
.
trial
?
s__
(
'
SubscriptionTable|Trial
'
)
:
''
;
return
`
${
this
.
namespaceName
}
:
${
planName
}
${
suffix
}
`
;
...
...
ee/spec/frontend/billings/subscriptions/components/subscription_table_spec.js
View file @
3e3ec645
...
...
@@ -97,16 +97,36 @@ describe('SubscriptionTable component', () => {
});
describe
(
'
when it is a trial
'
,
()
=>
{
it
(
'
should render the card title "GitLab.com: Trial"
'
,
async
()
=>
{
it
(
'
renders the card title
'
,
async
()
=>
{
await
createComponentWithStore
({
provide
:
{
planName
:
'
Gold Plan
'
,
},
state
:
{
plan
:
{
code
:
'
gold
'
,
trial
:
true
,
},
},
});
expect
(
wrapper
.
findByTestId
(
'
subscription-header
'
).
text
()).
toContain
(
'
Trial
'
);
const
subscriptionHeaderText
=
wrapper
.
findByTestId
(
'
subscription-header
'
).
text
();
expect
(
subscriptionHeaderText
).
toContain
(
'
GitLab.com: Gold Plan Trial
'
);
});
it
(
'
renders the title for a plan with Trial in the name
'
,
async
()
=>
{
await
createComponentWithStore
({
provide
:
{
planName
:
'
Ultimate SaaS Trial Plan
'
,
},
state
:
{
plan
:
{
trial
:
true
,
},
},
});
const
subscriptionHeaderText
=
wrapper
.
findByTestId
(
'
subscription-header
'
).
text
();
expect
(
subscriptionHeaderText
).
toContain
(
'
GitLab.com: Ultimate SaaS Plan Trial
'
);
});
});
...
...
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