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
518203d5
Commit
518203d5
authored
Apr 06, 2017
by
Phil Hughes
Committed by
Jacob Schatz
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed specs
Updated JS that was causing the hints to appear & then disappear
parent
7eba42f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
19 deletions
+34
-19
app/assets/javascripts/shortcuts.js
app/assets/javascripts/shortcuts.js
+9
-4
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+21
-7
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/shortcuts_spec.rb
+4
-8
No files found.
app/assets/javascripts/shortcuts.js
View file @
518203d5
...
@@ -17,15 +17,20 @@ import findAndFollowLink from './shortcuts_dashboard_navigation';
...
@@ -17,15 +17,20 @@ import findAndFollowLink from './shortcuts_dashboard_navigation';
Mousetrap
.
bind
(
'
s
'
,
Shortcuts
.
focusSearch
);
Mousetrap
.
bind
(
'
s
'
,
Shortcuts
.
focusSearch
);
Mousetrap
.
bind
(
'
f
'
,
(
e
=>
this
.
focusFilter
(
e
)));
Mousetrap
.
bind
(
'
f
'
,
(
e
=>
this
.
focusFilter
(
e
)));
const
globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
const
$globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
const
$globalDropdownToggle
=
$
(
'
.global-dropdown-toggle
'
);
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
()
=>
{
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
()
=>
{
globalDropdownMenu
.
toggl
eClass
(
'
shortcuts
'
);
$globalDropdownMenu
.
remov
eClass
(
'
shortcuts
'
);
});
});
Mousetrap
.
bind
(
'
n
'
,
()
=>
{
Mousetrap
.
bind
(
'
n
'
,
()
=>
{
globalDropdownMenu
.
toggleClass
(
'
shortcuts
'
);
$globalDropdownMenu
.
toggleClass
(
'
shortcuts
'
);
$
(
'
.global-dropdown-toggle
'
).
trigger
(
'
click
'
);
$globalDropdownToggle
.
trigger
(
'
click
'
);
if
(
!
$globalDropdownMenu
.
is
(
'
:visible
'
))
{
$globalDropdownToggle
.
blur
();
}
});
});
Mousetrap
.
bind
(
'
shift+t
'
,
()
=>
findAndFollowLink
(
'
.shortcuts-todos
'
));
Mousetrap
.
bind
(
'
shift+t
'
,
()
=>
findAndFollowLink
(
'
.shortcuts-todos
'
));
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
518203d5
...
@@ -2,13 +2,17 @@
...
@@ -2,13 +2,17 @@
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
"
#{
project_tab_class
}
home"
})
do
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
"
#{
project_tab_class
}
home"
})
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
.shortcut-mappings
.shortcut-mappings
.key
shift p
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
P
%span
%span
Projects
Projects
=
nav_link
(
path:
'dashboard#activity'
)
do
=
nav_link
(
path:
'dashboard#activity'
)
do
=
link_to
activity_dashboard_path
,
class:
'dashboard-shortcuts-activity'
,
title:
'Activity'
do
=
link_to
activity_dashboard_path
,
class:
'dashboard-shortcuts-activity'
,
title:
'Activity'
do
.shortcut-mappings
.shortcut-mappings
.key
shift a
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
A
%span
%span
Activity
Activity
-
if
koding_enabled?
-
if
koding_enabled?
...
@@ -19,33 +23,43 @@
...
@@ -19,33 +23,43 @@
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
.shortcut-mappings
.shortcut-mappings
.key
shift g
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
G
%span
%span
Groups
Groups
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
link_to
dashboard_milestones_path
,
class:
'dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
=
link_to
dashboard_milestones_path
,
class:
'dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
.shortcut-mappings
.shortcut-mappings
.key
shift l
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
L
%span
%span
Milestones
Milestones
=
nav_link
(
path:
'dashboard#issues'
)
do
=
nav_link
(
path:
'dashboard#issues'
)
do
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'dashboard-shortcuts-issues'
do
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'dashboard-shortcuts-issues'
do
.shortcut-mappings
.shortcut-mappings
.key
shift i
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
I
%span
%span
Issues
Issues
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:issues
,
:opened
))
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:issues
,
:opened
))
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'dashboard-shortcuts-merge_requests'
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'dashboard-shortcuts-merge_requests'
do
.shortcut-mappings
.shortcut-mappings
.key
shift m
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
M
%span
%span
Merge Requests
Merge Requests
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:merge_requests
,
:opened
))
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:merge_requests
,
:opened
))
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
link_to
dashboard_snippets_path
,
class:
'dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
=
link_to
dashboard_snippets_path
,
class:
'dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
.shortcut-mappings
.shortcut-mappings
.key
shift s
.key
=
icon
(
'arrow-up'
,
'aria-label'
=>
'hidden'
)
S
%span
%span
Snippets
Snippets
%li
.divider
%li
.divider
...
...
spec/features/dashboard/shortcuts_spec.rb
View file @
518203d5
...
@@ -7,23 +7,19 @@ feature 'Dashboard shortcuts', feature: true, js: true do
...
@@ -7,23 +7,19 @@ feature 'Dashboard shortcuts', feature: true, js: true do
end
end
scenario
'Navigate to tabs'
do
scenario
'Navigate to tabs'
do
find
(
'body'
).
native
.
send_key
(
:shift
)
find
(
'body'
).
native
.
send_keys
([
:shift
,
'P'
])
find
(
'body'
).
native
.
send_key
(
'p'
)
check_page_title
(
'Projects'
)
check_page_title
(
'Projects'
)
find
(
'body'
).
native
.
send_key
(
:shift
)
find
(
'body'
).
native
.
send_key
([
:shift
,
'I'
])
find
(
'body'
).
native
.
send_key
(
'i'
)
check_page_title
(
'Issues'
)
check_page_title
(
'Issues'
)
find
(
'body'
).
native
.
send_key
(
:shift
)
find
(
'body'
).
native
.
send_key
([
:shift
,
'M'
])
find
(
'body'
).
native
.
send_key
(
'm'
)
check_page_title
(
'Merge Requests'
)
check_page_title
(
'Merge Requests'
)
find
(
'body'
).
native
.
send_key
(
:shift
)
find
(
'body'
).
native
.
send_keys
([
:shift
,
'T'
])
find
(
'body'
).
native
.
send_key
(
't'
)
check_page_title
(
'Todos'
)
check_page_title
(
'Todos'
)
end
end
...
...
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