Commit 3d493cee authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issue-edit-shortcut' into 'master'

Fixed issue edit shortcut not working

Closes #43560

See merge request gitlab-org/gitlab-ce!17360
parents 78ed5c0f 34c79388
......@@ -9,13 +9,12 @@ export default class ShortcutsIssuable extends Shortcuts {
super();
this.$replyField = isMergeRequest ? $('.js-main-target-form #note_note') : $('.js-main-target-form .js-vue-comment-form');
this.editBtn = document.querySelector('.js-issuable-edit');
Mousetrap.bind('a', () => ShortcutsIssuable.openSidebarDropdown('assignee'));
Mousetrap.bind('m', () => ShortcutsIssuable.openSidebarDropdown('milestone'));
Mousetrap.bind('l', () => ShortcutsIssuable.openSidebarDropdown('labels'));
Mousetrap.bind('r', this.replyWithSelectedText.bind(this));
Mousetrap.bind('e', this.editIssue.bind(this));
Mousetrap.bind('e', ShortcutsIssuable.editIssue);
if (isMergeRequest) {
this.enabledHelp.push('.hidden-shortcut.merge_requests');
......@@ -58,10 +57,10 @@ export default class ShortcutsIssuable extends Shortcuts {
return false;
}
editIssue() {
static editIssue() {
// Need to click the element as on issues, editing is inline
// on merge request, editing is on a different page
this.editBtn.click();
document.querySelector('.js-issuable-edit').click();
return false;
}
......
---
title: Fixed issue edit shortcut not opening edit form
merge_request:
author:
type: fixed
......@@ -271,6 +271,18 @@ describe 'New/edit issue', :js do
end
end
context 'inline edit' do
before do
visit project_issue_path(project, issue)
end
it 'opens inline edit form with shortcut' do
find('body').send_keys('e')
expect(page).to have_selector('.detail-page-description form')
end
end
describe 'sub-group project' do
let(:group) { create(:group) }
let(:nested_group_1) { create(:group, parent: group) }
......
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