BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b5343c30
Commit
b5343c30
authored
Nov 22, 2017
by
Clement Ho
Committed by
Oswaldo Ferreira
Nov 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '40295-fix-reply-quote-shortcut-on-mr' into 'master'
Fix reply quote keyboard shortcut on MRs Closes #40295 See merge request gitlab-org/gitlab-ce!15523 (cherry picked from commit
5083e0cf
)
59502122
Fix reply quote keyboard shortcut on MRs
parent
c6f5f8f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
1 deletion
+55
-1
dispatcher.js
app/assets/javascripts/dispatcher.js
+2
-1
shortcuts_issuable_spec.rb
spec/features/issuables/shortcuts_issuable_spec.rb
+46
-0
spec_helper.rb
spec/spec_helper.rb
+1
-0
selection_helper.rb
spec/support/selection_helper.rb
+6
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
b5343c30
...
...
@@ -317,7 +317,6 @@ import Diff from './diff';
break
;
case
'projects:merge_requests:show'
:
new
Diff
();
shortcut_handler
=
new
ShortcutsIssuable
(
true
);
new
ZenMode
();
initIssuableSidebar
();
...
...
@@ -327,6 +326,8 @@ import Diff from './diff';
window
.
mergeRequest
=
new
MergeRequest
({
action
:
mrShowNode
.
dataset
.
mrAction
,
});
shortcut_handler
=
new
ShortcutsIssuable
(
true
);
break
;
case
'dashboard:activity'
:
new
gl
.
Activities
();
...
...
spec/features/issuables/shortcuts_issuable_spec.rb
0 → 100644
View file @
b5343c30
require
'spec_helper'
feature
'Blob shortcuts'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:note_text
)
{
'I got this!'
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
describe
'pressing "r"'
do
describe
'On an Issue'
do
before
do
create
(
:note
,
noteable:
issue
,
project:
project
,
note:
note_text
)
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
end
it
'quotes the selected text'
do
select_element
(
'.note-text'
)
find
(
'body'
).
native
.
send_key
(
'r'
)
expect
(
find
(
'.js-main-target-form .js-vue-comment-form'
).
value
).
to
include
(
note_text
)
end
end
describe
'On a Merge Request'
do
before
do
create
(
:note
,
noteable:
merge_request
,
project:
project
,
note:
note_text
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
it
'quotes the selected text'
do
select_element
(
'.note-text'
)
find
(
'body'
).
native
.
send_key
(
'r'
)
expect
(
find
(
'.js-main-target-form #note_note'
).
value
).
to
include
(
note_text
)
end
end
end
end
spec/spec_helper.rb
View file @
b5343c30
...
...
@@ -50,6 +50,7 @@ RSpec.configure do |config|
config
.
include
SearchHelpers
,
type: :feature
config
.
include
CookieHelper
,
:js
config
.
include
InputHelper
,
:js
config
.
include
SelectionHelper
,
:js
config
.
include
InspectRequests
,
:js
config
.
include
WaitForRequests
,
:js
config
.
include
LiveDebugger
,
:js
...
...
spec/support/selection_helper.rb
0 → 100644
View file @
b5343c30
module
SelectionHelper
def
select_element
(
selector
)
find
(
selector
)
execute_script
(
"let range = document.createRange(); let sel = window.getSelection(); range.selectNodeContents(document.querySelector('
#{
selector
}
')); sel.addRange(range);"
)
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