summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-03-17 10:58:19 +0000
committerSean McGivern <sean@gitlab.com>2017-03-17 10:58:19 +0000
commit84571446c5428668120d27166d124057b0f983ea (patch)
tree89322c27efb0dbffd79f0edbbc26bcb637a72692
parent4413d97b2a51e25d7d0d6f30e5170f67b4612166 (diff)
downloadgitlab-ce-add-todos-shortcut.tar.gz
Add global `g t` shortcut to go to todosadd-todos-shortcut
-rw-r--r--app/assets/javascripts/shortcuts_dashboard_navigation.js3
-rw-r--r--app/assets/javascripts/shortcuts_navigation.js3
-rw-r--r--app/views/help/_shortcuts.html.haml6
-rw-r--r--app/views/layouts/header/_default.html.haml2
-rw-r--r--changelogs/unreleased/add-todos-shortcut.yml4
-rw-r--r--doc/workflow/shortcuts.md1
-rw-r--r--spec/features/dashboard/shortcuts_spec.rb5
7 files changed, 23 insertions, 1 deletions
diff --git a/app/assets/javascripts/shortcuts_dashboard_navigation.js b/app/assets/javascripts/shortcuts_dashboard_navigation.js
index e7baea894f6..4f1a19924a4 100644
--- a/app/assets/javascripts/shortcuts_dashboard_navigation.js
+++ b/app/assets/javascripts/shortcuts_dashboard_navigation.js
@@ -22,6 +22,9 @@ require('./shortcuts');
Mousetrap.bind('g m', function() {
return ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-merge_requests');
});
+ Mousetrap.bind('g t', function() {
+ return ShortcutsDashboardNavigation.findAndFollowLink('.shortcuts-todos');
+ });
Mousetrap.bind('g p', function() {
return ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-projects');
});
diff --git a/app/assets/javascripts/shortcuts_navigation.js b/app/assets/javascripts/shortcuts_navigation.js
index 09a58cad2b2..3f5d6724417 100644
--- a/app/assets/javascripts/shortcuts_navigation.js
+++ b/app/assets/javascripts/shortcuts_navigation.js
@@ -43,6 +43,9 @@ require('./shortcuts');
Mousetrap.bind('g m', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-merge_requests');
});
+ Mousetrap.bind('g t', function() {
+ return ShortcutsNavigation.findAndFollowLink('.shortcuts-todos');
+ });
Mousetrap.bind('g w', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-wiki');
});
diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml
index 2684f16c373..8e6da3fad90 100644
--- a/app/views/help/_shortcuts.html.haml
+++ b/app/views/help/_shortcuts.html.haml
@@ -118,6 +118,12 @@
.key m
%td
Go to merge requests
+ %tr
+ %td.shortcut
+ .key g
+ .key t
+ %td
+ Go to todos
%tbody
%tr
%th
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 5fde5c2613e..7e78df2914a 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -32,7 +32,7 @@
= link_to admin_root_path, title: 'Admin Area', aria: { label: "Admin Area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('wrench fw')
%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" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'}, class: 'shortcuts-todos' do
= icon('bell fw')
%span.badge.todos-pending-count{ class: ("hidden" if todos_pending_count == 0) }
= todos_count_format(todos_pending_count)
diff --git a/changelogs/unreleased/add-todos-shortcut.yml b/changelogs/unreleased/add-todos-shortcut.yml
new file mode 100644
index 00000000000..41d42775937
--- /dev/null
+++ b/changelogs/unreleased/add-todos-shortcut.yml
@@ -0,0 +1,4 @@
+---
+title: Add `g t` global shortcut to go to todos
+merge_request:
+author:
diff --git a/doc/workflow/shortcuts.md b/doc/workflow/shortcuts.md
index 7aa9b46081a..f94357abec9 100644
--- a/doc/workflow/shortcuts.md
+++ b/doc/workflow/shortcuts.md
@@ -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>i</kbd> | Go to issues |
| <kbd>g</kbd> + <kbd>m</kbd> | Go to merge requests |
+| <kbd>g</kbd> + <kbd>t</kbd> | Go to todos |
## Project
diff --git a/spec/features/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb
index 62a2c54c94c..3642c0bfb5b 100644
--- a/spec/features/dashboard/shortcuts_spec.rb
+++ b/spec/features/dashboard/shortcuts_spec.rb
@@ -21,6 +21,11 @@ feature 'Dashboard shortcuts', feature: true, js: true do
find('body').native.send_key('m')
check_page_title('Merge Requests')
+
+ find('body').native.send_key('g')
+ find('body').native.send_key('t')
+
+ check_page_title('Todos')
end
def check_page_title(title)