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
a48992de
Commit
a48992de
authored
Dec 06, 2019
by
Jarek Ostrowski
Committed by
Natalia Tepluhina
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove actions buttons if theres no designs
Add changelog Put v-if before class, lint error Prettify
parent
7add986c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
23 deletions
+45
-23
changelogs/unreleased/remove-action-buttons-if-no-designs.yml
...gelogs/unreleased/remove-action-buttons-if-no-designs.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/__snapshots__/index_spec.js.snap
.../design_management/pages/__snapshots__/index_spec.js.snap
+19
-19
ee/spec/frontend/design_management/pages/index_spec.js
ee/spec/frontend/design_management/pages/index_spec.js
+20
-3
No files found.
changelogs/unreleased/remove-action-buttons-if-no-designs.yml
0 → 100644
View file @
a48992de
---
title
:
Remove action buttons from designs tab if there are no designs
merge_request
:
21186
author
:
type
:
fixed
ee/app/assets/javascripts/design_management/pages/index.vue
View file @
a48992de
...
...
@@ -212,7 +212,7 @@ export default {
<header
v-if=
"showToolbar"
class=
"row-content-block border-top-0 p-2 d-flex"
>
<div
class=
"d-flex justify-content-between align-items-center w-100"
>
<design-version-dropdown
/>
<div
class=
"d-flex
"
>
<div
v-if=
"hasDesigns"
class=
"d-flex qa-selector-toolbar
"
>
<gl-button
v-if=
"isLatestVersion"
variant=
"link"
...
...
ee/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap
View file @
a48992de
...
...
@@ -69,7 +69,7 @@ exports[`Design management index page designs renders designs list and header wi
<designversiondropdown-stub />
<div
class="d-flex"
class="d-flex
qa-selector-toolbar
"
>
<glbutton-stub
class="mr-2 js-select-all"
...
...
@@ -158,17 +158,20 @@ exports[`Design management index page designs renders designs list and header wi
</div>
`;
exports[`Design management index page designs renders e
mpty text
1`] = `
exports[`Design management index page designs renders e
rror
1`] = `
<div>
<!---->
<div
class="mt-4"
>
<glemptystate-stub
description="Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date."
title="The one place for your designs"
/>
<div
class="alert alert-danger"
>
An error occurred while loading designs. Please try again.
</div>
</div>
<routerview-stub
...
...
@@ -177,20 +180,18 @@ exports[`Design management index page designs renders empty text 1`] = `
</div>
`;
exports[`Design management index page designs renders
error
1`] = `
exports[`Design management index page designs renders
loading icon
1`] = `
<div>
<!---->
<div
class="mt-4"
>
<div
class="alert alert-danger"
>
An error occurred while loading designs. Please try again.
</div>
<glloadingicon-stub
color="orange"
label="Loading"
size="md"
/>
</div>
<routerview-stub
...
...
@@ -199,17 +200,16 @@ exports[`Design management index page designs renders error 1`] = `
</div>
`;
exports[`Design management index page
designs renders loading icon
1`] = `
exports[`Design management index page
when has no designs renders empty text
1`] = `
<div>
<!---->
<div
class="mt-4"
>
<glloadingicon-stub
color="orange"
label="Loading"
size="md"
<glemptystate-stub
description="Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date."
title="The one place for your designs"
/>
</div>
...
...
ee/spec/frontend/design_management/pages/index_spec.js
View file @
a48992de
...
...
@@ -56,6 +56,7 @@ describe('Design management index page', () => {
const
findDesignCheckboxes
=
()
=>
wrapper
.
findAll
(
'
.design-checkbox
'
);
const
findSelectAllButton
=
()
=>
wrapper
.
find
(
'
.js-select-all
'
);
const
findDeleteButton
=
()
=>
wrapper
.
find
(
'
deletebutton-stub
'
);
const
findToolbar
=
()
=>
wrapper
.
find
(
'
.qa-selector-toolbar
'
);
function
createComponent
({
loading
=
false
,
...
...
@@ -115,10 +116,12 @@ describe('Design management index page', () => {
});
});
it
(
'
renders
empty text
'
,
()
=>
{
createComponent
();
it
(
'
renders
a toolbar with buttons when there are designs
'
,
()
=>
{
createComponent
(
{
designs
:
mockDesigns
,
allVersions
:
[
mockVersion
]
}
);
expect
(
wrapper
.
element
).
toMatchSnapshot
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findToolbar
().
exists
()).
toBe
(
true
);
});
});
it
(
'
renders designs list and header with upload button
'
,
()
=>
{
...
...
@@ -138,6 +141,20 @@ describe('Design management index page', () => {
});
});
describe
(
'
when has no designs
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
it
(
'
renders empty text
'
,
()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
it
(
'
does not render a toolbar with buttons
'
,
()
=>
{
expect
(
findToolbar
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
onUploadDesign
'
,
()
=>
{
it
(
'
calls apollo mutate
'
,
()
=>
{
createComponent
();
...
...
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