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
dc63b0a6
Commit
dc63b0a6
authored
Sep 16, 2020
by
Libor Vanc
Committed by
Martin Wortschack
Sep 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace LoadingButton with GlButton for the comment dismissal modal
parent
25b507dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
changelogs/unreleased/229214-replace-LoadingButton-with-GlButton.yml
...unreleased/229214-replace-LoadingButton-with-GlButton.yml
+5
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue
...ity_reports/components/dismissal_comment_modal_footer.vue
+6
-7
ee/spec/frontend/vue_shared/security_reports/components/dismissal_comment_modal_footer_spec.js
...reports/components/dismissal_comment_modal_footer_spec.js
+8
-7
No files found.
changelogs/unreleased/229214-replace-LoadingButton-with-GlButton.yml
0 → 100644
View file @
dc63b0a6
---
title
:
Replace LoadingButton with GlButton for the comment dismissal modal
merge_request
:
40882
author
:
type
:
performance
ee/app/assets/javascripts/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue
View file @
dc63b0a6
...
...
@@ -2,13 +2,11 @@
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
s__
}
from
'
~/locale
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
export
default
{
name
:
'
DismissalCommentModalFooter
'
,
components
:
{
GlButton
,
LoadingButton
,
},
props
:
{
isDismissingVulnerability
:
{
...
...
@@ -68,14 +66,15 @@ export default {
<gl-button
variant=
"default"
category=
"primary"
class=
"js-cancel"
@
click=
"$emit('cancel')"
>
{{
__
(
'
Cancel
'
)
}}
</gl-button>
<
loading
-button
<
gl
-button
:loading=
"isDismissingVulnerability"
:disabled=
"isDismissingVulnerability"
:label=
"submitLabel"
data-qa-selector=
"add_and_dismiss_button"
class=
"js-loading-
button"
container-class=
"btn btn-close
"
data-testid=
"add_and_dismiss_
button"
variant=
"warning
"
@
click=
"handleSubmit"
/>
>
{{
submitLabel
}}
</gl-button>
</div>
</
template
>
ee/spec/frontend/vue_shared/security_reports/components/dismissal_comment_modal_footer_spec.js
View file @
dc63b0a6
import
{
mount
}
from
'
@vue/test-utils
'
;
import
component
from
'
ee/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue
'
;
import
Tracking
from
'
~/tracking
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
jest
.
mock
(
'
~/tracking
'
);
...
...
@@ -9,6 +8,8 @@ describe('DismissalCommentModalFooter', () => {
let
origPage
;
let
wrapper
;
const
findAddAndDismissButton
=
()
=>
wrapper
.
find
(
'
[data-testid="add_and_dismiss_button"]
'
);
afterEach
(()
=>
{
document
.
body
.
dataset
.
page
=
origPage
;
wrapper
.
destroy
();
...
...
@@ -25,11 +26,11 @@ describe('DismissalCommentModalFooter', () => {
});
it
(
'
should render the "Add comment and dismiss" button
'
,
()
=>
{
expect
(
wrapper
.
find
(
LoadingButton
).
text
()).
toBe
(
'
Add comment & dismiss
'
);
expect
(
findAddAndDismissButton
(
).
text
()).
toBe
(
'
Add comment & dismiss
'
);
});
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addCommentAndDismiss
).
toBeTruthy
();
...
...
@@ -59,11 +60,11 @@ describe('DismissalCommentModalFooter', () => {
});
it
(
'
should render the "Add comment and dismiss" button
'
,
()
=>
{
expect
(
wrapper
.
find
(
LoadingButton
).
text
()).
toBe
(
'
Add comment
'
);
expect
(
findAddAndDismissButton
(
).
text
()).
toBe
(
'
Add comment
'
);
});
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addDismissalComment
).
toBeTruthy
();
...
...
@@ -82,11 +83,11 @@ describe('DismissalCommentModalFooter', () => {
});
it
(
'
should render the "Save comment" button
'
,
()
=>
{
expect
(
wrapper
.
find
(
LoadingButton
).
text
()).
toBe
(
'
Save comment
'
);
expect
(
findAddAndDismissButton
(
).
text
()).
toBe
(
'
Save comment
'
);
});
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addDismissalComment
).
toBeTruthy
();
...
...
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