Commit 78840333 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'add-todos-shortcut' into 'master'

Add global `g t` shortcut to go to todos

See merge request !10041
parents 141ee129 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');
}); });
......
...@@ -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');
}); });
......
...@@ -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
......
...@@ -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)
......
---
title: Add `g t` global shortcut to go to todos
merge_request:
author:
...@@ -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
......
...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment