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
3fcea2b6
Commit
3fcea2b6
authored
Oct 22, 2019
by
André Luís
Committed by
Natalia Tepluhina
Oct 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply correctly the limit of 10 designs per upload
parent
2929db33
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
changelogs/unreleased/andr3-fix-designmanagement-upload-limit.yml
...gs/unreleased/andr3-fix-designmanagement-upload-limit.yml
+5
-0
ee/app/assets/javascripts/design_management/pages/index.vue
ee/app/assets/javascripts/design_management/pages/index.vue
+1
-1
ee/spec/frontend/design_management/pages/index_spec.js
ee/spec/frontend/design_management/pages/index_spec.js
+27
-0
No files found.
changelogs/unreleased/andr3-fix-designmanagement-upload-limit.yml
0 → 100644
View file @
3fcea2b6
---
title
:
Apply correctly the limit of 10 designs per upload
merge_request
:
author
:
type
:
fixed
ee/app/assets/javascripts/design_management/pages/index.vue
View file @
3fcea2b6
...
...
@@ -83,7 +83,7 @@ export default {
onUploadDesign
(
files
)
{
if
(
!
this
.
canCreateDesign
)
return
null
;
if
(
files
.
length
>
=
MAXIMUM_FILE_UPLOAD_LIMIT
)
{
if
(
files
.
length
>
MAXIMUM_FILE_UPLOAD_LIMIT
)
{
createFlash
(
sprintf
(
s__
(
...
...
ee/spec/frontend/design_management/pages/index_spec.js
View file @
3fcea2b6
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
createFlash
from
'
~/flash
'
;
import
VueRouter
from
'
vue-router
'
;
import
Index
from
'
ee/design_management/pages/index.vue
'
;
import
uploadDesignQuery
from
'
ee/design_management/graphql/mutations/uploadDesign.mutation.graphql
'
;
...
...
@@ -16,6 +17,8 @@ const router = new VueRouter({
],
});
jest
.
mock
(
'
~/flash.js
'
);
const
mockDesigns
=
[
{
id
:
'
design-1
'
,
...
...
@@ -218,6 +221,30 @@ describe('Design management index page', () => {
expect
(
wrapper
.
vm
.
isSaving
).
toBe
(
false
);
});
});
describe
(
'
upload count limit
'
,
()
=>
{
const
MAXIMUM_FILE_UPLOAD_LIMIT
=
10
;
afterEach
(()
=>
{
createFlash
.
mockReset
();
});
it
(
'
doesn not warn when the max files are uploaded
'
,
()
=>
{
createComponent
();
wrapper
.
vm
.
onUploadDesign
(
new
Array
(
MAXIMUM_FILE_UPLOAD_LIMIT
).
fill
(
mockDesigns
[
0
]));
expect
(
createFlash
).
not
.
toHaveBeenCalled
();
});
it
(
'
warns when too many files are uploaded
'
,
()
=>
{
createComponent
();
wrapper
.
vm
.
onUploadDesign
(
new
Array
(
MAXIMUM_FILE_UPLOAD_LIMIT
+
1
).
fill
(
mockDesigns
[
0
]));
expect
(
createFlash
).
toHaveBeenCalled
();
});
});
});
describe
(
'
on latest version
'
,
()
=>
{
...
...
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