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
5ff1f1d2
Commit
5ff1f1d2
authored
Aug 24, 2021
by
Jason Goodman
Committed by
Phil Hughes
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Popover Trial Status Text for New Trials
parent
cfdec1f8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
7 deletions
+28
-7
ee/app/assets/javascripts/billings/billings_util.js
ee/app/assets/javascripts/billings/billings_util.js
+3
-0
ee/app/assets/javascripts/billings/constants.js
ee/app/assets/javascripts/billings/constants.js
+0
-2
ee/app/assets/javascripts/billings/subscriptions/components/subscription_table.vue
.../billings/subscriptions/components/subscription_table.vue
+2
-2
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
...ts/contextual_sidebar/components/trial_status_popover.vue
+6
-2
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_widget.vue
...pts/contextual_sidebar/components/trial_status_widget.vue
+2
-1
ee/spec/frontend/contextual_sidebar/trial_status_popover_spec.js
.../frontend/contextual_sidebar/trial_status_popover_spec.js
+9
-0
ee/spec/frontend/contextual_sidebar/trial_status_widget_spec.js
...c/frontend/contextual_sidebar/trial_status_widget_spec.js
+6
-0
No files found.
ee/app/assets/javascripts/billings/billings_util.js
0 → 100644
View file @
5ff1f1d2
export
function
removeTrialSuffix
(
planName
)
{
return
planName
.
replace
(
/ trial
\b
/i
,
''
);
}
ee/app/assets/javascripts/billings/constants.js
View file @
5ff1f1d2
...
@@ -3,5 +3,3 @@ export const TABLE_TYPE_FREE = 'free';
...
@@ -3,5 +3,3 @@ export const TABLE_TYPE_FREE = 'free';
export
const
TABLE_TYPE_TRIAL
=
'
trial
'
;
export
const
TABLE_TYPE_TRIAL
=
'
trial
'
;
export
const
DAYS_FOR_RENEWAL
=
15
;
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 @
5ff1f1d2
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
removeTrialSuffix
}
from
'
ee/billings/billings_util
'
;
import
{
import
{
TABLE_TYPE_DEFAULT
,
TABLE_TYPE_DEFAULT
,
TABLE_TYPE_FREE
,
TABLE_TYPE_FREE
,
TABLE_TYPE_TRIAL
,
TABLE_TYPE_TRIAL
,
DAYS_FOR_RENEWAL
,
DAYS_FOR_RENEWAL
,
PLAN_TITLE_TRIAL_TEXT
,
}
from
'
ee/billings/constants
'
;
}
from
'
ee/billings/constants
'
;
import
ExtendReactivateTrialButton
from
'
ee/trials/extend_reactivate_trial/components/extend_reactivate_trial_button.vue
'
;
import
ExtendReactivateTrialButton
from
'
ee/trials/extend_reactivate_trial/components/extend_reactivate_trial_button.vue
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
...
@@ -79,7 +79,7 @@ export default {
...
@@ -79,7 +79,7 @@ export default {
subscriptionHeader
()
{
subscriptionHeader
()
{
const
planName
=
this
.
isFreePlan
const
planName
=
this
.
isFreePlan
?
s__
(
'
SubscriptionTable|Free
'
)
?
s__
(
'
SubscriptionTable|Free
'
)
:
escape
(
this
.
planName
.
replace
(
PLAN_TITLE_TRIAL_TEXT
,
''
));
:
escape
(
removeTrialSuffix
(
this
.
planName
));
const
suffix
=
this
.
isSubscription
&&
this
.
plan
.
trial
?
s__
(
'
SubscriptionTable|Trial
'
)
:
''
;
const
suffix
=
this
.
isSubscription
&&
this
.
plan
.
trial
?
s__
(
'
SubscriptionTable|Trial
'
)
:
''
;
return
`
${
this
.
namespaceName
}
:
${
planName
}
${
suffix
}
`
;
return
`
${
this
.
namespaceName
}
:
${
planName
}
${
suffix
}
`
;
...
...
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
View file @
5ff1f1d2
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
GlButton
,
GlPopover
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlPopover
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
removeTrialSuffix
}
from
'
ee/billings/billings_util
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
...
@@ -56,10 +57,13 @@ export default {
...
@@ -56,10 +57,13 @@ export default {
formattedTrialEndDate
()
{
formattedTrialEndDate
()
{
return
formatDate
(
this
.
trialEndDate
,
trialEndDateFormatString
);
return
formatDate
(
this
.
trialEndDate
,
trialEndDateFormatString
);
},
},
planNameWithoutTrial
()
{
return
removeTrialSuffix
(
this
.
planName
);
},
upgradeButtonTitle
()
{
upgradeButtonTitle
()
{
return
sprintf
(
this
.
$options
.
i18n
.
upgradeButtonTitle
,
{
return
sprintf
(
this
.
$options
.
i18n
.
upgradeButtonTitle
,
{
groupName
:
this
.
groupName
,
groupName
:
this
.
groupName
,
planName
:
this
.
planName
,
planName
:
removeTrialSuffix
(
this
.
planName
)
,
});
});
},
},
},
},
...
@@ -162,7 +166,7 @@ export default {
...
@@ -162,7 +166,7 @@ export default {
<
template
#bold=
"{ content }"
>
<
template
#bold=
"{ content }"
>
<b>
{{
sprintf
(
content
,
{
trialEndDate
:
formattedTrialEndDate
}
)
}}
<
/b
>
<b>
{{
sprintf
(
content
,
{
trialEndDate
:
formattedTrialEndDate
}
)
}}
<
/b
>
<
/template
>
<
/template
>
<
template
#
planName
>
{{
planName
}}
<
/template
>
<
template
#
planName
>
{{
planName
WithoutTrial
}}
<
/template
>
<
/gl-sprintf
>
<
/gl-sprintf
>
<
div
class
=
"
gl-mt-5
"
>
<
div
class
=
"
gl-mt-5
"
>
...
...
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_widget.vue
View file @
5ff1f1d2
<
script
>
<
script
>
import
{
GlLink
,
GlProgressBar
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlProgressBar
}
from
'
@gitlab/ui
'
;
import
{
removeTrialSuffix
}
from
'
ee/billings/billings_util
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
EXPERIMENT_KEY
,
WIDGET
}
from
'
./constants
'
;
import
{
EXPERIMENT_KEY
,
WIDGET
}
from
'
./constants
'
;
...
@@ -26,7 +27,7 @@ export default {
...
@@ -26,7 +27,7 @@ export default {
const
i18nWidgetTitle
=
i18n
.
widgetTitle
.
countableTranslator
(
this
.
daysRemaining
);
const
i18nWidgetTitle
=
i18n
.
widgetTitle
.
countableTranslator
(
this
.
daysRemaining
);
return
sprintf
(
i18nWidgetTitle
,
{
return
sprintf
(
i18nWidgetTitle
,
{
planName
:
this
.
planName
,
planName
:
removeTrialSuffix
(
this
.
planName
)
,
enDash
:
'
–
'
,
enDash
:
'
–
'
,
num
:
this
.
daysRemaining
,
num
:
this
.
daysRemaining
,
});
});
...
...
ee/spec/frontend/contextual_sidebar/trial_status_popover_spec.js
View file @
5ff1f1d2
...
@@ -86,6 +86,15 @@ describe('TrialStatusPopover component', () => {
...
@@ -86,6 +86,15 @@ describe('TrialStatusPopover component', () => {
expectTracking
(
trackingEvents
.
compareBtnClick
);
expectTracking
(
trackingEvents
.
compareBtnClick
);
});
});
it
(
'
does not include the word "Trial" if the plan name includes it
'
,
()
=>
{
wrapper
=
createComponent
({
planName
:
'
Ultimate Trial
'
},
mount
);
const
popoverText
=
wrapper
.
text
();
expect
(
popoverText
).
toContain
(
'
We hope you’re enjoying the features of GitLab Ultimate.
'
);
expect
(
popoverText
).
toMatch
(
/Upgrade Some Test Group to Ultimate
(?!
Trial
)
/
);
});
describe
(
'
startInitiallyShown
'
,
()
=>
{
describe
(
'
startInitiallyShown
'
,
()
=>
{
const
userCalloutProviders
=
{
const
userCalloutProviders
=
{
userCalloutsPath
:
'
user_callouts/path
'
,
userCalloutsPath
:
'
user_callouts/path
'
,
...
...
ee/spec/frontend/contextual_sidebar/trial_status_widget_spec.js
View file @
5ff1f1d2
...
@@ -64,6 +64,12 @@ describe('TrialStatusWidget component', () => {
...
@@ -64,6 +64,12 @@ describe('TrialStatusWidget component', () => {
unmockTracking
();
unmockTracking
();
});
});
it
(
'
does not render Trial twice if the plan name includes "Trial"
'
,
()
=>
{
wrapper
=
createComponent
({
planName
:
'
Ultimate Trial
'
});
expect
(
wrapper
.
text
()).
toEqual
(
'
Ultimate Trial – 20 days left
'
);
});
});
});
describe
(
'
with the optional containerId prop
'
,
()
=>
{
describe
(
'
with the optional containerId prop
'
,
()
=>
{
...
...
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