Commit 0f0400d1 authored by Annabel Gray's avatar Annabel Gray

Merge branch '46427-keyboard-shortcuts-for-kubernetes-and-environments' into 'master'

Add Keyboard shortcuts for "Kubernetes" and "Environments"

Closes #46427

See merge request gitlab-org/gitlab-ce!19002
parents 6fb20b10 b5821e5f
...@@ -7,7 +7,7 @@ export default class ShortcutsNavigation extends Shortcuts { ...@@ -7,7 +7,7 @@ export default class ShortcutsNavigation extends Shortcuts {
super(); super();
Mousetrap.bind('g p', () => findAndFollowLink('.shortcuts-project')); Mousetrap.bind('g p', () => findAndFollowLink('.shortcuts-project'));
Mousetrap.bind('g e', () => findAndFollowLink('.shortcuts-project-activity')); Mousetrap.bind('g v', () => findAndFollowLink('.shortcuts-project-activity'));
Mousetrap.bind('g f', () => findAndFollowLink('.shortcuts-tree')); Mousetrap.bind('g f', () => findAndFollowLink('.shortcuts-tree'));
Mousetrap.bind('g c', () => findAndFollowLink('.shortcuts-commits')); Mousetrap.bind('g c', () => findAndFollowLink('.shortcuts-commits'));
Mousetrap.bind('g j', () => findAndFollowLink('.shortcuts-builds')); Mousetrap.bind('g j', () => findAndFollowLink('.shortcuts-builds'));
...@@ -16,9 +16,10 @@ export default class ShortcutsNavigation extends Shortcuts { ...@@ -16,9 +16,10 @@ export default class ShortcutsNavigation extends Shortcuts {
Mousetrap.bind('g i', () => findAndFollowLink('.shortcuts-issues')); Mousetrap.bind('g i', () => findAndFollowLink('.shortcuts-issues'));
Mousetrap.bind('g b', () => findAndFollowLink('.shortcuts-issue-boards')); Mousetrap.bind('g b', () => findAndFollowLink('.shortcuts-issue-boards'));
Mousetrap.bind('g m', () => findAndFollowLink('.shortcuts-merge_requests')); Mousetrap.bind('g m', () => findAndFollowLink('.shortcuts-merge_requests'));
Mousetrap.bind('g t', () => findAndFollowLink('.shortcuts-todos'));
Mousetrap.bind('g w', () => findAndFollowLink('.shortcuts-wiki')); Mousetrap.bind('g w', () => findAndFollowLink('.shortcuts-wiki'));
Mousetrap.bind('g s', () => findAndFollowLink('.shortcuts-snippets')); Mousetrap.bind('g s', () => findAndFollowLink('.shortcuts-snippets'));
Mousetrap.bind('g k', () => findAndFollowLink('.shortcuts-kubernetes'));
Mousetrap.bind('g e', () => findAndFollowLink('.shortcuts-environments'));
Mousetrap.bind('i', () => findAndFollowLink('.shortcuts-new-issue')); Mousetrap.bind('i', () => findAndFollowLink('.shortcuts-new-issue'));
this.enabledHelp.push('.hidden-shortcut.project'); this.enabledHelp.push('.hidden-shortcut.project');
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
.key e .key v
%td %td
Go to the project's activity feed Go to the project's activity feed
%tr %tr
...@@ -172,6 +172,18 @@ ...@@ -172,6 +172,18 @@
.key m .key m
%td %td
Go to merge requests Go to merge requests
%tr
%td.shortcut
.key g
.key e
%td
Go to environments
%tr
%td.shortcut
.key g
.key k
%td
Go to kubernetes
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
......
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
- if project_nav_tab? :clusters - if project_nav_tab? :clusters
- show_cluster_hint = show_gke_cluster_integration_callout?(@project) - show_cluster_hint = show_gke_cluster_integration_callout?(@project)
= nav_link(controller: [:clusters, :user, :gcp]) do = nav_link(controller: [:clusters, :user, :gcp]) do
= link_to project_clusters_path(@project), title: _('Kubernetes'), class: 'shortcuts-cluster' do = link_to project_clusters_path(@project), title: _('Kubernetes'), class: 'shortcuts-kubernetes' do
%span %span
= _('Kubernetes') = _('Kubernetes')
- if show_cluster_hint - if show_cluster_hint
......
---
title: Adds keyboard shortcut `g e` for Environments on Project pages
merge_request: 19002
author:
type: added
---
title: Adds keyboard shortcut `g k` for Kubernetes on Project pages
merge_request: 19002
author:
type: added
---
title: Changes keyboard shortcut of Activity feed to `g v`
merge_request: 19002
author:
type: changed
---
title: Removes outdated `g t` shortcut for TODO in favor of `Shift+T`
merge_request: 19002
author:
type: removed
...@@ -46,15 +46,19 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?' ...@@ -46,15 +46,19 @@ 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>v</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>j</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>d</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>b</kbd> | Go to issue boards |
| <kbd>g</kbd> + <kbd>m</kbd> | Go to merge requests | | <kbd>g</kbd> + <kbd>m</kbd> | Go to merge requests |
| <kbd>g</kbd> + <kbd>e</kbd> | Go to environments |
| <kbd>g</kbd> + <kbd>k</kbd> | Go to kubernetes |
| <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets | | <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets |
| <kbd>g</kbd> + <kbd>w</kbd> | Go to wiki |
| <kbd>t</kbd> | Go to finding file | | <kbd>t</kbd> | Go to finding file |
| <kbd>i</kbd> | New issue | | <kbd>i</kbd> | New issue |
......
...@@ -13,6 +13,8 @@ describe 'User uses shortcuts', :js do ...@@ -13,6 +13,8 @@ describe 'User uses shortcuts', :js do
context 'when navigating to the Project pages' do context 'when navigating to the Project pages' do
it 'redirects to the details page' do it 'redirects to the details page' do
visit project_issues_path(project)
find('body').native.send_key('g') find('body').native.send_key('g')
find('body').native.send_key('p') find('body').native.send_key('p')
...@@ -22,7 +24,7 @@ describe 'User uses shortcuts', :js do ...@@ -22,7 +24,7 @@ describe 'User uses shortcuts', :js do
it 'redirects to the activity page' do it 'redirects to the activity page' do
find('body').native.send_key('g') find('body').native.send_key('g')
find('body').native.send_key('e') find('body').native.send_key('v')
expect(page).to have_active_navigation('Project') expect(page).to have_active_navigation('Project')
expect(page).to have_active_sub_navigation('Activity') expect(page).to have_active_sub_navigation('Activity')
...@@ -72,10 +74,19 @@ describe 'User uses shortcuts', :js do ...@@ -72,10 +74,19 @@ describe 'User uses shortcuts', :js do
expect(page).to have_active_sub_navigation('List') expect(page).to have_active_sub_navigation('List')
end end
it 'redirects to the issue board page' do
find('body').native.send_key('g')
find('body').native.send_key('b')
expect(page).to have_active_navigation('Issues')
expect(page).to have_active_sub_navigation('Board')
end
it 'redirects to the new issue page' do it 'redirects to the new issue page' do
find('body').native.send_key('i') find('body').native.send_key('i')
expect(page).to have_content(project.title) expect(page).to have_content(project.title)
expect(page).to have_content('New Issue')
end end
end end
...@@ -88,6 +99,34 @@ describe 'User uses shortcuts', :js do ...@@ -88,6 +99,34 @@ describe 'User uses shortcuts', :js do
end end
end end
context 'when navigating to the CI / CD pages' do
it 'redirects to the Jobs page' do
find('body').native.send_key('g')
find('body').native.send_key('j')
expect(page).to have_active_navigation('CI / CD')
expect(page).to have_active_sub_navigation('Jobs')
end
end
context 'when navigating to the Operations pages' do
it 'redirects to the Environments page' do
find('body').native.send_key('g')
find('body').native.send_key('e')
expect(page).to have_active_navigation('Operations')
expect(page).to have_active_sub_navigation('Environments')
end
it 'redirects to the Kubernetes page' do
find('body').native.send_key('g')
find('body').native.send_key('k')
expect(page).to have_active_navigation('Operations')
expect(page).to have_active_sub_navigation('Kubernetes')
end
end
context 'when navigating to the Snippets pages' do context 'when navigating to the Snippets pages' do
it 'redirects to the snippets page' do it 'redirects to the snippets page' do
find('body').native.send_key('g') find('body').native.send_key('g')
......
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