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
3a007480
Commit
3a007480
authored
Jun 24, 2021
by
Dallas Reedy
Committed by
Kushal Pandya
Jun 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use provide for unchanging values in trial status components
parent
c73e8e6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
83 deletions
+38
-83
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
...ts/contextual_sidebar/components/trial_status_popover.vue
+8
-30
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_widget.vue
...pts/contextual_sidebar/components/trial_status_widget.vue
+7
-26
ee/app/assets/javascripts/contextual_sidebar/init_trial_status_widget_and_popover.js
...ontextual_sidebar/init_trial_status_widget_and_popover.js
+19
-23
ee/spec/frontend/contextual_sidebar/trial_status_popover_spec.js
.../frontend/contextual_sidebar/trial_status_popover_spec.js
+1
-1
ee/spec/frontend/contextual_sidebar/trial_status_widget_spec.js
...c/frontend/contextual_sidebar/trial_status_widget_spec.js
+3
-3
No files found.
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
View file @
3a007480
...
...
@@ -23,36 +23,14 @@ export default {
GlSprintf
,
},
mixins
:
[
trackingMixin
],
props
:
{
containerId
:
{
type
:
[
String
,
null
],
required
:
false
,
default
:
null
,
},
groupName
:
{
type
:
String
,
required
:
true
,
},
planName
:
{
type
:
String
,
required
:
true
,
},
plansHref
:
{
type
:
String
,
required
:
true
,
},
purchaseHref
:
{
type
:
String
,
required
:
true
,
},
targetId
:
{
type
:
String
,
required
:
true
,
},
trialEndDate
:
{
type
:
Date
,
required
:
true
,
},
inject
:
{
containerId
:
{
default
:
null
},
groupName
:
{},
planName
:
{},
plansHref
:
{},
purchaseHref
:
{},
targetId
:
{},
trialEndDate
:
{},
},
data
()
{
return
{
...
...
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_widget.vue
View file @
3a007480
...
...
@@ -13,32 +13,13 @@ export default {
GlProgressBar
,
},
mixins
:
[
trackingMixin
],
props
:
{
containerId
:
{
type
:
[
String
,
null
],
required
:
false
,
default
:
null
,
},
daysRemaining
:
{
type
:
Number
,
required
:
true
,
},
navIconImagePath
:
{
type
:
String
,
required
:
true
,
},
percentageComplete
:
{
type
:
Number
,
required
:
true
,
},
planName
:
{
type
:
String
,
required
:
true
,
},
plansHref
:
{
type
:
String
,
required
:
true
,
},
inject
:
{
containerId
:
{
default
:
null
},
daysRemaining
:
{},
navIconImagePath
:
{},
percentageComplete
:
{},
planName
:
{},
plansHref
:
{},
},
i18n
,
trackingEvents
,
...
...
ee/app/assets/javascripts/contextual_sidebar/init_trial_status_widget_and_popover.js
View file @
3a007480
...
...
@@ -18,17 +18,15 @@ export const initTrialStatusWidget = () => {
return
new
Vue
({
el
,
render
:
(
createElement
)
=>
createElement
(
TrialStatusWidget
,
{
props
:
{
containerId
,
daysRemaining
:
Number
(
daysRemaining
),
navIconImagePath
,
percentageComplete
:
Number
(
percentageComplete
),
planName
,
plansHref
,
},
}),
provide
:
{
containerId
,
daysRemaining
:
Number
(
daysRemaining
),
navIconImagePath
,
percentageComplete
:
Number
(
percentageComplete
),
planName
,
plansHref
,
},
render
:
(
createElement
)
=>
createElement
(
TrialStatusWidget
),
});
};
...
...
@@ -49,18 +47,16 @@ export const initTrialStatusPopover = () => {
return
new
Vue
({
el
,
render
:
(
createElement
)
=>
createElement
(
TrialStatusPopover
,
{
props
:
{
containerId
,
groupName
,
planName
,
plansHref
,
purchaseHref
,
targetId
,
trialEndDate
:
new
Date
(
trialEndDate
),
},
}),
provide
:
{
containerId
,
groupName
,
planName
,
plansHref
,
purchaseHref
,
targetId
,
trialEndDate
:
new
Date
(
trialEndDate
),
},
render
:
(
createElement
)
=>
createElement
(
TrialStatusPopover
),
});
};
...
...
ee/spec/frontend/contextual_sidebar/trial_status_popover_spec.js
View file @
3a007480
...
...
@@ -26,7 +26,7 @@ describe('TrialStatusPopover component', () => {
const
createComponent
=
(
mountFn
=
shallowMount
)
=>
{
return
mountFn
(
TrialStatusPopover
,
{
pro
psData
:
{
pro
vide
:
{
groupName
:
'
Some Test Group
'
,
planName
:
'
Ultimate
'
,
plansHref
:
'
billing/path-for/group
'
,
...
...
ee/spec/frontend/contextual_sidebar/trial_status_widget_spec.js
View file @
3a007480
...
...
@@ -11,15 +11,15 @@ describe('TrialStatusWidget component', () => {
const
findGlLink
=
()
=>
wrapper
.
findComponent
(
GlLink
);
const
createComponent
=
(
pro
p
s
=
{})
=>
{
const
createComponent
=
(
pro
vider
s
=
{})
=>
{
return
shallowMount
(
TrialStatusWidget
,
{
pro
psData
:
{
pro
vide
:
{
daysRemaining
:
20
,
navIconImagePath
:
'
illustrations/golden_tanuki.svg
'
,
percentageComplete
:
10
,
planName
:
'
Ultimate
'
,
plansHref
:
'
billing/path-for/group
'
,
...
pro
p
s
,
...
pro
vider
s
,
},
});
};
...
...
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