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
faee8a34
Commit
faee8a34
authored
6 years ago
by
Jose Ivan Vargas
Committed by
Clement Ho
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Environments dropdown is showing on the cluster health page"
parent
3549ee7a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
12 deletions
+55
-12
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+26
-12
ee/app/assets/javascripts/pages/projects/clusters/show/cluster_health.js
...avascripts/pages/projects/clusters/show/cluster_health.js
+3
-0
ee/changelogs/unreleased/6919-environments-dropdown-is-showing-on-the-cluster-health-page.yml
...nments-dropdown-is-showing-on-the-cluster-health-page.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+18
-0
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
faee8a34
...
...
@@ -98,6 +98,11 @@ export default {
type
:
String
,
required
:
true
,
},
showEnvironmentDropdown
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
data
()
{
return
{
...
...
@@ -126,9 +131,25 @@ export default {
},
mounted
()
{
this
.
resizeThrottled
=
_
.
throttle
(
this
.
resize
,
600
);
this
.
servicePromises
=
[
this
.
service
.
getGraphsData
()
.
then
(
data
=>
this
.
store
.
storeMetrics
(
data
))
.
catch
(()
=>
Flash
(
s__
(
'
Metrics|There was an error while retrieving metrics
'
))),
this
.
service
.
getDeploymentData
()
.
then
(
data
=>
this
.
store
.
storeDeploymentData
(
data
))
.
catch
(()
=>
Flash
(
s__
(
'
Metrics|There was an error getting deployment information.
'
))),
];
if
(
!
this
.
hasMetrics
)
{
this
.
state
=
'
gettingStarted
'
;
}
else
{
if
(
this
.
showEnvironmentDropdown
)
{
this
.
servicePromises
.
push
(
this
.
service
.
getEnvironmentsData
()
.
then
((
data
)
=>
this
.
store
.
storeEnvironmentsData
(
data
))
.
catch
(()
=>
Flash
(
s__
(
'
Metrics|There was an error getting environments information.
'
))));
}
this
.
getGraphsData
();
window
.
addEventListener
(
'
resize
'
,
this
.
resizeThrottled
,
false
);
}
...
...
@@ -136,17 +157,7 @@ export default {
methods
:
{
getGraphsData
()
{
this
.
state
=
'
loading
'
;
Promise
.
all
([
this
.
service
.
getGraphsData
().
then
(
data
=>
this
.
store
.
storeMetrics
(
data
)),
this
.
service
.
getDeploymentData
()
.
then
(
data
=>
this
.
store
.
storeDeploymentData
(
data
))
.
catch
(()
=>
Flash
(
s__
(
'
Metrics|There was an error getting deployment information.
'
))),
this
.
service
.
getEnvironmentsData
()
.
then
(
data
=>
this
.
store
.
storeEnvironmentsData
(
data
))
.
catch
(()
=>
Flash
(
s__
(
'
Metrics|There was an error getting environments information.
'
))),
])
Promise
.
all
(
this
.
servicePromises
)
.
then
(()
=>
{
if
(
this
.
store
.
groups
.
length
<
1
)
{
this
.
state
=
'
noData
'
;
...
...
@@ -180,7 +191,10 @@ export default {
v-if=
"!showEmptyState"
class=
"prometheus-graphs prepend-top-10"
>
<div
class=
"environments d-flex align-items-center"
>
<div
v-if=
"showEnvironmentDropdown"
class=
"environments d-flex align-items-center"
>
{{
s__
(
'
Metrics|Environment
'
)
}}
<div
class=
"dropdown prepend-left-10"
>
<button
...
...
This diff is collapsed.
Click to expand it.
ee/app/assets/javascripts/pages/projects/clusters/show/cluster_health.js
View file @
faee8a34
...
...
@@ -15,6 +15,9 @@ export default () => {
showLegend
:
false
,
showPanels
:
false
,
forceSmallGraph
:
true
,
showEnvironmentDropdown
:
false
,
currentEnvironmentName
:
''
,
environmentsEndpoint
:
''
,
},
});
},
...
...
This diff is collapsed.
Click to expand it.
ee/changelogs/unreleased/6919-environments-dropdown-is-showing-on-the-cluster-health-page.yml
0 → 100644
View file @
faee8a34
---
title
:
Resolve Environments dropdown is showing on the cluster health page
merge_request
:
6528
author
:
type
:
fixed
This diff is collapsed.
Click to expand it.
locale/gitlab.pot
View file @
faee8a34
...
...
@@ -4107,6 +4107,9 @@ msgstr ""
msgid "Metrics|There was an error getting environments information."
msgstr ""
msgid "Metrics|There was an error while retrieving metrics"
msgstr ""
msgid "Metrics|Type"
msgstr ""
...
...
This diff is collapsed.
Click to expand it.
spec/javascripts/monitoring/dashboard_spec.js
View file @
faee8a34
...
...
@@ -126,5 +126,23 @@ describe('Dashboard', () => {
done
();
});
});
it
(
'
hides the dropdown
'
,
done
=>
{
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showEnvironmentDropdown
:
false
,
},
});
Vue
.
nextTick
(()
=>
{
const
dropdownIsActiveElement
=
component
.
$el
.
querySelectorAll
(
'
.environments
'
);
expect
(
dropdownIsActiveElement
.
length
).
toEqual
(
0
);
done
();
});
});
});
});
This diff is collapsed.
Click to expand it.
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