Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-03-07 02:52:57 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2017-03-07 02:52:57 +0300
commitd12c992191c0b3941b4cabb36f059b798dd20a35 (patch)
tree22113e90b3cb1a20005d873c6d70a31b782747a5
parent6902f9502b0df42fb071ca2fddc30fb21eb861e4 (diff)
parent6a2516f97843c8fa693cbff4fb76bfbf7af1cf32 (diff)
Merge branch '28538-restore-nav-shortcuts' into 'master'
Restore keyboard shortcuts for "Activity" and "Charts" Closes #28538 See merge request !9680
-rw-r--r--app/assets/javascripts/shortcuts_navigation.js6
-rw-r--r--app/views/help/_shortcuts.html.haml12
-rw-r--r--app/views/layouts/nav/_project.html.haml20
-rw-r--r--changelogs/unreleased/28538-restore-nav-shortcuts.yml4
-rw-r--r--doc/workflow/shortcuts.md2
-rw-r--r--features/project/active_tab.feature23
-rw-r--r--features/project/shortcuts.feature15
-rw-r--r--features/steps/project/active_tab.rb16
-rw-r--r--features/steps/project/project_shortcuts.rb5
-rw-r--r--features/steps/shared/project_tab.rb14
10 files changed, 108 insertions, 9 deletions
diff --git a/app/assets/javascripts/shortcuts_navigation.js b/app/assets/javascripts/shortcuts_navigation.js
index 73db8c10b99..09a58cad2b2 100644
--- a/app/assets/javascripts/shortcuts_navigation.js
+++ b/app/assets/javascripts/shortcuts_navigation.js
@@ -16,6 +16,9 @@ require('./shortcuts');
Mousetrap.bind('g p', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-project');
});
+ Mousetrap.bind('g e', function() {
+ return ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity');
+ });
Mousetrap.bind('g f', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-tree');
});
@@ -28,6 +31,9 @@ require('./shortcuts');
Mousetrap.bind('g n', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-network');
});
+ Mousetrap.bind('g g', function() {
+ return ShortcutsNavigation.findAndFollowLink('.shortcuts-repository-charts');
+ });
Mousetrap.bind('g i', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-issues');
});
diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml
index 5d1369c2010..2684f16c373 100644
--- a/app/views/help/_shortcuts.html.haml
+++ b/app/views/help/_shortcuts.html.haml
@@ -131,6 +131,12 @@
%tr
%td.shortcut
.key g
+ .key e
+ %td
+ Go to the project's activity feed
+ %tr
+ %td.shortcut
+ .key g
.key f
%td
Go to files
@@ -155,6 +161,12 @@
%tr
%td.shortcut
.key g
+ .key g
+ %td
+ Go to repository charts
+ %tr
+ %td.shortcut
+ .key g
.key i
%td
Go to issues
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index 2335d467389..f351e7feac9 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -71,18 +71,30 @@
%span
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
%li.hidden
= 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
= link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do
Create a new issue
- -# Shortcut to builds page
+ -# Shortcut to Pipelines > Jobs
- if project_nav_tab? :builds
%li.hidden
= link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
diff --git a/changelogs/unreleased/28538-restore-nav-shortcuts.yml b/changelogs/unreleased/28538-restore-nav-shortcuts.yml
new file mode 100644
index 00000000000..07b39cd50d1
--- /dev/null
+++ b/changelogs/unreleased/28538-restore-nav-shortcuts.yml
@@ -0,0 +1,4 @@
+---
+title: Restore keyboard shortcuts for "Activity" and "Charts"
+merge_request: 9680
+author:
diff --git a/doc/workflow/shortcuts.md b/doc/workflow/shortcuts.md
index 65e67aa1512..7aa9b46081a 100644
--- a/doc/workflow/shortcuts.md
+++ b/doc/workflow/shortcuts.md
@@ -42,10 +42,12 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?'
| Keyboard Shortcut | Description |
| ----------------- | ----------- |
| <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>c</kbd> | Go to commits |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to jobs |
| <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>m</kbd> | Go to merge requests |
| <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets |
diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature
index 1dd2bdd9b36..8570c637b36 100644
--- a/features/project/active_tab.feature
+++ b/features/project/active_tab.feature
@@ -7,8 +7,9 @@ Feature: Project Active Tab
Scenario: On Project Home
Given I visit my project's home page
- Then the active main tab should be Home
- And no other main tabs should be active
+ Then the active sub tab should be Home
+ And no other sub tabs should be active
+ And the active main tab should be Project
Scenario: On Project Repository
Given I visit my project's files page
@@ -34,9 +35,18 @@ Feature: Project Active Tab
Scenario: On Project Home/Show
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
+ 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
Scenario: On Project Settings/Integrations
@@ -93,6 +103,13 @@ Feature: Project Active Tab
And no other sub tabs should be active
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
Given I visit my project's commits page
And I click the "Branches" tab
diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature
index 95de63ba21a..b47fca31ef2 100644
--- a/features/project/shortcuts.feature
+++ b/features/project/shortcuts.feature
@@ -25,6 +25,12 @@ Feature: Project Shortcuts
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
Scenario: Navigate to issues tab
Given I press "g" and "i"
Then the active main tab should be Issues
@@ -47,4 +53,11 @@ Feature: Project Shortcuts
@javascript
Scenario: Navigate to project home
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
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index e842d7bec2b..d29b22d42ec 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -39,6 +39,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
click_link('Pages')
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
ensure_active_sub_nav('Members')
end
@@ -55,6 +61,10 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
ensure_active_sub_nav('Pages')
end
+ step 'the active sub tab should be Activity' do
+ ensure_active_sub_tab('Activity')
+ end
+
# Sub Tabs: Commits
step 'I click the "Compare" tab' do
@@ -71,6 +81,12 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
click_link('Tags')
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
ensure_active_sub_tab('Compare')
end
diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb
index 02c08b784bc..8143b01ca40 100644
--- a/features/steps/project/project_shortcuts.rb
+++ b/features/steps/project/project_shortcuts.rb
@@ -34,4 +34,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
diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb
index 83446afe424..400114f03c0 100644
--- a/features/steps/shared/project_tab.rb
+++ b/features/steps/shared/project_tab.rb
@@ -4,7 +4,7 @@ module SharedProjectTab
include Spinach::DSL
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')
end
@@ -47,4 +47,16 @@ module SharedProjectTab
step 'the active sub tab should be Commits' do
ensure_active_sub_tab('Commits')
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