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
Léo-Paul Géneau
gitlab-ce
Commits
c77fc4ce
Commit
c77fc4ce
authored
Mar 17, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add global `g t` shortcut to go to todos
parent
4413d97b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
1 deletion
+23
-1
app/assets/javascripts/shortcuts_dashboard_navigation.js
app/assets/javascripts/shortcuts_dashboard_navigation.js
+3
-0
app/assets/javascripts/shortcuts_navigation.js
app/assets/javascripts/shortcuts_navigation.js
+3
-0
app/views/help/_shortcuts.html.haml
app/views/help/_shortcuts.html.haml
+6
-0
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+1
-1
changelogs/unreleased/add-todos-shortcut.yml
changelogs/unreleased/add-todos-shortcut.yml
+4
-0
doc/workflow/shortcuts.md
doc/workflow/shortcuts.md
+1
-0
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/shortcuts_spec.rb
+5
-0
No files found.
app/assets/javascripts/shortcuts_dashboard_navigation.js
View file @
c77fc4ce
...
@@ -22,6 +22,9 @@ require('./shortcuts');
...
@@ -22,6 +22,9 @@ require('./shortcuts');
Mousetrap
.
bind
(
'
g m
'
,
function
()
{
Mousetrap
.
bind
(
'
g m
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-merge_requests
'
);
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-merge_requests
'
);
});
});
Mousetrap
.
bind
(
'
g t
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.shortcuts-todos
'
);
});
Mousetrap
.
bind
(
'
g p
'
,
function
()
{
Mousetrap
.
bind
(
'
g p
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-projects
'
);
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-projects
'
);
});
});
...
...
app/assets/javascripts/shortcuts_navigation.js
View file @
c77fc4ce
...
@@ -43,6 +43,9 @@ require('./shortcuts');
...
@@ -43,6 +43,9 @@ require('./shortcuts');
Mousetrap
.
bind
(
'
g m
'
,
function
()
{
Mousetrap
.
bind
(
'
g m
'
,
function
()
{
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-merge_requests
'
);
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-merge_requests
'
);
});
});
Mousetrap
.
bind
(
'
g t
'
,
function
()
{
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-todos
'
);
});
Mousetrap
.
bind
(
'
g w
'
,
function
()
{
Mousetrap
.
bind
(
'
g w
'
,
function
()
{
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-wiki
'
);
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-wiki
'
);
});
});
...
...
app/views/help/_shortcuts.html.haml
View file @
c77fc4ce
...
@@ -118,6 +118,12 @@
...
@@ -118,6 +118,12 @@
.key
m
.key
m
%td
%td
Go to merge requests
Go to merge requests
%tr
%td
.shortcut
.key
g
.key
t
%td
Go to todos
%tbody
%tbody
%tr
%tr
%th
%th
...
...
app/views/layouts/header/_default.html.haml
View file @
c77fc4ce
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
=
link_to
admin_root_path
,
title:
'Admin Area'
,
aria:
{
label:
"Admin Area"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
admin_root_path
,
title:
'Admin Area'
,
aria:
{
label:
"Admin Area"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
=
icon
(
'wrench fw'
)
%li
%li
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
aria:
{
label:
"Todos"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
aria:
{
label:
"Todos"
},
class:
'shortcuts-todos'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'bell fw'
)
=
icon
(
'bell fw'
)
%span
.badge.todos-pending-count
{
class:
(
"hidden"
if
todos_pending_count
==
0
)
}
%span
.badge.todos-pending-count
{
class:
(
"hidden"
if
todos_pending_count
==
0
)
}
=
todos_count_format
(
todos_pending_count
)
=
todos_count_format
(
todos_pending_count
)
...
...
changelogs/unreleased/add-todos-shortcut.yml
0 → 100644
View file @
c77fc4ce
---
title
:
Add `g t` global shortcut to go to todos
merge_request
:
author
:
doc/workflow/shortcuts.md
View file @
c77fc4ce
...
@@ -36,6 +36,7 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?'
...
@@ -36,6 +36,7 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?'
|
<kbd>
g
</kbd>
+
<kbd>
p
</kbd>
| Go to projects |
|
<kbd>
g
</kbd>
+
<kbd>
p
</kbd>
| Go to projects |
|
<kbd>
g
</kbd>
+
<kbd>
i
</kbd>
| Go to issues |
|
<kbd>
g
</kbd>
+
<kbd>
i
</kbd>
| Go to issues |
|
<kbd>
g
</kbd>
+
<kbd>
m
</kbd>
| Go to merge requests |
|
<kbd>
g
</kbd>
+
<kbd>
m
</kbd>
| Go to merge requests |
|
<kbd>
g
</kbd>
+
<kbd>
t
</kbd>
| Go to todos |
## Project
## Project
...
...
spec/features/dashboard/shortcuts_spec.rb
View file @
c77fc4ce
...
@@ -21,6 +21,11 @@ feature 'Dashboard shortcuts', feature: true, js: true do
...
@@ -21,6 +21,11 @@ feature 'Dashboard shortcuts', feature: true, js: true do
find
(
'body'
).
native
.
send_key
(
'm'
)
find
(
'body'
).
native
.
send_key
(
'm'
)
check_page_title
(
'Merge Requests'
)
check_page_title
(
'Merge Requests'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
't'
)
check_page_title
(
'Todos'
)
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