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
1e1c72f6
Commit
1e1c72f6
authored
Jan 16, 2020
by
Natalia Tepluhina
Committed by
Fatih Acet
Jan 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed attachToDocument option
Added changelog entry
parent
60bb192b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
0 deletions
+69
-0
changelogs/unreleased/118604-design-view-left-right-keyboard-arrows-through-designs.yml
...esign-view-left-right-keyboard-arrows-through-designs.yml
+5
-0
doc/user/project/issues/design_management.md
doc/user/project/issues/design_management.md
+2
-0
ee/app/assets/javascripts/design_management/components/toolbar/pagination.vue
...ripts/design_management/components/toolbar/pagination.vue
+20
-0
ee/spec/frontend/design_management/components/toolbar/pagination_spec.js
...d/design_management/components/toolbar/pagination_spec.js
+42
-0
No files found.
changelogs/unreleased/118604-design-view-left-right-keyboard-arrows-through-designs.yml
0 → 100644
View file @
1e1c72f6
---
title
:
'
Resolve
Design
View:
Left/Right
keyboard
arrows
through
Designs'
merge_request
:
22870
author
:
type
:
added
doc/user/project/issues/design_management.md
View file @
1e1c72f6
...
...
@@ -71,6 +71,8 @@ Designs cannot be added if the issue has been moved, or its
## Viewing designs
Images on the Design Management page can be enlarged by clicking on them.
You can navigate through designs by clicking on the navigation buttons on the
top-right corner or with
<kbd>
Left
</kbd>
/
<kbd>
Right
</kbd>
keyboard buttons.
The number of comments on a design — if any — is listed to the right
of the design filename. Clicking on this number enlarges the design
...
...
ee/app/assets/javascripts/design_management/components/toolbar/pagination.vue
View file @
1e1c72f6
<
script
>
/* global Mousetrap */
import
'
mousetrap
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
PaginationButton
from
'
./pagination_button.vue
'
;
import
allDesignsMixin
from
'
../../mixins/all_designs
'
;
...
...
@@ -38,6 +40,24 @@ export default {
return
this
.
designs
[
this
.
currentIndex
+
1
];
},
},
mounted
()
{
Mousetrap
.
bind
(
'
left
'
,
()
=>
this
.
navigateToDesign
(
this
.
previousDesign
));
Mousetrap
.
bind
(
'
right
'
,
()
=>
this
.
navigateToDesign
(
this
.
nextDesign
));
},
beforeDestroy
()
{
Mousetrap
.
unbind
([
'
left
'
,
'
right
'
],
this
.
navigateToDesign
);
},
methods
:
{
navigateToDesign
(
design
)
{
if
(
design
)
{
this
.
$router
.
push
({
name
:
'
design
'
,
params
:
{
id
:
design
.
filename
},
query
:
this
.
$route
.
query
,
});
}
},
},
};
</
script
>
...
...
ee/spec/frontend/design_management/components/toolbar/pagination_spec.js
View file @
1e1c72f6
/* global Mousetrap */
import
'
mousetrap
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Pagination
from
'
ee/design_management/components/toolbar/pagination.vue
'
;
const
push
=
jest
.
fn
();
const
$router
=
{
push
,
};
const
$route
=
{
path
:
'
/designs/design-2
'
,
query
:
{},
};
describe
(
'
Design management pagination component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -9,6 +21,10 @@ describe('Design management pagination component', () => {
propsData
:
{
id
:
'
2
'
,
},
mocks
:
{
$router
,
$route
,
},
});
}
...
...
@@ -33,4 +49,30 @@ describe('Design management pagination component', () => {
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
});
describe
(
'
keyboard buttons navigation
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
.
setData
({
designs
:
[{
filename
:
'
1
'
},
{
filename
:
'
2
'
},
{
filename
:
'
3
'
}],
});
});
it
(
'
routes to previous design on Left button
'
,
()
=>
{
Mousetrap
.
trigger
(
'
left
'
);
expect
(
push
).
toHaveBeenCalledWith
({
name
:
'
design
'
,
params
:
{
id
:
'
1
'
},
query
:
{},
});
});
it
(
'
routes to next design on Right button
'
,
()
=>
{
Mousetrap
.
trigger
(
'
right
'
);
expect
(
push
).
toHaveBeenCalledWith
({
name
:
'
design
'
,
params
:
{
id
:
'
3
'
},
query
:
{},
});
});
});
});
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