Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
57abb1cd
Commit
57abb1cd
authored
Dec 09, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue sidebar keyboard shortcuts
Changelog: fixed
parent
f4224c41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
1 deletion
+90
-1
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
...ets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
+4
-1
spec/features/issuables/shortcuts_issuable_spec.rb
spec/features/issuables/shortcuts_issuable_spec.rb
+86
-0
No files found.
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
View file @
57abb1cd
...
...
@@ -118,7 +118,10 @@ export default class ShortcutsIssuable extends Shortcuts {
// Wait for the sidebar to trigger('click') open
// so it doesn't cause our dropdown to close preemptively
setTimeout
(()
=>
{
document
.
querySelector
(
`.block.
${
name
}
.shortcut-sidebar-dropdown-toggle`
).
click
();
const
editBtn
=
document
.
querySelector
(
`.block.
${
name
}
.shortcut-sidebar-dropdown-toggle`
)
||
document
.
querySelector
(
`.block.
${
name
}
.edit-link`
);
editBtn
.
click
();
},
DEBOUNCE_DROPDOWN_DELAY
);
return
false
;
}
...
...
spec/features/issuables/shortcuts_issuable_spec.rb
View file @
57abb1cd
...
...
@@ -44,4 +44,90 @@ RSpec.describe 'Blob shortcuts', :js do
include_examples
'quotes the selected text'
end
end
shared_examples
"opens assignee dropdown for editing"
do
it
"opens assignee dropdown for editing"
do
find
(
'body'
).
native
.
send_key
(
'a'
)
expect
(
find
(
'.block.assignee'
)).
to
have_selector
(
'.js-sidebar-assignee-data'
)
end
end
describe
'pressing "a"'
do
describe
'On an Issue'
do
before
do
stub_feature_flags
(
issue_assignees_widget:
false
)
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
end
include_examples
'opens assignee dropdown for editing'
end
describe
'On a Merge Request'
do
before
do
stub_feature_flags
(
issue_assignees_widget:
false
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
include_examples
'opens assignee dropdown for editing'
end
end
shared_examples
"opens milestones dropdown for editing"
do
it
"opens milestones dropdown for editing"
do
find
(
'body'
).
native
.
send_key
(
'm'
)
expect
(
find
(
'[data-testid="milestone-edit"]'
)).
to
have_selector
(
'.gl-new-dropdown-inner'
)
end
end
describe
'pressing "m"'
do
describe
'On an Issue'
do
before
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
end
include_examples
'opens milestones dropdown for editing'
end
describe
'On a Merge Request'
do
before
do
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
include_examples
'opens milestones dropdown for editing'
end
end
shared_examples
"opens labels dropdown for editing"
do
it
"opens labels dropdown for editing"
do
find
(
'body'
).
native
.
send_key
(
'l'
)
expect
(
find
(
'.js-labels-block'
)).
to
have_selector
(
'[data-testid="labels-select-dropdown-contents"]'
)
end
end
describe
'pressing "l"'
do
describe
'On an Issue'
do
before
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
end
include_examples
'opens labels dropdown for editing'
end
describe
'On a Merge Request'
do
before
do
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
include_examples
'opens labels dropdown for editing'
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment