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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
index.js
app/assets/javascripts/pages/projects/show/index.js
+17
-4
fix-dropzone-project-show.yml
changelogs/unreleased/fix-dropzone-project-show.yml
+5
-0
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
$
from
'jquery'
;
import
initBlob
from
'~/blob_edit/blob_bundle'
;
import
ShortcutsNavigation
from
'~/shortcuts_navigation'
;
import
ShortcutsNavigation
from
'~/shortcuts_navigation'
;
import
NotificationsForm
from
'~/notifications_form'
;
import
NotificationsForm
from
'~/notifications_form'
;
import
UserCallout
from
'~/user_callout'
;
import
UserCallout
from
'~/user_callout'
;
...
@@ -19,10 +20,22 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -19,10 +20,22 @@ document.addEventListener('DOMContentLoaded', () => {
className
:
'js-autodevops-banner'
,
className
:
'js-autodevops-banner'
,
});
});
if
(
$
(
'#tree-slider'
).
length
)
new
TreeView
();
// eslint-disable-line no-new
// Project show page loads different overview content based on user preferences
if
(
$
(
'.blob-viewer'
).
length
)
new
BlobViewer
();
// eslint-disable-line no-new
const
treeSlider
=
document
.
querySelector
(
'#tree-slider'
);
if
(
$
(
'.project-show-activity'
).
length
)
new
Activities
();
// eslint-disable-line no-new
if
(
treeSlider
)
{
$
(
'#tree-slider'
).
waitForImages
(()
=>
{
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
);
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'
require
'spec_helper'
describe
'Project show page'
,
:feature
do
describe
'Project show page'
,
:feature
do
include
DropzoneHelper
context
'when project pending delete'
do
context
'when project pending delete'
do
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
pending_delete:
true
)
}
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
pending_delete:
true
)
}
...
@@ -334,4 +336,24 @@ describe 'Project show page', :feature do
...
@@ -334,4 +336,24 @@ describe 'Project show page', :feature do
end
end
end
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
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