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
Show 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 @@
...
@@ -2,13 +2,11 @@
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
export
default
{
export
default
{
name
:
'
DismissalCommentModalFooter
'
,
name
:
'
DismissalCommentModalFooter
'
,
components
:
{
components
:
{
GlButton
,
GlButton
,
LoadingButton
,
},
},
props
:
{
props
:
{
isDismissingVulnerability
:
{
isDismissingVulnerability
:
{
...
@@ -68,14 +66,15 @@ export default {
...
@@ -68,14 +66,15 @@ export default {
<gl-button
variant=
"default"
category=
"primary"
class=
"js-cancel"
@
click=
"$emit('cancel')"
>
<gl-button
variant=
"default"
category=
"primary"
class=
"js-cancel"
@
click=
"$emit('cancel')"
>
{{
__
(
'
Cancel
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</gl-button>
</gl-button>
<
loading
-button
<
gl
-button
:loading=
"isDismissingVulnerability"
:loading=
"isDismissingVulnerability"
:disabled=
"isDismissingVulnerability"
:disabled=
"isDismissingVulnerability"
:label=
"submitLabel"
data-qa-selector=
"add_and_dismiss_button"
data-qa-selector=
"add_and_dismiss_button"
class=
"js-loading-
button"
data-testid=
"add_and_dismiss_
button"
container-class=
"btn btn-close
"
variant=
"warning
"
@
click=
"handleSubmit"
@
click=
"handleSubmit"
/>
>
{{
submitLabel
}}
</gl-button>
</div>
</div>
</
template
>
</
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
{
mount
}
from
'
@vue/test-utils
'
;
import
component
from
'
ee/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
jest
.
mock
(
'
~/tracking
'
);
jest
.
mock
(
'
~/tracking
'
);
...
@@ -9,6 +8,8 @@ describe('DismissalCommentModalFooter', () => {
...
@@ -9,6 +8,8 @@ describe('DismissalCommentModalFooter', () => {
let
origPage
;
let
origPage
;
let
wrapper
;
let
wrapper
;
const
findAddAndDismissButton
=
()
=>
wrapper
.
find
(
'
[data-testid="add_and_dismiss_button"]
'
);
afterEach
(()
=>
{
afterEach
(()
=>
{
document
.
body
.
dataset
.
page
=
origPage
;
document
.
body
.
dataset
.
page
=
origPage
;
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -25,11 +26,11 @@ describe('DismissalCommentModalFooter', () => {
...
@@ -25,11 +26,11 @@ describe('DismissalCommentModalFooter', () => {
});
});
it
(
'
should render the "Add comment and dismiss" button
'
,
()
=>
{
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
'
,
()
=>
{
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addCommentAndDismiss
).
toBeTruthy
();
expect
(
wrapper
.
emitted
().
addCommentAndDismiss
).
toBeTruthy
();
...
@@ -59,11 +60,11 @@ describe('DismissalCommentModalFooter', () => {
...
@@ -59,11 +60,11 @@ describe('DismissalCommentModalFooter', () => {
});
});
it
(
'
should render the "Add comment and dismiss" button
'
,
()
=>
{
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
'
,
()
=>
{
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addDismissalComment
).
toBeTruthy
();
expect
(
wrapper
.
emitted
().
addDismissalComment
).
toBeTruthy
();
...
@@ -82,11 +83,11 @@ describe('DismissalCommentModalFooter', () => {
...
@@ -82,11 +83,11 @@ describe('DismissalCommentModalFooter', () => {
});
});
it
(
'
should render the "Save comment" button
'
,
()
=>
{
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
'
,
()
=>
{
it
(
'
should emit the "addCommentAndDismiss" event when clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
findAddAndDismissButton
(
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
addDismissalComment
).
toBeTruthy
();
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