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
ccf2d16a
Commit
ccf2d16a
authored
Aug 27, 2020
by
Juan J. Ramirez
Committed by
Ezekiel Kigbo
Aug 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migration monitoring button to gl-button in Environment table
parent
c9450eab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
app/assets/javascripts/environments/components/environment_monitoring.vue
...cripts/environments/components/environment_monitoring.vue
+6
-8
changelogs/unreleased/migration-monitoring-btn.yml
changelogs/unreleased/migration-monitoring-btn.yml
+5
-0
spec/frontend/environments/environment_monitoring_spec.js
spec/frontend/environments/environment_monitoring_spec.js
+4
-4
No files found.
app/assets/javascripts/environments/components/environment_monitoring.vue
View file @
ccf2d16a
<
script
>
<
script
>
import
{
Gl
DeprecatedButton
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
/**
/**
* Renders the Monitoring (Metrics) link in environments table.
* Renders the Monitoring (Metrics) link in environments table.
*/
*/
export
default
{
export
default
{
components
:
{
components
:
{
GlIcon
,
GlButton
,
GlDeprecatedButton
,
},
},
directives
:
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlTooltip
:
GlTooltipDirective
,
...
@@ -26,15 +25,14 @@ export default {
...
@@ -26,15 +25,14 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<gl-
deprecated-
button
<gl-button
v-gl-tooltip
v-gl-tooltip
:href=
"monitoringUrl"
:href=
"monitoringUrl"
:title=
"title"
:title=
"title"
:aria-label=
"title"
:aria-label=
"title"
class=
"monitoring-url d-none d-sm-none d-md-block"
class=
"monitoring-url gl-display-none gl-display-sm-none gl-display-md-block"
icon=
"chart"
rel=
"noopener noreferrer nofollow"
rel=
"noopener noreferrer nofollow"
variant=
"default"
variant=
"default"
>
/>
<gl-icon
name=
"chart"
/>
</gl-deprecated-button>
</
template
>
</
template
>
changelogs/unreleased/migration-monitoring-btn.yml
0 → 100644
View file @
ccf2d16a
---
title
:
Migrating to gl-button in Environments table
merge_request
:
40444
author
:
type
:
changed
spec/frontend/environments/environment_monitoring_spec.js
View file @
ccf2d16a
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
Gl
Ic
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
import
MonitoringComponent
from
'
~/environments/components/environment_monitoring.vue
'
;
import
MonitoringComponent
from
'
~/environments/components/environment_monitoring.vue
'
;
describe
(
'
Monitoring Component
'
,
()
=>
{
describe
(
'
Monitoring Component
'
,
()
=>
{
...
@@ -15,8 +15,8 @@ describe('Monitoring Component', () => {
...
@@ -15,8 +15,8 @@ describe('Monitoring Component', () => {
});
});
};
};
const
find
Icons
=
()
=>
wrapper
.
findAll
(
GlIc
on
);
const
find
Buttons
=
()
=>
wrapper
.
findAll
(
GlButt
on
);
const
find
IconsByName
=
name
=>
findIcons
().
filter
(
icon
=>
icon
.
props
(
'
name
'
)
===
name
);
const
find
ButtonsByIcon
=
icon
=>
findButtons
().
filter
(
button
=>
button
.
props
(
'
icon
'
)
===
icon
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createWrapper
();
createWrapper
();
...
@@ -30,7 +30,7 @@ describe('Monitoring Component', () => {
...
@@ -30,7 +30,7 @@ describe('Monitoring Component', () => {
it
(
'
should render a link to environment monitoring page
'
,
()
=>
{
it
(
'
should render a link to environment monitoring page
'
,
()
=>
{
expect
(
wrapper
.
attributes
(
'
href
'
)).
toEqual
(
monitoringUrl
);
expect
(
wrapper
.
attributes
(
'
href
'
)).
toEqual
(
monitoringUrl
);
expect
(
find
IconsByName
(
'
chart
'
).
length
).
toBe
(
1
);
expect
(
find
ButtonsByIcon
(
'
chart
'
).
length
).
toBe
(
1
);
expect
(
wrapper
.
attributes
(
'
title
'
)).
toBe
(
'
Monitoring
'
);
expect
(
wrapper
.
attributes
(
'
title
'
)).
toBe
(
'
Monitoring
'
);
expect
(
wrapper
.
attributes
(
'
aria-label
'
)).
toBe
(
'
Monitoring
'
);
expect
(
wrapper
.
attributes
(
'
aria-label
'
)).
toBe
(
'
Monitoring
'
);
});
});
...
...
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