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
1aa2a240
Commit
1aa2a240
authored
Dec 17, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update jsdoc and add destructuring
- Per maintainer review
parent
02f5ed95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/assets/javascripts/ide/components/new_dropdown/upload.vue
...assets/javascripts/ide/components/new_dropdown/upload.vue
+3
-3
app/assets/javascripts/ide/lib/files.js
app/assets/javascripts/ide/lib/files.js
+5
-1
No files found.
app/assets/javascripts/ide/components/new_dropdown/upload.vue
View file @
1aa2a240
...
...
@@ -25,10 +25,10 @@ export default {
},
methods
:
{
createFile
(
target
,
file
)
{
const
{
name
}
=
file
;
const
{
name
,
type
:
mimeType
}
=
file
;
const
encodedContent
=
target
.
result
.
split
(
'
base64,
'
)[
1
];
const
rawContent
=
encodedContent
?
atob
(
encodedContent
)
:
''
;
const
isText
=
isTextFile
({
content
:
rawContent
,
mimeType
:
file
.
type
,
name
});
const
isText
=
isTextFile
({
content
:
rawContent
,
mimeType
,
name
});
const
emitCreateEvent
=
content
=>
this
.
$emit
(
'
create
'
,
{
...
...
@@ -36,7 +36,7 @@ export default {
type
:
'
blob
'
,
content
,
rawPath
:
!
isText
?
URL
.
createObjectURL
(
file
)
:
''
,
mimeType
:
file
.
type
,
mimeType
,
});
if
(
isText
)
{
...
...
app/assets/javascripts/ide/lib/files.js
View file @
1aa2a240
...
...
@@ -12,7 +12,11 @@ export const splitParent = path => {
/**
* Create file objects from a list of file paths.
*
* @param options.blobData Values to initialize each blob with
* @param {Array} options.data Array of blob paths to parse and create a file tree from.
* @param {Boolean} options.tempFile Web IDE flag for whether this is a "new" file or not.
* @param {String} options.content Content to initialize the new blob with.
* @param {String} options.rawPath Raw path used for the new blob.
* @param {Object} options.blobData Extra values to initialize each blob with.
*/
export
const
decorateFiles
=
({
data
,
...
...
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