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
f112946a
Commit
f112946a
authored
Apr 27, 2020
by
Natalia Tepluhina
Committed by
Andrew Fontaine
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Allow multiple screenshots to be uploaded in copy paste"
parent
ee09ef37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
doc/user/project/issues/design_management.md
doc/user/project/issues/design_management.md
+1
-0
ee/app/assets/javascripts/design_management/pages/index.vue
ee/app/assets/javascripts/design_management/pages/index.vue
+4
-1
ee/changelogs/unreleased/214470-allow-multiple-screenshots-to-be-uploaded-in-copy-paste.yml
...low-multiple-screenshots-to-be-uploaded-in-copy-paste.yml
+5
-0
ee/spec/frontend/design_management/pages/index_spec.js
ee/spec/frontend/design_management/pages/index_spec.js
+14
-0
No files found.
doc/user/project/issues/design_management.md
View file @
f112946a
...
...
@@ -86,6 +86,7 @@ Copy-and-pasting has some limitations:
-
You can paste only one image at a time. When copy/pasting multiple files, only the first one will be uploaded.
-
All images will be converted to
`png`
format under the hood, so when you want to copy/paste
`gif`
file, it will result in broken animation.
-
If you are pasting a screenshot from the clipboard, it will be renamed to
`design_<timestamp>.png`
-
Copy/pasting designs is not supported on Internet Explorer.
Designs with the same filename as an existing uploaded design will create a new version
...
...
ee/app/assets/javascripts/design_management/pages/index.vue
View file @
f112946a
...
...
@@ -230,7 +230,10 @@ export default {
return
;
}
event
.
preventDefault
();
const
filename
=
getFilename
(
event
)
||
'
image.png
'
;
let
filename
=
getFilename
(
event
);
if
(
!
filename
||
filename
===
'
image.png
'
)
{
filename
=
`design_
${
Date
.
now
()}
.png`
;
}
const
newFile
=
new
File
([
files
[
0
]],
filename
);
this
.
onUploadDesign
([
newFile
]);
}
...
...
ee/changelogs/unreleased/214470-allow-multiple-screenshots-to-be-uploaded-in-copy-paste.yml
0 → 100644
View file @
f112946a
---
title
:
Resolve Allow multiple screenshots to be uploaded in copy paste
merge_request
:
30152
author
:
type
:
changed
ee/spec/frontend/design_management/pages/index_spec.js
View file @
f112946a
...
...
@@ -505,6 +505,20 @@ describe('Design management index page', () => {
]);
});
it
(
'
renames a design if it has an image.png filename
'
,
()
=>
{
event
.
clipboardData
=
{
files
:
[{
name
:
'
image.png
'
,
type
:
'
image/png
'
}],
getData
:
()
=>
'
image.png
'
,
};
document
.
dispatchEvent
(
event
);
expect
(
wrapper
.
vm
.
onUploadDesign
).
toHaveBeenCalledTimes
(
1
);
expect
(
wrapper
.
vm
.
onUploadDesign
).
toHaveBeenCalledWith
([
new
File
([{
name
:
'
image.png
'
}],
`design_
${
Date
.
now
()}
.png`
),
]);
});
it
(
'
does not call onUploadDesign with invalid paste
'
,
()
=>
{
event
.
clipboardData
=
{
items
:
[{
type
:
'
text/plain
'
},
{
type
:
'
text
'
}],
...
...
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