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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
195c058c
Commit
195c058c
authored
Apr 07, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added keyboard shortcuts to signed out menu
parent
ce6a48cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
16 deletions
+51
-16
app/views/layouts/nav/_explore.html.haml
app/views/layouts/nav/_explore.html.haml
+16
-3
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/shortcuts_spec.rb
+35
-13
No files found.
app/views/layouts/nav/_explore.html.haml
View file @
195c058c
%ul
%ul
=
nav_link
(
path:
[
'dashboard#show'
,
'root#show'
,
'projects#trending'
,
'projects#starred'
,
'projects#index'
],
html_options:
{
class:
'home'
})
do
=
nav_link
(
path:
[
'dashboard#show'
,
'root#show'
,
'projects#trending'
,
'projects#starred'
,
'projects#index'
],
html_options:
{
class:
'home'
})
do
=
link_to
explore_root_path
,
title:
'Projects'
do
=
link_to
explore_root_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
.shortcut-mappings
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
P
%span
%span
Projects
Projects
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
link_to
explore_groups_path
,
title:
'Groups'
do
=
link_to
explore_groups_path
,
title:
'Groups'
,
class:
'dashboard-shortcuts-groups'
do
.shortcut-mappings
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
G
%span
%span
Groups
Groups
=
nav_link
(
controller: :snippets
)
do
=
nav_link
(
controller: :snippets
)
do
=
link_to
explore_snippets_path
,
title:
'Snippets'
do
=
link_to
explore_snippets_path
,
title:
'Snippets'
,
class:
'dashboard-shortcuts-snippets'
do
.shortcut-mappings
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
S
%span
%span
Snippets
Snippets
%li
.divider
=
nav_link
(
controller: :help
)
do
=
nav_link
(
controller: :help
)
do
=
link_to
help_path
,
title:
'Help'
do
=
link_to
help_path
,
title:
'Help'
do
%span
%span
...
...
spec/features/dashboard/shortcuts_spec.rb
View file @
195c058c
require
'spec_helper'
require
'spec_helper'
feature
'Dashboard shortcuts'
,
feature:
true
,
js:
true
do
feature
'Dashboard shortcuts'
,
feature:
true
,
js:
true
do
before
do
context
'logged in'
do
login_as
:user
before
do
visit
root_dashboard_path
login_as
:user
end
visit
root_dashboard_path
end
scenario
'Navigate to tabs'
do
find
(
'body'
).
native
.
send_keys
([
:shift
,
'P'
])
check_page_title
(
'Projects'
)
find
(
'body'
).
native
.
send_key
([
:shift
,
'I'
])
check_page_title
(
'Issues'
)
scenario
'Navigate to tabs'
do
find
(
'body'
).
native
.
send_key
([
:shift
,
'M'
])
find
(
'body'
).
native
.
send_keys
([
:shift
,
'P'
])
check_page_title
(
'Merge Requests'
)
find
(
'body'
).
native
.
send_keys
([
:shift
,
'T'
])
check_page_title
(
'Todos'
)
end
end
check_page_title
(
'Projects'
)
context
'logged out'
do
before
do
visit
explore_root_path
end
find
(
'body'
).
native
.
send_key
([
:shift
,
'I'
])
scenario
'Navigate to tabs'
do
find
(
'body'
).
native
.
send_keys
([
:shift
,
'P'
])
check_page_title
(
'Issues
'
)
expect
(
page
).
to
have_content
(
'No projects found
'
)
find
(
'body'
).
native
.
send_key
([
:shift
,
'M
'
])
find
(
'body'
).
native
.
send_keys
([
:shift
,
'G
'
])
check_page_title
(
'Merge Request
s'
)
expect
(
page
).
to
have_content
(
'No public group
s'
)
find
(
'body'
).
native
.
send_keys
([
:shift
,
'T
'
])
find
(
'body'
).
native
.
send_keys
([
:shift
,
'S
'
])
check_page_title
(
'Todos'
)
expect
(
page
).
to
have_selector
(
'.snippets-list-holder'
)
end
end
end
def
check_page_title
(
title
)
def
check_page_title
(
title
)
...
...
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