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
0c49b5eb
Commit
0c49b5eb
authored
Nov 01, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cancel button not working when uploading a file on the new issue page
parent
0b8b631a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
app/assets/javascripts/dropzone_input.js
app/assets/javascripts/dropzone_input.js
+1
-3
changelogs/unreleased/jivl-fix-cancel-button-file-upload-new-issue.yml
...released/jivl-fix-cancel-button-file-upload-new-issue.yml
+5
-0
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+10
-0
No files found.
app/assets/javascripts/dropzone_input.js
View file @
0c49b5eb
...
...
@@ -119,11 +119,9 @@ export default function dropzoneInput(form) {
// removeAllFiles(true) stops uploading files (if any)
// and remove them from dropzone files queue.
$cancelButton
.
on
(
'
click
'
,
(
e
)
=>
{
const
target
=
e
.
target
.
closest
(
'
.js-main-target-form
'
).
querySelector
(
'
.div-dropzone
'
);
e
.
preventDefault
();
e
.
stopPropagation
();
Dropzone
.
forElement
(
target
).
removeAllFiles
(
true
);
Dropzone
.
forElement
(
$formDropzone
.
get
(
0
)
).
removeAllFiles
(
true
);
});
// If 'error' event is fired, we store a failed files,
...
...
changelogs/unreleased/jivl-fix-cancel-button-file-upload-new-issue.yml
0 → 100644
View file @
0c49b5eb
---
title
:
Fix cancel button not working while uploading on the new issue page
merge_request
:
15137
author
:
type
:
fixed
spec/features/issues_spec.rb
View file @
0c49b5eb
...
...
@@ -583,6 +583,16 @@ describe 'Issues' do
expect
(
page
.
find_field
(
"issue_description"
).
value
).
not_to
match
/\n\n$/
end
it
"cancels a file upload correctly"
do
dropzone_file
([
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
)],
0
,
false
)
click_button
'Cancel'
expect
(
page
).
to
have_button
(
'Attach a file'
)
expect
(
page
).
not_to
have_button
(
'Cancel'
)
expect
(
page
).
not_to
have_selector
(
'.uploading-progress-container'
,
visible:
true
)
end
end
context
'form filled by URL parameters'
do
...
...
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