summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:43:46 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:43:46 +0200
commit8404ab46b91103033a78fdd183e9873f85799b6f (patch)
tree6164e0b548deba381b51b7f8eaddc1dd6701ec53
parentc2f02fc1a4b88e1c01cb3562168322d0c5debba3 (diff)
downloadgitlab-ce-8404ab46b91103033a78fdd183e9873f85799b6f.tar.gz
Add shortcut for project activity page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee1
-rw-r--r--app/assets/javascripts/shortcuts_navigation.coffee1
-rw-r--r--app/views/help/_shortcuts.html.haml6
-rw-r--r--app/views/layouts/nav/_project.html.haml4
-rw-r--r--features/project/shortcuts.feature8
-rw-r--r--features/steps/project/project_shortcuts.rb5
6 files changed, 22 insertions, 3 deletions
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index aa6b50ca0f9..8ceaef81a07 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -64,6 +64,7 @@ class Dispatcher
shortcut_handler = new ShortcutsNavigation()
when 'projects:activity'
new Activities()
+ shortcut_handler = new ShortcutsNavigation()
when 'projects:show'
shortcut_handler = new ShortcutsNavigation()
when 'groups:show'
diff --git a/app/assets/javascripts/shortcuts_navigation.coffee b/app/assets/javascripts/shortcuts_navigation.coffee
index 31895fbf2bc..5b6f9e7e3f2 100644
--- a/app/assets/javascripts/shortcuts_navigation.coffee
+++ b/app/assets/javascripts/shortcuts_navigation.coffee
@@ -4,6 +4,7 @@ class @ShortcutsNavigation extends Shortcuts
constructor: ->
super()
Mousetrap.bind('g p', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project'))
+ Mousetrap.bind('g e', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity'))
Mousetrap.bind('g f', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'))
Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits'))
Mousetrap.bind('g n', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-network'))
diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml
index 825acb0ae3e..e809d99ba71 100644
--- a/app/views/help/_shortcuts.html.haml
+++ b/app/views/help/_shortcuts.html.haml
@@ -80,6 +80,12 @@
.key g
.key p
%td
+ Go to the project's home page
+ %tr
+ %td.shortcut
+ .key g
+ .key e
+ %td
Go to the project's activity feed
%tr
%td.shortcut
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index cbd5de4cba2..2012478eba9 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -4,8 +4,8 @@
= icon('home fw')
%span
Project
- = nav_link(path: 'projects#activity', html_options: {class: 'activity'}) do
- = link_to activity_project_path(@project), title: 'Project', data: {placement: 'right'} do
+ = nav_link(path: 'projects#activity') do
+ = link_to activity_project_path(@project), title: 'Project Activity', class: 'shortcuts-project-activity', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Activity
diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature
index cfb68bf1f50..9567b571120 100644
--- a/features/project/shortcuts.feature
+++ b/features/project/shortcuts.feature
@@ -46,7 +46,13 @@ Feature: Project Shortcuts
Then the active main tab should be Wiki
@javascript
- Scenario: Navigate to project feed
+ Scenario: Navigate to project home
Given I visit my project's files page
Given I press "g" and "p"
Then the active main tab should be Home
+
+ @javascript
+ Scenario: Navigate to project feed
+ Given I visit my project's files page
+ Given I press "g" and "e"
+ Then the active main tab should be Activity
diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb
index a10e7bf78ee..49e9c5520bb 100644
--- a/features/steps/project/project_shortcuts.rb
+++ b/features/steps/project/project_shortcuts.rb
@@ -33,4 +33,9 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
find('body').native.send_key('g')
find('body').native.send_key('w')
end
+
+ step 'I press "g" and "e"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('e')
+ end
end