Commit d12c9921 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch '28538-restore-nav-shortcuts' into 'master'

Restore keyboard shortcuts for "Activity" and "Charts"

Closes #28538

See merge request !9680
parents 6902f950 6a2516f9
...@@ -16,6 +16,9 @@ require('./shortcuts'); ...@@ -16,6 +16,9 @@ require('./shortcuts');
Mousetrap.bind('g p', function() { Mousetrap.bind('g p', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-project'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-project');
}); });
Mousetrap.bind('g e', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity');
});
Mousetrap.bind('g f', function() { Mousetrap.bind('g f', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-tree');
}); });
...@@ -28,6 +31,9 @@ require('./shortcuts'); ...@@ -28,6 +31,9 @@ require('./shortcuts');
Mousetrap.bind('g n', function() { Mousetrap.bind('g n', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-network'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-network');
}); });
Mousetrap.bind('g g', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-repository-charts');
});
Mousetrap.bind('g i', function() { Mousetrap.bind('g i', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-issues'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-issues');
}); });
......
...@@ -128,6 +128,12 @@ ...@@ -128,6 +128,12 @@
.key p .key p
%td %td
Go to the project's home page Go to the project's home page
%tr
%td.shortcut
.key g
.key e
%td
Go to the project's activity feed
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
...@@ -152,6 +158,12 @@ ...@@ -152,6 +158,12 @@
.key n .key n
%td %td
Go to network graph Go to network graph
%tr
%td.shortcut
.key g
.key g
%td
Go to repository charts
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
......
...@@ -71,18 +71,30 @@ ...@@ -71,18 +71,30 @@
%span %span
Snippets Snippets
-# Global shortcut to network page for compatibility -# Shortcut to Project > Activity
%li.hidden
= link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
%span
Activity
-# Shortcut to Repository > Graph (formerly, Network)
- if project_nav_tab? :network - if project_nav_tab? :network
%li.hidden %li.hidden
= link_to namespace_project_network_path(@project.namespace, @project, current_ref), title: 'Network', class: 'shortcuts-network' do = link_to namespace_project_network_path(@project.namespace, @project, current_ref), title: 'Network', class: 'shortcuts-network' do
Network Graph
-# Shortcut to Repository > Charts (formerly, top-nav item "Graphs")
- unless @project.empty_repo?
%li.hidden
= link_to charts_namespace_project_graph_path(@project.namespace, @project, current_ref), title: 'Charts', class: 'shortcuts-repository-charts' do
Charts
-# Shortcut to create a new issue -# Shortcut to Issues > New Issue
%li.hidden %li.hidden
= link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do
Create a new issue Create a new issue
-# Shortcut to builds page -# Shortcut to Pipelines > Jobs
- if project_nav_tab? :builds - if project_nav_tab? :builds
%li.hidden %li.hidden
= link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do = link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
......
---
title: Restore keyboard shortcuts for "Activity" and "Charts"
merge_request: 9680
author:
...@@ -42,10 +42,12 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?' ...@@ -42,10 +42,12 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?'
| Keyboard Shortcut | Description | | Keyboard Shortcut | Description |
| ----------------- | ----------- | | ----------------- | ----------- |
| <kbd>g</kbd> + <kbd>p</kbd> | Go to the project's home page | | <kbd>g</kbd> + <kbd>p</kbd> | Go to the project's home page |
| <kbd>g</kbd> + <kbd>e</kbd> | Go to the project's activity feed |
| <kbd>g</kbd> + <kbd>f</kbd> | Go to files | | <kbd>g</kbd> + <kbd>f</kbd> | Go to files |
| <kbd>g</kbd> + <kbd>c</kbd> | Go to commits | | <kbd>g</kbd> + <kbd>c</kbd> | Go to commits |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to jobs | | <kbd>g</kbd> + <kbd>b</kbd> | Go to jobs |
| <kbd>g</kbd> + <kbd>n</kbd> | Go to network graph | | <kbd>g</kbd> + <kbd>n</kbd> | Go to network graph |
| <kbd>g</kbd> + <kbd>g</kbd> | Go to repository charts |
| <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>s</kbd> | Go to snippets | | <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets |
......
...@@ -7,8 +7,9 @@ Feature: Project Active Tab ...@@ -7,8 +7,9 @@ Feature: Project Active Tab
Scenario: On Project Home Scenario: On Project Home
Given I visit my project's home page Given I visit my project's home page
Then the active main tab should be Home Then the active sub tab should be Home
And no other main tabs should be active And no other sub tabs should be active
And the active main tab should be Project
Scenario: On Project Repository Scenario: On Project Repository
Given I visit my project's files page Given I visit my project's files page
...@@ -34,9 +35,18 @@ Feature: Project Active Tab ...@@ -34,9 +35,18 @@ Feature: Project Active Tab
Scenario: On Project Home/Show Scenario: On Project Home/Show
Given I visit my project's home page Given I visit my project's home page
Then the active main tab should be Home Then the active sub tab should be Home
And no other sub tabs should be active
And the active main tab should be Project
And no other main tabs should be active And no other main tabs should be active
Scenario: On Project Home/Activity
Given I visit my project's home page
And I click the "Activity" tab
Then the active sub tab should be Activity
And no other sub tabs should be active
And the active main tab should be Project
# Sub Tabs: Settings # Sub Tabs: Settings
Scenario: On Project Settings/Integrations Scenario: On Project Settings/Integrations
...@@ -93,6 +103,13 @@ Feature: Project Active Tab ...@@ -93,6 +103,13 @@ Feature: Project Active Tab
And no other sub tabs should be active And no other sub tabs should be active
And the active main tab should be Repository And the active main tab should be Repository
Scenario: On Project Repository/Charts
Given I visit my project's commits page
And I click the "Charts" tab
Then the active sub tab should be Charts
And no other sub tabs should be active
And the active main tab should be Repository
Scenario: On Project Repository/Branches Scenario: On Project Repository/Branches
Given I visit my project's commits page Given I visit my project's commits page
And I click the "Branches" tab And I click the "Branches" tab
......
...@@ -24,6 +24,12 @@ Feature: Project Shortcuts ...@@ -24,6 +24,12 @@ Feature: Project Shortcuts
Then the active sub tab should be Graph Then the active sub tab should be Graph
And the active main tab should be Repository And the active main tab should be Repository
@javascript
Scenario: Navigate to repository charts tab
Given I press "g" and "g"
Then the active sub tab should be Charts
And the active main tab should be Repository
@javascript @javascript
Scenario: Navigate to issues tab Scenario: Navigate to issues tab
Given I press "g" and "i" Given I press "g" and "i"
...@@ -47,4 +53,11 @@ Feature: Project Shortcuts ...@@ -47,4 +53,11 @@ Feature: Project Shortcuts
@javascript @javascript
Scenario: Navigate to project home Scenario: Navigate to project home
Given I press "g" and "p" Given I press "g" and "p"
Then the active main tab should be Home Then the active sub tab should be Home
And the active main tab should be Project
@javascript
Scenario: Navigate to project feed
Given I press "g" and "e"
Then the active sub tab should be Activity
And the active main tab should be Project
...@@ -39,6 +39,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -39,6 +39,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
click_link('Pages') click_link('Pages')
end end
step 'I click the "Activity" tab' do
page.within '.sub-nav' do
click_link('Activity')
end
end
step 'the active sub nav should be Members' do step 'the active sub nav should be Members' do
ensure_active_sub_nav('Members') ensure_active_sub_nav('Members')
end end
...@@ -55,6 +61,10 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -55,6 +61,10 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
ensure_active_sub_nav('Pages') ensure_active_sub_nav('Pages')
end end
step 'the active sub tab should be Activity' do
ensure_active_sub_tab('Activity')
end
# Sub Tabs: Commits # Sub Tabs: Commits
step 'I click the "Compare" tab' do step 'I click the "Compare" tab' do
...@@ -71,6 +81,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -71,6 +81,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
click_link('Tags') click_link('Tags')
end end
step 'I click the "Charts" tab' do
page.within '.sub-nav' do
click_link('Charts')
end
end
step 'the active sub tab should be Compare' do step 'the active sub tab should be Compare' do
ensure_active_sub_tab('Compare') ensure_active_sub_tab('Compare')
end end
......
...@@ -34,4 +34,9 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps ...@@ -34,4 +34,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
...@@ -4,7 +4,7 @@ module SharedProjectTab ...@@ -4,7 +4,7 @@ module SharedProjectTab
include Spinach::DSL include Spinach::DSL
include SharedActiveTab include SharedActiveTab
step 'the active main tab should be Home' do step 'the active main tab should be Project' do
ensure_active_main_tab('Project') ensure_active_main_tab('Project')
end end
...@@ -47,4 +47,16 @@ module SharedProjectTab ...@@ -47,4 +47,16 @@ module SharedProjectTab
step 'the active sub tab should be Commits' do step 'the active sub tab should be Commits' do
ensure_active_sub_tab('Commits') ensure_active_sub_tab('Commits')
end end
step 'the active sub tab should be Home' do
ensure_active_sub_tab('Home')
end
step 'the active sub tab should be Activity' do
ensure_active_sub_tab('Activity')
end
step 'the active sub tab should be Charts' do
ensure_active_sub_tab('Charts')
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