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
0896218d
Commit
0896218d
authored
Sep 09, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
b67c7570
8ce331c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
3 deletions
+87
-3
app/assets/javascripts/monitoring/components/graph_group.vue
app/assets/javascripts/monitoring/components/graph_group.vue
+35
-3
changelogs/unreleased/jivanvl-add-caret-icon-dashboard.yml
changelogs/unreleased/jivanvl-add-caret-icon-dashboard.yml
+5
-0
spec/javascripts/monitoring/components/graph_group_spec.js
spec/javascripts/monitoring/components/graph_group_spec.js
+47
-0
No files found.
app/assets/javascripts/monitoring/components/graph_group.vue
View file @
0896218d
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
export
default
{
components
:
{
Icon
,
},
props
:
{
name
:
{
type
:
String
,
...
...
@@ -15,15 +20,42 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
showGroup
:
true
,
};
},
computed
:
{
caretIcon
()
{
return
this
.
collapseGroup
&&
this
.
showGroup
?
'
angle-down
'
:
'
angle-right
'
;
},
},
created
()
{
this
.
showGroup
=
this
.
collapseGroup
;
},
methods
:
{
collapse
()
{
this
.
showGroup
=
!
this
.
showGroup
;
},
},
};
</
script
>
<
template
>
<div
v-if=
"showPanels"
class=
"card prometheus-panel"
>
<div
class=
"card-header"
>
<h4>
{{
name
}}
</h4>
<div
class=
"card-header d-flex align-items-center"
>
<h4
class=
"flex-grow-1"
>
{{
name
}}
</h4>
<a
role=
"button"
@
click=
"collapse"
>
<icon
:size=
"16"
:aria-label=
"__('Toggle collapse')"
:name=
"caretIcon"
/>
</a>
</div>
<div
v-if=
"collapseGroup"
v-show=
"collapseGroup && showGroup"
class=
"card-body prometheus-graph-group"
>
<slot></slot>
</div>
<div
v-if=
"collapseGroup"
class=
"card-body prometheus-graph-group"
><slot></slot></div>
</div>
<div
v-else
class=
"prometheus-graph-group"
><slot></slot></div>
</
template
>
changelogs/unreleased/jivanvl-add-caret-icon-dashboard.yml
0 → 100644
View file @
0896218d
---
title
:
Add caret icons to the monitoring dashboard
merge_request
:
32239
author
:
type
:
changed
spec/javascripts/monitoring/components/graph_group_spec.js
0 → 100644
View file @
0896218d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
GraphGroup
from
'
~/monitoring/components/graph_group.vue
'
;
describe
(
'
Graph group component
'
,
()
=>
{
let
graphGroup
;
afterEach
(()
=>
{
graphGroup
.
destroy
();
});
describe
(
'
When groups can be collapsed
'
,
()
=>
{
beforeEach
(()
=>
{
graphGroup
=
shallowMount
(
GraphGroup
,
{
propsData
:
{
name
:
'
panel
'
,
collapseGroup
:
true
,
},
});
});
it
(
'
should show the angle-down caret icon when collapseGroup is true
'
,
()
=>
{
expect
(
graphGroup
.
vm
.
caretIcon
).
toBe
(
'
angle-down
'
);
});
it
(
'
should show the angle-right caret icon when collapseGroup is false
'
,
()
=>
{
graphGroup
.
vm
.
collapse
();
expect
(
graphGroup
.
vm
.
caretIcon
).
toBe
(
'
angle-right
'
);
});
});
describe
(
'
When groups can not be collapsed
'
,
()
=>
{
beforeEach
(()
=>
{
graphGroup
=
shallowMount
(
GraphGroup
,
{
propsData
:
{
name
:
'
panel
'
,
collapseGroup
:
true
,
showPanels
:
false
,
},
});
});
it
(
'
should not contain a prometheus-graph-group container when showPanels is false
'
,
()
=>
{
expect
(
graphGroup
.
vm
.
$el
.
querySelector
(
'
.prometheus-graph-group
'
)).
toBe
(
null
);
});
});
});
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