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
ffe164fb
Commit
ffe164fb
authored
Aug 28, 2020
by
Daniel Tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vulnerability save button spinner position
parent
2cd93646
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
11 deletions
+15
-11
ee/app/assets/javascripts/vulnerabilities/components/history_comment.vue
...avascripts/vulnerabilities/components/history_comment.vue
+1
-1
ee/app/assets/javascripts/vulnerabilities/components/history_comment_editor.vue
...pts/vulnerabilities/components/history_comment_editor.vue
+3
-3
ee/changelogs/unreleased/222346-fix-vulnerability-save-button-spinner-position.yml
...222346-fix-vulnerability-save-button-spinner-position.yml
+5
-0
ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js
...c/frontend/vulnerabilities/history_comment_editor_spec.js
+6
-7
No files found.
ee/app/assets/javascripts/vulnerabilities/components/history_comment.vue
View file @
ffe164fb
...
@@ -135,7 +135,7 @@ export default {
...
@@ -135,7 +135,7 @@ export default {
<
template
>
<
template
>
<history-comment-editor
<history-comment-editor
v-if=
"isEditingComment"
v-if=
"isEditingComment"
class=
"discussion-reply-holder
m-3
"
class=
"discussion-reply-holder"
:initial-comment=
"commentNote"
:initial-comment=
"commentNote"
:is-saving=
"isSavingComment"
:is-saving=
"isSavingComment"
@
onSave=
"saveComment"
@
onSave=
"saveComment"
...
...
ee/app/assets/javascripts/vulnerabilities/components/history_comment_editor.vue
View file @
ffe164fb
<
script
>
<
script
>
import
{
GlFormTextarea
,
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlFormTextarea
,
GlButton
}
from
'
@gitlab/ui
'
;
export
default
{
export
default
{
components
:
{
GlFormTextarea
,
GlButton
,
GlLoadingIcon
},
components
:
{
GlFormTextarea
,
GlButton
},
props
:
{
props
:
{
initialComment
:
{
initialComment
:
{
type
:
String
,
type
:
String
,
...
@@ -43,9 +43,9 @@ export default {
...
@@ -43,9 +43,9 @@ export default {
ref=
"saveButton"
ref=
"saveButton"
variant=
"success"
variant=
"success"
:disabled=
"isSaveButtonDisabled"
:disabled=
"isSaveButtonDisabled"
:loading=
"isSaving"
@
click=
"$emit('onSave', trimmedComment)"
@
click=
"$emit('onSave', trimmedComment)"
>
>
<gl-loading-icon
v-if=
"isSaving"
class=
"mr-1"
/>
{{
__
(
'
Save comment
'
)
}}
{{
__
(
'
Save comment
'
)
}}
</gl-button>
</gl-button>
<gl-button
ref=
"cancelButton"
class=
"ml-1"
:disabled=
"isSaving"
@
click=
"$emit('onCancel')"
>
<gl-button
ref=
"cancelButton"
class=
"ml-1"
:disabled=
"isSaving"
@
click=
"$emit('onCancel')"
>
...
...
ee/changelogs/unreleased/222346-fix-vulnerability-save-button-spinner-position.yml
0 → 100644
View file @
ffe164fb
---
title
:
Fix vulnerability save button spinner position
merge_request
:
40781
author
:
type
:
fixed
ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js
View file @
ffe164fb
...
@@ -51,20 +51,19 @@ describe('History Comment Editor', () => {
...
@@ -51,20 +51,19 @@ describe('History Comment Editor', () => {
expect
(
wrapper
.
emitted
().
onCancel
).
toHaveLength
(
1
);
expect
(
wrapper
.
emitted
().
onCancel
).
toHaveLength
(
1
);
});
});
it
(
'
disables the save button when there is no text or only whitespace in the textarea
'
,
()
=>
{
it
(
'
disables the save button when there is no text or only whitespace in the textarea
'
,
async
()
=>
{
createWrapper
({
initialComment
:
'
some comment
'
});
createWrapper
({
initialComment
:
'
some comment
'
});
textarea
().
vm
.
$emit
(
'
input
'
,
'
'
);
textarea
().
vm
.
$emit
(
'
input
'
,
'
'
);
await
wrapper
.
vm
.
$nextTick
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
saveButton
().
props
(
'
disabled
'
)).
toBe
(
true
);
expect
(
saveButton
().
attributes
(
'
disabled
'
)).
toBeTruthy
();
});
});
});
it
(
'
disables all elements when the
isSaving prop is true
'
,
()
=>
{
it
(
'
disables all elements when the
comment is being saved
'
,
()
=>
{
createWrapper
({
isSaving
:
true
});
createWrapper
({
isSaving
:
true
});
expect
(
textarea
().
attributes
(
'
disabled
'
)).
toBeTruthy
();
expect
(
textarea
().
attributes
(
'
disabled
'
)).
toBeTruthy
();
expect
(
saveButton
().
attributes
(
'
disabled
'
)).
toBeTruthy
(
);
expect
(
saveButton
().
props
(
'
loading
'
)).
toBe
(
true
);
expect
(
cancelButton
().
attributes
(
'
disabled
'
)).
toBeTruthy
(
);
expect
(
cancelButton
().
props
(
'
disabled
'
)).
toBe
(
true
);
});
});
});
});
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