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
003b5930
Commit
003b5930
authored
Sep 22, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use gl-badge instead of custom styles
parent
55798eff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
ee/app/assets/javascripts/vulnerabilities/components/remediated_badge.vue
...vascripts/vulnerabilities/components/remediated_badge.vue
+5
-4
ee/spec/frontend/vulnerabilities/remediated_badge_spec.js
ee/spec/frontend/vulnerabilities/remediated_badge_spec.js
+3
-2
No files found.
ee/app/assets/javascripts/vulnerabilities/components/remediated_badge.vue
View file @
003b5930
<
script
>
import
{
GlIcon
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlPopover
,
GlBadge
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlIcon
,
GlPopover
,
GlBadge
,
},
};
</
script
>
<
template
>
<div
class=
"gl-display-inline-block"
>
<
span
class=
"gl-display-inline-block gl-rounded-lg gl-bg-blue-200 gl-text-blue-500 gl-px-3
"
>
<gl-icon
ref=
"badge"
name=
"admin"
/>
</
span
>
<
gl-badge
ref=
"badge"
variant=
"info
"
>
<gl-icon
name=
"admin"
/>
</
gl-badge
>
<gl-popover
ref=
"popover"
:content=
"
...
...
ee/spec/frontend/vulnerabilities/remediated_badge_spec.js
View file @
003b5930
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlPopover
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
RemediatedBadge
from
'
ee/vulnerabilities/components/remediated_badge.vue
'
;
const
POPOVER_TITLE
=
'
Vulnerability remediated. Review before resolving.
'
;
...
...
@@ -10,6 +10,7 @@ describe('Remediated badge component', () => {
let
wrapper
;
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findBadge
=
()
=>
wrapper
.
find
(
GlBadge
);
const
createWrapper
=
()
=>
{
return
shallowMount
(
RemediatedBadge
);
...
...
@@ -27,7 +28,7 @@ describe('Remediated badge component', () => {
it
(
'
should link the badge and the popover
'
,
()
=>
{
const
{
popover
}
=
wrapper
.
vm
.
$refs
;
expect
(
popover
.
$attrs
.
target
()).
toEqual
(
find
Icon
().
element
);
expect
(
popover
.
$attrs
.
target
()).
toEqual
(
find
Badge
().
element
);
});
it
(
'
should pass down the data to the popover
'
,
()
=>
{
...
...
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