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
dfd1d6c4
Commit
dfd1d6c4
authored
Nov 19, 2018
by
Simon Knox
Committed by
Kushal Pandya
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't show memory usage graph for unmerged MRs
parent
8dd89f03
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
...cripts/vue_merge_request_widget/components/deployment.vue
+8
-1
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+2
-0
changelogs/unreleased/49479-hide-unmerged-env-perf-stats.yml
changelogs/unreleased/49479-hide-unmerged-env-perf-stats.yml
+5
-0
spec/javascripts/vue_mr_widget/components/deployment_spec.js
spec/javascripts/vue_mr_widget/components/deployment_spec.js
+25
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
View file @
dfd1d6c4
...
...
@@ -33,6 +33,10 @@ export default {
type
:
Object
,
required
:
true
,
},
showMetrics
:
{
type
:
Boolean
,
required
:
true
,
},
},
deployedTextMap
:
{
running
:
__
(
'
Deploying to
'
),
...
...
@@ -74,6 +78,9 @@ export default {
shouldRenderDropdown
()
{
return
this
.
deployment
.
changes
&&
this
.
deployment
.
changes
.
length
>
0
;
},
showMemoryUsage
()
{
return
this
.
hasMetrics
&&
this
.
showMetrics
;
},
},
methods
:
{
stopEnvironment
()
{
...
...
@@ -136,7 +143,7 @@ export default {
{{ deployTimeago }}
</span>
<memory-usage
v-if=
"
hasMetrics
"
v-if=
"
showMemoryUsage
"
:metrics-url=
"deployment.metrics_url"
:metrics-monitoring-url=
"deployment.metrics_monitoring_url"
/>
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
dfd1d6c4
...
...
@@ -312,6 +312,7 @@ export default {
:key=
"`pre-merge-deploy-$
{deployment.id}`"
class="js-pre-merge-deploy"
:deployment="deployment"
:show-metrics="false"
/>
<div
class=
"mr-section-container"
>
<grouped-test-reports-app
...
...
@@ -366,6 +367,7 @@ export default {
v-for=
"postMergeDeployment in mr.postMergeDeployments"
:key=
"`post-merge-deploy-$
{postMergeDeployment.id}`"
:deployment="postMergeDeployment"
:show-metrics="true"
class="js-post-deployment"
/>
</
template
>
...
...
changelogs/unreleased/49479-hide-unmerged-env-perf-stats.yml
0 → 100644
View file @
dfd1d6c4
---
title
:
Don't show Memory Usage for unmerged MRs
merge_request
:
author
:
type
:
changed
spec/javascripts/vue_mr_widget/components/deployment_spec.js
View file @
dfd1d6c4
...
...
@@ -41,7 +41,7 @@ describe('Deployment component', () => {
describe
(
''
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
}
});
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
}
,
showMetrics
:
true
});
});
describe
(
'
deployTimeago
'
,
()
=>
{
...
...
@@ -174,11 +174,31 @@ describe('Deployment component', () => {
});
});
describe
(
'
with showMetrics enabled
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
},
showMetrics
:
true
});
});
it
(
'
shows metrics
'
,
()
=>
{
expect
(
vm
.
$el
).
toContainElement
(
'
.js-mr-memory-usage
'
);
});
});
describe
(
'
with showMetrics disabled
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
},
showMetrics
:
false
});
});
it
(
'
hides metrics
'
,
()
=>
{
expect
(
vm
.
$el
).
not
.
toContainElement
(
'
.js-mr-memory-usage
'
);
});
});
describe
(
'
without changes
'
,
()
=>
{
beforeEach
(()
=>
{
delete
deploymentMockData
.
changes
;
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
}
});
vm
=
mountComponent
(
Component
,
{
deployment
:
{
...
deploymentMockData
}
,
showMetrics
:
true
});
});
it
(
'
renders the link to the review app without dropdown
'
,
()
=>
{
...
...
@@ -192,6 +212,7 @@ describe('Deployment component', () => {
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
Object
.
assign
({},
deploymentMockData
,
{
status
:
'
running
'
}),
showMetrics
:
true
,
});
});
...
...
@@ -208,6 +229,7 @@ describe('Deployment component', () => {
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
Object
.
assign
({},
deploymentMockData
,
{
status
:
'
success
'
}),
showMetrics
:
true
,
});
});
...
...
@@ -220,6 +242,7 @@ describe('Deployment component', () => {
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
deployment
:
Object
.
assign
({},
deploymentMockData
,
{
status
:
'
failed
'
}),
showMetrics
:
true
,
});
});
...
...
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