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
3a283fa8
Commit
3a283fa8
authored
Aug 29, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabled multiple uploads in the Web IDE
Closes #50405
parent
42523a41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
app/assets/javascripts/ide/components/new_dropdown/upload.vue
...assets/javascripts/ide/components/new_dropdown/upload.vue
+2
-6
changelogs/unreleased/ide-multiple-file-uploads.yml
changelogs/unreleased/ide-multiple-file-uploads.yml
+5
-0
spec/javascripts/ide/components/new_dropdown/upload_spec.js
spec/javascripts/ide/components/new_dropdown/upload_spec.js
+17
-0
No files found.
app/assets/javascripts/ide/components/new_dropdown/upload.vue
View file @
3a283fa8
...
...
@@ -24,12 +24,6 @@ export default {
default
:
null
,
},
},
mounted
()
{
this
.
$refs
.
fileUpload
.
addEventListener
(
'
change
'
,
this
.
openFile
);
},
beforeDestroy
()
{
this
.
$refs
.
fileUpload
.
removeEventListener
(
'
change
'
,
this
.
openFile
);
},
methods
:
{
createFile
(
target
,
file
,
isText
)
{
const
{
name
}
=
file
;
...
...
@@ -85,6 +79,8 @@ export default {
ref=
"fileUpload"
type=
"file"
class=
"hidden"
multiple
@
change=
"openFile"
/>
</div>
</
template
>
changelogs/unreleased/ide-multiple-file-uploads.yml
0 → 100644
View file @
3a283fa8
---
title
:
Enabled multiple file uploads in the Web IDE
merge_request
:
author
:
type
:
added
spec/javascripts/ide/components/new_dropdown/upload_spec.js
View file @
3a283fa8
...
...
@@ -21,6 +21,23 @@ describe('new dropdown upload', () => {
vm
.
$destroy
();
});
describe
(
'
openFile
'
,
()
=>
{
it
(
'
calls for each file
'
,
()
=>
{
const
files
=
[
'
test
'
,
'
test2
'
,
'
test3
'
];
spyOn
(
vm
,
'
readFile
'
);
spyOnProperty
(
vm
.
$refs
.
fileUpload
,
'
files
'
).
and
.
returnValue
(
files
);
vm
.
openFile
();
expect
(
vm
.
readFile
.
calls
.
count
()).
toBe
(
3
);
files
.
forEach
((
file
,
i
)
=>
{
expect
(
vm
.
readFile
.
calls
.
argsFor
(
i
)).
toEqual
([
file
]);
});
});
});
describe
(
'
readFile
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
FileReader
.
prototype
,
'
readAsText
'
);
...
...
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