diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 15:10:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 15:10:22 +0300 |
commit | d2f4295270852f1ec4b9736f1db493421729474d (patch) | |
tree | c3bb3833ab7b6039a6b7223cc26745d373295fa3 /app/assets/javascripts/design_management/pages | |
parent | 89cbcca95d58b6185098c13467d2382032f11774 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/design_management/pages')
-rw-r--r-- | app/assets/javascripts/design_management/pages/index.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index 5092c30aa60..42d5d8fb359 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -4,7 +4,7 @@ import VueDraggable from 'vuedraggable'; import permissionsQuery from 'shared_queries/design_management/design_permissions.query.graphql'; import getDesignListQuery from 'shared_queries/design_management/get_design_list.query.graphql'; import createFlash, { FLASH_TYPES } from '~/flash'; -import { getFilename } from '~/lib/utils/file_upload'; +import { getFilename, validateImageName } from '~/lib/utils/file_upload'; import { __, s__, sprintf } from '~/locale'; import DesignDropzone from '~/vue_shared/components/upload_dropzone/upload_dropzone.vue'; import DeleteButton from '../components/delete_button.vue'; @@ -284,12 +284,16 @@ export default { return; } event.preventDefault(); - let filename = getFilename(event); - if (!filename || filename === 'image.png') { - filename = `design_${Date.now()}.png`; - } - const newFile = new File([files[0]], filename); - this.onUploadDesign([newFile]); + const fileList = [...files]; + fileList.forEach((file) => { + let filename = getFilename(file); + filename = validateImageName(file); + if (!filename || filename === 'image.png') { + filename = `design_${Date.now()}.png`; + } + const newFile = new File([file], filename); + this.onUploadDesign([newFile]); + }); } }, toggleOnPasteListener() { |