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
31646b16
Commit
31646b16
authored
Apr 01, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed upload file not uploading to the correct directory
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/212642
parent
924829f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
app/assets/javascripts/blob/blob_file_dropzone.js
app/assets/javascripts/blob/blob_file_dropzone.js
+4
-0
changelogs/unreleased/ph-212642-userUploadsFile.yml
changelogs/unreleased/ph-212642-userUploadsFile.yml
+5
-0
spec/features/projects/files/user_uploads_files_spec.rb
spec/features/projects/files/user_uploads_files_spec.rb
+25
-0
No files found.
app/assets/javascripts/blob/blob_file_dropzone.js
View file @
31646b16
...
@@ -43,6 +43,10 @@ export default class BlobFileDropzone {
...
@@ -43,6 +43,10 @@ export default class BlobFileDropzone {
previewsContainer
:
'
.dropzone-previews
'
,
previewsContainer
:
'
.dropzone-previews
'
,
headers
:
csrf
.
headers
,
headers
:
csrf
.
headers
,
init
()
{
init
()
{
this
.
on
(
'
processing
'
,
function
()
{
this
.
options
.
url
=
form
.
attr
(
'
action
'
);
});
this
.
on
(
'
addedfile
'
,
()
=>
{
this
.
on
(
'
addedfile
'
,
()
=>
{
toggleLoading
(
submitButton
,
submitButtonLoadingIcon
,
false
);
toggleLoading
(
submitButton
,
submitButtonLoadingIcon
,
false
);
dropzoneMessage
.
addClass
(
HIDDEN_CLASS
);
dropzoneMessage
.
addClass
(
HIDDEN_CLASS
);
...
...
changelogs/unreleased/ph-212642-userUploadsFile.yml
0 → 100644
View file @
31646b16
---
title
:
Fixed upload file creating a file in the wrong directory
merge_request
:
author
:
type
:
fixed
spec/features/projects/files/user_uploads_files_spec.rb
View file @
31646b16
...
@@ -22,6 +22,31 @@ describe 'Projects > Files > User uploads files' do
...
@@ -22,6 +22,31 @@ describe 'Projects > Files > User uploads files' do
include_examples
'it uploads and commit a new text file'
include_examples
'it uploads and commit a new text file'
include_examples
'it uploads and commit a new image file'
include_examples
'it uploads and commit a new image file'
it
'uploads a file to a sub-directory'
,
:js
do
click_link
'files'
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_content
(
'files'
)
end
find
(
'.add-to-tree'
).
click
click_link
(
'Upload file'
)
drop_in_dropzone
(
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'doc_sample.txt'
))
page
.
within
(
'#modal-upload-blob'
)
do
fill_in
(
:commit_message
,
with:
'New commit message'
)
end
click_button
(
'Upload file'
)
expect
(
page
).
to
have_content
(
'New commit message'
)
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_content
(
'files'
)
expect
(
page
).
to
have_content
(
'doc_sample.txt'
)
end
end
end
end
context
'when a user does not have write access'
do
context
'when a user does not have write access'
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