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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
78a8a79b
Commit
78a8a79b
authored
Mar 18, 2018
by
Clement Ho
Committed by
Jacob Schatz
Mar 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dropzone project show
parent
ea5221ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
app/assets/javascripts/pages/projects/show/index.js
app/assets/javascripts/pages/projects/show/index.js
+17
-4
changelogs/unreleased/fix-dropzone-project-show.yml
changelogs/unreleased/fix-dropzone-project-show.yml
+5
-0
spec/features/projects/show_project_spec.rb
spec/features/projects/show_project_spec.rb
+22
-0
No files found.
app/assets/javascripts/pages/projects/show/index.js
View file @
78a8a79b
import
$
from
'
jquery
'
;
import
initBlob
from
'
~/blob_edit/blob_bundle
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
UserCallout
from
'
~/user_callout
'
;
...
...
@@ -19,10 +20,22 @@ document.addEventListener('DOMContentLoaded', () => {
className
:
'
js-autodevops-banner
'
,
});
if
(
$
(
'
#tree-slider
'
).
length
)
new
TreeView
();
// eslint-disable-line no-new
if
(
$
(
'
.blob-viewer
'
).
length
)
new
BlobViewer
();
// eslint-disable-line no-new
if
(
$
(
'
.project-show-activity
'
).
length
)
new
Activities
();
// eslint-disable-line no-new
$
(
'
#tree-slider
'
).
waitForImages
(()
=>
{
// Project show page loads different overview content based on user preferences
const
treeSlider
=
document
.
querySelector
(
'
#tree-slider
'
);
if
(
treeSlider
)
{
new
TreeView
();
// eslint-disable-line no-new
initBlob
();
}
if
(
document
.
querySelector
(
'
.blob-viewer
'
))
{
new
BlobViewer
();
// eslint-disable-line no-new
}
if
(
document
.
querySelector
(
'
.project-show-activity
'
))
{
new
Activities
();
// eslint-disable-line no-new
}
$
(
treeSlider
).
waitForImages
(()
=>
{
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
);
});
});
changelogs/unreleased/fix-dropzone-project-show.yml
0 → 100644
View file @
78a8a79b
---
title
:
Fix file upload on project show page
merge_request
:
author
:
type
:
fixed
spec/features/projects/show_project_spec.rb
View file @
78a8a79b
require
'spec_helper'
describe
'Project show page'
,
:feature
do
include
DropzoneHelper
context
'when project pending delete'
do
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
pending_delete:
true
)
}
...
...
@@ -334,4 +336,24 @@ describe 'Project show page', :feature do
end
end
end
describe
'dropzone'
,
:js
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
visit
project_path
(
project
)
end
it
'can upload files'
do
find
(
'.add-to-tree'
).
click
click_link
'Upload file'
drop_in_dropzone
(
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'doc_sample.txt'
))
expect
(
find
(
'.dz-filename'
)).
to
have_content
(
'doc_sample.txt'
)
end
end
end
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