Commit 8404ab46 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add shortcut for project activity page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c2f02fc1
...@@ -64,6 +64,7 @@ class Dispatcher ...@@ -64,6 +64,7 @@ class Dispatcher
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
when 'projects:activity' when 'projects:activity'
new Activities() new Activities()
shortcut_handler = new ShortcutsNavigation()
when 'projects:show' when 'projects:show'
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
when 'groups:show' when 'groups:show'
......
...@@ -4,6 +4,7 @@ class @ShortcutsNavigation extends Shortcuts ...@@ -4,6 +4,7 @@ class @ShortcutsNavigation extends Shortcuts
constructor: -> constructor: ->
super() super()
Mousetrap.bind('g p', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project')) 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 f', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'))
Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits')) Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits'))
Mousetrap.bind('g n', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-network')) Mousetrap.bind('g n', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-network'))
......
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
%td.shortcut %td.shortcut
.key g .key g
.key p .key p
%td
Go to the project's home page
%tr
%td.shortcut
.key g
.key e
%td %td
Go to the project's activity feed Go to the project's activity feed
%tr %tr
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
= icon('home fw') = icon('home fw')
%span %span
Project Project
= nav_link(path: 'projects#activity', html_options: {class: 'activity'}) do = nav_link(path: 'projects#activity') do
= link_to activity_project_path(@project), title: 'Project', data: {placement: 'right'} do = link_to activity_project_path(@project), title: 'Project Activity', class: 'shortcuts-project-activity', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Activity Activity
......
...@@ -46,7 +46,13 @@ Feature: Project Shortcuts ...@@ -46,7 +46,13 @@ Feature: Project Shortcuts
Then the active main tab should be Wiki Then the active main tab should be Wiki
@javascript @javascript
Scenario: Navigate to project feed Scenario: Navigate to project home
Given I visit my project's files page Given I visit my project's files page
Given I press "g" and "p" Given I press "g" and "p"
Then the active main tab should be Home 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
...@@ -33,4 +33,9 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps ...@@ -33,4 +33,9 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
find('body').native.send_key('g') find('body').native.send_key('g')
find('body').native.send_key('w') find('body').native.send_key('w')
end end
step 'I press "g" and "e"' do
find('body').native.send_key('g')
find('body').native.send_key('e')
end
end end
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