BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
dropzone_input.js
app/assets/javascripts/dropzone_input.js
+1
-3
jivl-fix-cancel-button-file-upload-new-issue.yml
...released/jivl-fix-cancel-button-file-upload-new-issue.yml
+5
-0
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