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
a3fd2646
Commit
a3fd2646
authored
Aug 05, 2020
by
ameliabauerly
Committed by
David O'Regan
Aug 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch embed group button
parent
bc281334
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
app/assets/javascripts/monitoring/components/embeds/embed_group.vue
.../javascripts/monitoring/components/embeds/embed_group.vue
+6
-5
spec/frontend/monitoring/components/embeds/embed_group_spec.js
...frontend/monitoring/components/embeds/embed_group_spec.js
+4
-4
No files found.
app/assets/javascripts/monitoring/components/embeds/embed_group.vue
View file @
a3fd2646
<
script
>
import
{
mapState
,
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
sum
from
'
lodash/sum
'
;
import
{
Gl
Deprecated
Button
,
GlCard
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlCard
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
n__
}
from
'
~/locale
'
;
import
{
monitoringDashboard
}
from
'
~/monitoring/stores
'
;
import
MetricEmbed
from
'
./metric_embed.vue
'
;
export
default
{
components
:
{
Gl
Deprecated
Button
,
GlButton
,
GlCard
,
GlIcon
,
MetricEmbed
,
...
...
@@ -78,15 +78,16 @@ export default {
:body-class=
"bodyClass"
>
<template
#header
>
<gl-
deprecated-
button
class=
"collapsible-card-btn
d-flex text-decoration-none
"
<gl-button
class=
"collapsible-card-btn
gl-display-flex gl-text-decoration-none gl-reset-color! gl-hover-text-blue-800! gl-shadow-none!
"
:aria-label=
"buttonLabel"
variant=
"link"
category=
"tertiary"
@
click=
"toggleCollapsed"
>
<gl-icon
class=
"mr-1"
:name=
"arrowIconName"
/>
{{
buttonLabel
}}
</gl-
deprecated-
button>
</gl-button>
</
template
>
<div
class=
"d-flex flex-wrap"
>
<metric-embed
...
...
spec/frontend/monitoring/components/embeds/embed_group_spec.js
View file @
a3fd2646
import
{
createLocalVue
,
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
Gl
Deprecated
Button
,
GlCard
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlCard
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
EmbedGroup
from
'
~/monitoring/components/embeds/embed_group.vue
'
;
import
MetricEmbed
from
'
~/monitoring/components/embeds/metric_embed.vue
'
;
...
...
@@ -80,7 +80,7 @@ describe('Embed Group', () => {
metricsWithDataGetter
.
mockReturnValue
([
1
]);
mountComponent
({
shallow
:
false
,
stubs
:
{
MetricEmbed
:
'
<div />
'
}
});
wrapper
.
find
(
Gl
Deprecated
Button
).
trigger
(
'
click
'
);
wrapper
.
find
(
GlButton
).
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.card-body
'
).
classes
()).
toContain
(
'
d-none
'
);
...
...
@@ -150,14 +150,14 @@ describe('Embed Group', () => {
metricsWithDataGetter
.
mockReturnValue
([
1
]);
mountComponent
({
shallow
:
false
,
stubs
:
{
MetricEmbed
:
'
<div />
'
}
});
expect
(
wrapper
.
find
(
Gl
Deprecated
Button
).
text
()).
toBe
(
'
Hide chart
'
);
expect
(
wrapper
.
find
(
GlButton
).
text
()).
toBe
(
'
Hide chart
'
);
});
it
(
'
has a plural label when there are multiple embeds
'
,
()
=>
{
metricsWithDataGetter
.
mockReturnValue
([
2
]);
mountComponent
({
shallow
:
false
,
stubs
:
{
MetricEmbed
:
'
<div />
'
}
});
expect
(
wrapper
.
find
(
Gl
Deprecated
Button
).
text
()).
toBe
(
'
Hide charts
'
);
expect
(
wrapper
.
find
(
GlButton
).
text
()).
toBe
(
'
Hide charts
'
);
});
});
});
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