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
78a51337
Commit
78a51337
authored
Oct 07, 2020
by
Kyle Mann
Committed by
Mark Florian
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace deprecated button
parent
ba729e60
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
ee/app/assets/javascripts/vue_shared/security_reports/components/event_item.vue
...pts/vue_shared/security_reports/components/event_item.vue
+6
-8
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/event_item_spec.js.snap
..._reports/components/__snapshots__/event_item_spec.js.snap
+8
-4
ee/spec/frontend/vue_shared/security_reports/components/event_item_spec.js
...vue_shared/security_reports/components/event_item_spec.js
+3
-3
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/event_item.vue
View file @
78a51337
<
script
>
import
{
GlTooltipDirective
,
Gl
Deprecated
Button
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlButton
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
NoteHeader
from
'
~/notes/components/note_header.vue
'
;
export
default
{
...
...
@@ -7,7 +7,7 @@ export default {
components
:
{
GlIcon
,
NoteHeader
,
Gl
Deprecated
Button
,
GlButton
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
...
...
@@ -83,17 +83,15 @@ export default {
<slot
v-if=
"showRightSlot"
name=
"right-content"
></slot>
<div
v-else-if=
"showActionButtons"
class=
"gl-flex-shrink-0 gl-align-self-start"
>
<gl-
deprecated-
button
<gl-button
v-for=
"button in actionButtons"
:key=
"button.title"
v-gl-tooltip
c
lass=
"px-1
"
variant=
"transparent
"
c
ategory=
"tertiary
"
:icon=
"button.iconName
"
:title=
"button.title"
@
click=
"button.onClick"
>
<gl-icon
:name=
"button.iconName"
class=
"link-highlight"
/>
</gl-deprecated-button>
/>
</div>
</div>
</
template
>
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/event_item_spec.js.snap
View file @
78a51337
...
...
@@ -79,36 +79,40 @@ exports[`Event Item with action buttons renders the action buttons 1`] = `
class="gl-flex-shrink-0 gl-align-self-start"
>
<button
class="btn
px-1 btn-transparent btn-md
"
class="btn
btn-default btn-md gl-button btn-default-tertiary btn-icon
"
title="Foo Action"
type="button"
>
<!---->
<svg
class="
link-highlight
gl-icon s16"
class="
gl-button-icon
gl-icon s16"
data-testid="pencil-icon"
>
<use
href="#pencil"
/>
</svg>
<!---->
</button>
<button
class="btn
px-1 btn-transparent btn-md
"
class="btn
btn-default btn-md gl-button btn-default-tertiary btn-icon
"
title="Bar Action"
type="button"
>
<!---->
<svg
class="
link-highlight
gl-icon s16"
class="
gl-button-icon
gl-icon s16"
data-testid="remove-icon"
>
<use
href="#remove"
/>
</svg>
<!---->
</button>
</div>
</div>
...
...
ee/spec/frontend/vue_shared/security_reports/components/event_item_spec.js
View file @
78a51337
import
{
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
Component
from
'
ee/vue_shared/security_reports/components/event_item.vue
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
NoteHeader
from
'
~/notes/components/note_header.vue
'
;
...
...
@@ -91,12 +91,12 @@ describe('Event Item', () => {
});
it
(
'
renders the action buttons
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
Gl
Deprecated
Button
)).
toHaveLength
(
2
);
expect
(
wrapper
.
findAll
(
GlButton
)).
toHaveLength
(
2
);
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
it
(
'
emits the button events when clicked
'
,
()
=>
{
const
buttons
=
wrapper
.
findAll
(
Gl
Deprecated
Button
);
const
buttons
=
wrapper
.
findAll
(
GlButton
);
buttons
.
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
...
...
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