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
f4cb8cfd
Commit
f4cb8cfd
authored
May 02, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hook up design management backend to frontend
parent
b6d3820e
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
211 additions
and
155 deletions
+211
-155
ee/app/assets/javascripts/design_management/components/list/index.vue
...s/javascripts/design_management/components/list/index.vue
+1
-1
ee/app/assets/javascripts/design_management/components/list/item.vue
...ts/javascripts/design_management/components/list/item.vue
+6
-4
ee/app/assets/javascripts/design_management/components/toolbar/index.vue
...avascripts/design_management/components/toolbar/index.vue
+2
-2
ee/app/assets/javascripts/design_management/components/toolbar/pagination.vue
...ripts/design_management/components/toolbar/pagination.vue
+3
-12
ee/app/assets/javascripts/design_management/graphql.js
ee/app/assets/javascripts/design_management/graphql.js
+14
-60
ee/app/assets/javascripts/design_management/index.js
ee/app/assets/javascripts/design_management/index.js
+16
-0
ee/app/assets/javascripts/design_management/mixins/all_designs.js
...ssets/javascripts/design_management/mixins/all_designs.js
+41
-0
ee/app/assets/javascripts/design_management/pages/design/index.vue
...sets/javascripts/design_management/pages/design/index.vue
+2
-2
ee/app/assets/javascripts/design_management/pages/index.vue
ee/app/assets/javascripts/design_management/pages/index.vue
+67
-33
ee/app/assets/javascripts/design_management/queries/allDesigns.graphql
.../javascripts/design_management/queries/allDesigns.graphql
+15
-7
ee/app/assets/javascripts/design_management/queries/designListFragment.graphql
...ipts/design_management/queries/designListFragment.graphql
+4
-0
ee/app/assets/javascripts/design_management/queries/getDesign.graphql
...s/javascripts/design_management/queries/getDesign.graphql
+1
-5
ee/app/assets/javascripts/design_management/queries/uploadDesign.graphql
...avascripts/design_management/queries/uploadDesign.graphql
+7
-7
ee/app/assets/javascripts/design_management/router.js
ee/app/assets/javascripts/design_management/router.js
+1
-1
ee/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb
...s/issues/design_management/user_paginates_designs_spec.rb
+5
-2
ee/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
...cts/issues/design_management/user_uploads_designs_spec.rb
+1
-2
ee/spec/features/projects/issues/design_management/user_views_design_spec.rb
...ojects/issues/design_management/user_views_design_spec.rb
+3
-2
ee/spec/features/projects/issues/design_management/user_views_designs_spec.rb
...jects/issues/design_management/user_views_designs_spec.rb
+3
-1
ee/spec/frontend/design_management/components/list/index_spec.js
.../frontend/design_management/components/list/index_spec.js
+1
-1
ee/spec/frontend/design_management/pages/design/__snapshots__/index_spec.js.snap
..._management/pages/design/__snapshots__/index_spec.js.snap
+0
-2
ee/spec/frontend/design_management/pages/design/index_spec.js
...pec/frontend/design_management/pages/design/index_spec.js
+1
-1
ee/spec/frontend/design_management/pages/index_spec.js
ee/spec/frontend/design_management/pages/index_spec.js
+14
-10
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/assets/javascripts/design_management/components/list/index.vue
View file @
f4cb8cfd
...
...
@@ -21,7 +21,7 @@ export default {
:id=
"design.id"
:comments-count=
"design.commentsCount"
:image=
"design.image"
:name=
"design.name"
:name=
"design.
file
name"
:updated-at=
"design.updatedAt"
/>
</li>
...
...
ee/app/assets/javascripts/design_management/components/list/item.vue
View file @
f4cb8cfd
...
...
@@ -10,12 +10,13 @@ export default {
},
props
:
{
id
:
{
type
:
Number
,
type
:
[
Number
,
String
]
,
required
:
true
,
},
commentsCount
:
{
type
:
Number
,
required
:
true
,
required
:
false
,
default
:
0
,
},
image
:
{
type
:
String
,
...
...
@@ -27,7 +28,8 @@ export default {
},
updatedAt
:
{
type
:
String
,
required
:
true
,
required
:
false
,
default
:
null
,
},
},
computed
:
{
...
...
@@ -49,7 +51,7 @@ export default {
<div
class=
"card-footer d-flex w-100"
>
<div
class=
"d-flex flex-column str-truncated-100"
>
<span
class=
"bold str-truncated-100"
>
{{
name
}}
</span>
<span
class=
"str-truncated-100"
>
<span
v-if=
"updatedAt"
class=
"str-truncated-100"
>
{{
__
(
'
Updated
'
)
}}
<timeago
:time=
"updatedAt"
tooltip-placement=
"bottom"
/>
</span>
</div>
...
...
ee/app/assets/javascripts/design_management/components/toolbar/index.vue
View file @
f4cb8cfd
...
...
@@ -29,7 +29,7 @@ export default {
updatedAt
:
{
type
:
String
,
required
:
false
,
default
:
''
,
default
:
null
,
},
updatedBy
:
{
type
:
Object
,
...
...
@@ -61,7 +61,7 @@ export default {
<gl-loading-icon
v-if=
"isLoading"
size=
"md"
class=
"mt-2 mb-2"
/>
<template
v-else
>
<h2
class=
"m-0"
>
{{
name
}}
</h2>
<small
class=
"text-secondary"
>
{{
updatedText
}}
</small>
<small
v-if=
"updatedAt"
class=
"text-secondary"
>
{{
updatedText
}}
</small>
</
template
>
</div>
<pagination
:id=
"id"
class=
"ml-auto"
/>
...
...
ee/app/assets/javascripts/design_management/components/toolbar/pagination.vue
View file @
f4cb8cfd
...
...
@@ -2,35 +2,26 @@
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
PaginationButton
from
'
./pagination_button.vue
'
;
import
allDesigns
Query
from
'
../../queries/allDesigns.graphql
'
;
import
allDesigns
Mixin
from
'
../../mixins/all_designs
'
;
export
default
{
apollo
:
{
designs
:
{
query
:
allDesignsQuery
,
},
},
components
:
{
Icon
,
PaginationButton
,
},
mixins
:
[
allDesignsMixin
],
props
:
{
id
:
{
type
:
Number
,
required
:
true
,
},
},
data
()
{
return
{
designs
:
[],
};
},
computed
:
{
designsCount
()
{
return
this
.
designs
.
length
;
},
currentIndex
()
{
return
this
.
designs
.
findIndex
(
design
=>
design
.
id
===
this
.
id
);
return
this
.
designs
.
findIndex
(
design
=>
parseInt
(
design
.
id
,
10
)
===
this
.
id
);
},
paginationText
()
{
return
sprintf
(
s__
(
'
DesignManagement|%{current_design} of %{designs_count}
'
),
{
...
...
ee/app/assets/javascripts/design_management/graphql.js
View file @
f4cb8cfd
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
_
from
'
underscore
'
;
import
createDefaultClient
from
'
~/lib/graphql
'
;
import
appDataQuery
from
'
./queries/appData.graphql
'
;
import
allDesigns
from
'
./queries/allDesigns.graphql
'
;
Vue
.
use
(
VueApollo
);
const
createMockDesign
=
id
=>
({
id
:
Number
(
id
),
image
:
'
http://via.placeholder.com/1000
'
,
name
:
'
test.jpg
'
,
commentsCount
:
2
,
updatedAt
:
new
Date
().
toString
(),
updatedBy
:
{
name
:
'
Test Name
'
,
__typename
:
'
Author
'
,
},
__typename
:
'
Design
'
,
});
const
designsStore
=
[
createMockDesign
(
_
.
uniqueId
()),
createMockDesign
(
_
.
uniqueId
()),
createMockDesign
(
_
.
uniqueId
()),
createMockDesign
(
_
.
uniqueId
()),
createMockDesign
(
_
.
uniqueId
()),
];
const
defaultClient
=
createDefaultClient
({
Query
:
{
design
(
ctx
,
{
id
})
{
return
designsStore
.
find
(
design
=>
design
.
id
===
id
);
},
},
Mutation
:
{
uploadDesign
(
ctx
,
{
files
},
{
cache
})
{
const
previousDesigns
=
cache
.
readQuery
({
query
:
allDesigns
});
const
designs
=
Array
.
from
(
files
).
map
(
n
=>
({
...
createMockDesign
(
_
.
uniqueId
()),
name
:
n
.
name
,
commentsCount
:
0
,
}));
const
data
=
{
designs
:
designs
.
concat
(
previousDesigns
.
designs
),
};
designsStore
.
unshift
(...
designs
);
cache
.
writeQuery
({
query
:
allDesigns
,
data
});
design
(
ctx
,
{
id
},
{
cache
})
{
const
{
projectPath
,
issueIid
}
=
cache
.
readQuery
({
query
:
appDataQuery
});
const
result
=
cache
.
readQuery
({
query
:
allDesigns
,
variables
:
{
fullPath
:
projectPath
,
iid
:
issueIid
},
});
return
designs
;
},
return
{
...
result
.
project
.
issue
.
designs
.
designs
.
edges
.
find
(
({
node
})
=>
parseInt
(
node
.
id
,
10
)
===
id
,
).
node
,
// TODO: Remove this once backend exposes raw images
image
:
'
http://via.placeholder.com/1000
'
,
};
},
});
defaultClient
.
cache
.
writeData
({
data
:
{
designs
:
designsStore
,
},
});
defaultClient
.
watchQuery
({
query
:
allDesigns
,
})
.
subscribe
(({
data
:
{
designs
}
})
=>
{
const
badge
=
document
.
querySelector
(
'
.js-designs-count
'
);
if
(
badge
)
{
badge
.
textContent
=
designs
.
length
;
}
});
export
default
new
VueApollo
({
defaultClient
,
});
ee/app/assets/javascripts/design_management/index.js
View file @
f4cb8cfd
...
...
@@ -3,9 +3,11 @@ import Vue from 'vue';
import
router
from
'
./router
'
;
import
App
from
'
./components/app.vue
'
;
import
apolloProvider
from
'
./graphql
'
;
import
allDesigns
from
'
./queries/allDesigns.graphql
'
;
export
default
()
=>
{
const
el
=
document
.
getElementById
(
'
js-design-management
'
);
const
badge
=
document
.
querySelector
(
'
.js-designs-count
'
);
const
{
issueIid
,
projectPath
}
=
el
.
dataset
;
$
(
'
.js-issue-tabs
'
).
on
(
'
shown.bs.tab
'
,
({
target
:
{
id
}
})
=>
{
...
...
@@ -23,6 +25,20 @@ export default () => {
},
});
apolloProvider
.
clients
.
defaultClient
.
watchQuery
({
query
:
allDesigns
,
variables
:
{
fullPath
:
projectPath
,
iid
:
issueIid
,
},
})
.
subscribe
(({
data
})
=>
{
if
(
badge
)
{
badge
.
textContent
=
data
.
project
.
issue
.
designs
.
designs
.
length
;
}
});
return
new
Vue
({
el
,
router
,
...
...
ee/app/assets/javascripts/design_management/mixins/all_designs.js
0 → 100644
View file @
f4cb8cfd
import
appDataQuery
from
'
../queries/appData.graphql
'
;
import
allDesignsQuery
from
'
../queries/allDesigns.graphql
'
;
export
default
{
apollo
:
{
appData
:
{
query
:
appDataQuery
,
manual
:
true
,
result
({
data
:
{
projectPath
,
issueIid
}
})
{
this
.
projectPath
=
projectPath
;
this
.
issueIid
=
issueIid
;
},
},
designs
:
{
query
:
allDesignsQuery
,
variables
()
{
return
{
fullPath
:
this
.
projectPath
,
iid
:
this
.
issueIid
,
};
},
update
:
data
=>
data
.
project
.
issue
.
designs
.
designs
.
edges
.
map
(({
node
})
=>
({
...
node
,
// TODO: Remove this once backend exposes raw images
image
:
'
http://via.placeholder.com/1000
'
,
})),
error
()
{
this
.
error
=
true
;
},
},
},
data
()
{
return
{
designs
:
[],
error
:
false
,
projectPath
:
''
,
issueIid
:
null
,
};
},
};
ee/app/assets/javascripts/design_management/pages/design/index.vue
View file @
f4cb8cfd
...
...
@@ -50,10 +50,10 @@ export default {
<toolbar
:id=
"id"
:is-loading=
"isLoading"
:name=
"design.name"
:name=
"design.
file
name"
:updated-at=
"design.updatedAt"
:updated-by=
"design.updatedBy"
/>
<design-image
:is-loading=
"isLoading"
:image=
"design.image"
:name=
"design.name"
/>
<design-image
:is-loading=
"isLoading"
:image=
"design.image"
:name=
"design.
file
name"
/>
</div>
</
template
>
ee/app/assets/javascripts/design_management/pages/index.vue
View file @
f4cb8cfd
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
_
from
'
underscore
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
DesignList
from
'
../components/list/index.vue
'
;
import
UploadForm
from
'
../components/upload/form.vue
'
;
import
EmptyState
from
'
../components/empty_state.vue
'
;
import
allDesignsQuery
from
'
../queries/allDesigns.graphql
'
;
import
uploadDesignQuery
from
'
../queries/uploadDesign.graphql
'
;
import
appDataQuery
from
'
../queries/appData.graphql
'
;
import
uploadDesignMutation
from
'
../queries/uploadDesign.graphql
'
;
import
permissionsQuery
from
'
../queries/permissions.graphql
'
;
import
allDesignsMixin
from
'
../mixins/all_designs
'
;
const
MAXIMUM_FILE_UPLOAD_LIMIT
=
10
;
export
default
{
components
:
{
...
...
@@ -17,21 +20,8 @@ export default {
UploadForm
,
EmptyState
,
},
mixins
:
[
allDesignsMixin
],
apollo
:
{
appData
:
{
query
:
appDataQuery
,
manual
:
true
,
result
({
data
:
{
projectPath
,
issueIid
}
})
{
this
.
projectPath
=
projectPath
;
this
.
issueIid
=
issueIid
;
},
},
designs
:
{
query
:
allDesignsQuery
,
error
()
{
this
.
error
=
true
;
},
},
permissions
:
{
query
:
permissionsQuery
,
variables
()
{
...
...
@@ -45,14 +35,10 @@ export default {
},
data
()
{
return
{
designs
:
[],
permissions
:
{
createDesign
:
false
,
},
error
:
false
,
isSaving
:
false
,
projectPath
:
''
,
issueIid
:
null
,
};
},
computed
:
{
...
...
@@ -73,33 +59,81 @@ export default {
onUploadDesign
(
files
)
{
if
(
!
this
.
canCreateDesign
)
return
null
;
if
(
files
.
length
>=
MAXIMUM_FILE_UPLOAD_LIMIT
)
{
createFlash
(
sprintf
(
s__
(
'
DesignManagement|The maximum number of designs allowed to be uploaded is %{upload_limit}. Please try again.
'
,
),
{
upload_limit
:
MAXIMUM_FILE_UPLOAD_LIMIT
,
},
),
);
return
null
;
}
const
optimisticResponse
=
Array
.
from
(
files
).
map
(
file
=>
({
__typename
:
'
Design
'
,
id
:
-
1
,
id
:
-
_
.
uniqueId
()
,
image
:
''
,
name
:
file
.
name
,
commentsCount
:
0
,
updatedAt
:
new
Date
().
toString
(),
filename
:
file
.
name
,
}));
this
.
isSaving
=
true
;
return
this
.
$apollo
.
mutate
({
mutation
:
uploadDesign
Query
,
mutation
:
uploadDesign
Mutation
,
variables
:
{
files
,
projectPath
:
this
.
projectPath
,
iid
:
this
.
issueIid
,
},
update
:
(
store
,
{
data
:
{
designManagementUpload
}
})
=>
{
const
data
=
store
.
readQuery
({
query
:
allDesignsQuery
,
variables
:
{
fullPath
:
this
.
projectPath
,
iid
:
this
.
issueIid
},
});
const
newDesigns
=
data
.
project
.
issue
.
designs
.
designs
.
edges
.
reduce
((
acc
,
design
)
=>
{
if
(
!
acc
.
find
(
d
=>
d
.
filename
===
design
.
node
.
filename
))
{
acc
.
push
(
design
.
node
);
}
return
acc
;
},
designManagementUpload
.
designs
);
const
newQueryData
=
{
project
:
{
__typename
:
'
Project
'
,
issue
:
{
__typename
:
'
Issue
'
,
designs
:
{
__typename
:
'
DesignCollection
'
,
designs
:
{
__typename
:
'
DesignConnection
'
,
edges
:
newDesigns
.
map
(
design
=>
({
__typename
:
'
DesignEdge
'
,
node
:
design
,
})),
},
},
},
// update: (store, { data: { uploadDesign } }) => {
// const data = store.readQuery({ query: allDesignsQuery });
// console.log(data, uploadDesign);
},
};
// data.designs.unshift(...uploadDesign);
// store.writeQuery({ query: allDesignsQuery, data });
// },
store
.
writeQuery
({
query
:
allDesignsQuery
,
variables
:
{
fullPath
:
this
.
projectPath
,
iid
:
this
.
issueIid
},
data
:
newQueryData
,
});
},
optimisticResponse
:
{
__typename
:
'
Mutation
'
,
uploadDesign
:
optimisticResponse
,
designManagementUpload
:
{
__typename
:
'
DesignManagementUploadPayload
'
,
designs
:
optimisticResponse
,
},
},
})
.
then
(()
=>
{
...
...
ee/app/assets/javascripts/design_management/queries/allDesigns.graphql
View file @
f4cb8cfd
query
allDesigns
{
designs
@client
{
id
image
name
updatedAt
commentsCount
#import "./designListFragment.graphql"
query
allDesigns
(
$fullPath
:
ID
!,
$iid
:
ID
!)
{
project
(
fullPath
:
$fullPath
)
{
issue
(
iid
:
$iid
)
{
designs
{
designs
{
edges
{
node
{
...
DesignListItem
}
}
}
}
}
}
}
ee/app/assets/javascripts/design_management/queries/designListFragment.graphql
0 → 100644
View file @
f4cb8cfd
fragment
DesignListItem
on
Design
{
id
filename
}
ee/app/assets/javascripts/design_management/queries/getDesign.graphql
View file @
f4cb8cfd
query
getDesign
(
$id
:
ID
!)
{
design
(
id
:
$id
)
@client
{
image
name
updatedAt
updatedBy
{
name
}
filename
}
}
ee/app/assets/javascripts/design_management/queries/uploadDesign.graphql
View file @
f4cb8cfd
mutation
addDesigns
(
$files
:
[
Upload
!]!)
{
uploadDesign
(
files
:
$files
)
@client
{
id
image
name
updatedAt
commentsCount
#import "./designListFragment.graphql"
mutation
uploadDesign
(
$files
:
[
Upload
!]!,
$projectPath
:
ID
!,
$iid
:
ID
!)
{
designManagementUpload
(
input
:
{
projectPath
:
$projectPath
,
iid
:
$iid
,
files
:
$files
})
{
designs
{
...
DesignListItem
}
}
}
ee/app/assets/javascripts/design_management/router.js
View file @
f4cb8cfd
...
...
@@ -39,7 +39,7 @@ const router = new VueRouter({
from
,
next
,
)
{
if
(
id
!==
-
1
)
next
();
if
(
id
>
0
)
next
();
},
props
:
({
params
:
{
id
}
})
=>
({
id
:
parseInt
(
id
,
10
)
}),
},
...
...
ee/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb
View file @
f4cb8cfd
...
...
@@ -5,6 +5,9 @@ describe 'User paginates issue designs', :js do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
create
(
:design
,
issue:
issue
,
filename:
'world.png'
)
create
(
:design
,
issue:
issue
,
filename:
'dk.png'
)
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
...
...
@@ -20,7 +23,7 @@ describe 'User paginates issue designs', :js do
expect
(
find
(
'.js-previous-design'
)[
:disabled
]).
to
eq
(
'true'
)
page
.
within
(
find
(
'.js-design-header'
))
do
expect
(
page
).
to
have_content
(
'1 of
5
'
)
expect
(
page
).
to
have_content
(
'1 of
2
'
)
end
find
(
'.js-next-design'
).
click
...
...
@@ -28,7 +31,7 @@ describe 'User paginates issue designs', :js do
expect
(
find
(
'.js-previous-design'
)[
:disabled
]).
not_to
eq
(
'true'
)
page
.
within
(
find
(
'.js-design-header'
))
do
expect
(
page
).
to
have_content
(
'2 of
5
'
)
expect
(
page
).
to
have_content
(
'2 of
2
'
)
end
end
end
ee/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
View file @
f4cb8cfd
...
...
@@ -23,11 +23,10 @@ describe 'User uploads new design', :js do
it
'uploads design'
do
attach_file
(
:design_file
,
logo_fixture
,
make_visible:
true
)
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
6
)
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
1
)
within
first
(
'#designs-tab .card'
)
do
expect
(
page
).
to
have_content
(
'dk.png'
)
expect
(
page
).
to
have_content
(
'Updated just now'
)
end
end
end
...
...
ee/spec/features/projects/issues/design_management/user_views_design_spec.rb
View file @
f4cb8cfd
...
...
@@ -5,6 +5,8 @@ describe 'User views issue designs', :js do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
create
(
:design
,
issue:
issue
,
filename:
'world.png'
)
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
...
...
@@ -18,8 +20,7 @@ describe 'User views issue designs', :js do
find
(
'.js-design-list-item'
,
match: :first
).
click
page
.
within
(
find
(
'.js-design-header'
))
do
expect
(
page
).
to
have_content
(
'test.jpg'
)
expect
(
page
).
to
have_content
(
'Test Name'
)
expect
(
page
).
to
have_content
(
'world.png'
)
end
expect
(
page
).
to
have_selector
(
'.js-design-image'
)
...
...
ee/spec/features/projects/issues/design_management/user_views_designs_spec.rb
View file @
f4cb8cfd
...
...
@@ -5,6 +5,8 @@ describe 'User views issue designs', :js do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
create
(
:design
,
issue:
issue
,
filename:
'world.png'
)
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
...
...
@@ -15,6 +17,6 @@ describe 'User views issue designs', :js do
end
it
'fetches list of designs'
do
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
1
)
end
end
ee/spec/frontend/design_management/components/list/index_spec.js
View file @
f4cb8cfd
...
...
@@ -3,7 +3,7 @@ import List from 'ee/design_management/components/list/index.vue';
const
createMockDesign
=
id
=>
({
id
,
name
:
'
test
'
,
file
name
:
'
test
'
,
image
:
'
test
'
,
commentsCount
:
2
,
updatedAt
:
'
01-01-2019
'
,
...
...
ee/spec/frontend/design_management/pages/design/__snapshots__/index_spec.js.snap
View file @
f4cb8cfd
...
...
@@ -7,7 +7,6 @@ exports[`Design management design index page renders design index 1`] = `
<toolbar-stub
id="1"
name="test.jpg"
updatedat=""
updatedby="[object Object]"
/>
...
...
@@ -26,7 +25,6 @@ exports[`Design management design index page sets loading state 1`] = `
id="1"
isloading="true"
name=""
updatedat=""
updatedby="[object Object]"
/>
...
...
ee/spec/frontend/design_management/pages/design/index_spec.js
View file @
f4cb8cfd
...
...
@@ -30,7 +30,7 @@ describe('Design management design index page', () => {
vm
.
setData
({
design
:
{
name
:
'
test.jpg
'
,
file
name
:
'
test.jpg
'
,
image
:
'
test.jpg
'
,
updatedAt
:
'
01-01-2019
'
,
updatedBy
:
{
...
...
ee/spec/frontend/design_management/pages/index_spec.js
View file @
f4cb8cfd
...
...
@@ -95,20 +95,24 @@ describe('Design management index page', () => {
mutation
:
uploadDesignQuery
,
variables
:
{
files
:
[{
name
:
'
test
'
}],
projectPath
:
''
,
iid
:
null
,
},
update
:
expect
.
anything
(),
optimisticResponse
:
{
__typename
:
'
Mutation
'
,
uploadDesign
:
[
designManagementUpload
:
{
__typename
:
'
DesignManagementUploadPayload
'
,
designs
:
[
{
__typename
:
'
Design
'
,
id
:
-
1
,
id
:
expect
.
anything
()
,
image
:
''
,
name
:
'
test
'
,
commentsCount
:
0
,
updatedAt
:
expect
.
any
(
String
),
filename
:
'
test
'
,
},
],
},
},
});
});
});
...
...
locale/gitlab.pot
View file @
f4cb8cfd
...
...
@@ -3898,6 +3898,9 @@ msgstr ""
msgid "DesignManagement|Go to previous design"
msgstr ""
msgid "DesignManagement|The maximum number of designs allowed to be uploaded is %{upload_limit}. Please try again."
msgstr ""
msgid "DesignManagement|The one place for your designs"
msgstr ""
...
...
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