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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
a9f85d11
Commit
a9f85d11
authored
Dec 21, 2016
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix space issue and add test
parent
09b622f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
app/assets/javascripts/gfm_auto_complete.js.es6
app/assets/javascripts/gfm_auto_complete.js.es6
+0
-6
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+16
-11
No files found.
app/assets/javascripts/gfm_auto_complete.js.es6
View file @
a9f85d11
...
@@ -112,7 +112,6 @@
...
@@ -112,7 +112,6 @@
return value.path != null ? this.Emoji.template : this.Loading.template;
return value.path != null ? this.Emoji.template : this.Loading.template;
}.bind(this),
}.bind(this),
insertTpl: ':${name}:',
insertTpl: ':${name}:',
startWithSpace: false,
skipSpecialCharacterTest: true,
skipSpecialCharacterTest: true,
data: this.defaultLoadingData,
data: this.defaultLoadingData,
callbacks: {
callbacks: {
...
@@ -129,7 +128,6 @@
...
@@ -129,7 +128,6 @@
}.bind(this),
}.bind(this),
insertTpl: '${atwho-at}${username}',
insertTpl: '${atwho-at}${username}',
searchKey: 'search',
searchKey: 'search',
startWithSpace: false,
alwaysHighlightFirst: true,
alwaysHighlightFirst: true,
skipSpecialCharacterTest: true,
skipSpecialCharacterTest: true,
data: this.defaultLoadingData,
data: this.defaultLoadingData,
...
@@ -172,7 +170,6 @@
...
@@ -172,7 +170,6 @@
}.bind(this),
}.bind(this),
data: this.defaultLoadingData,
data: this.defaultLoadingData,
insertTpl: '${atwho-at}${id}',
insertTpl: '${atwho-at}${id}',
startWithSpace: false,
callbacks: {
callbacks: {
sorter: this.DefaultOptions.sorter,
sorter: this.DefaultOptions.sorter,
filter: this.DefaultOptions.filter,
filter: this.DefaultOptions.filter,
...
@@ -200,7 +197,6 @@
...
@@ -200,7 +197,6 @@
displayTpl: function(value) {
displayTpl: function(value) {
return value.title != null ? this.Milestones.template : this.Loading.template;
return value.title != null ? this.Milestones.template : this.Loading.template;
}.bind(this),
}.bind(this),
startWithSpace: false,
data: this.defaultLoadingData,
data: this.defaultLoadingData,
callbacks: {
callbacks: {
matcher: this.DefaultOptions.matcher,
matcher: this.DefaultOptions.matcher,
...
@@ -225,7 +221,6 @@
...
@@ -225,7 +221,6 @@
at: '!',
at: '!',
alias: 'mergerequests',
alias: 'mergerequests',
searchKey: 'search',
searchKey: 'search',
startWithSpace: false,
displayTpl: function(value) {
displayTpl: function(value) {
return value.title != null ? this.Issues.template : this.Loading.template;
return value.title != null ? this.Issues.template : this.Loading.template;
}.bind(this),
}.bind(this),
...
@@ -259,7 +254,6 @@
...
@@ -259,7 +254,6 @@
return this.isLoading(value) ? this.Loading.template : this.Labels.template;
return this.isLoading(value) ? this.Loading.template : this.Labels.template;
}.bind(this),
}.bind(this),
insertTpl: '${atwho-at}${title}',
insertTpl: '${atwho-at}${title}',
startWithSpace: false,
callbacks: {
callbacks: {
matcher: this.DefaultOptions.matcher,
matcher: this.DefaultOptions.matcher,
sorter: this.DefaultOptions.sorter,
sorter: this.DefaultOptions.sorter,
...
...
spec/features/issues/gfm_autocomplete_spec.rb
View file @
a9f85d11
...
@@ -39,7 +39,6 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -39,7 +39,6 @@ feature 'GFM autocomplete', feature: true, js: true do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
"~
#{
label
.
title
[
0
]
}
"
)
note
.
native
.
send_keys
(
"~
#{
label
.
title
[
0
]
}
"
)
sleep
1
note
.
click
note
.
click
end
end
...
@@ -53,7 +52,6 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -53,7 +52,6 @@ feature 'GFM autocomplete', feature: true, js: true do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
"@
#{
user
.
username
[
0
]
}
"
)
note
.
native
.
send_keys
(
"@
#{
user
.
username
[
0
]
}
"
)
sleep
1
note
.
click
note
.
click
end
end
...
@@ -67,7 +65,6 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -67,7 +65,6 @@ feature 'GFM autocomplete', feature: true, js: true do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
":cartwheel"
)
note
.
native
.
send_keys
(
":cartwheel"
)
sleep
1
note
.
click
note
.
click
end
end
...
@@ -76,6 +73,22 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -76,6 +73,22 @@ feature 'GFM autocomplete', feature: true, js: true do
expect_to_wrap
(
false
,
emoji_item
,
note
,
'cartwheel_tone1'
)
expect_to_wrap
(
false
,
emoji_item
,
note
,
'cartwheel_tone1'
)
end
end
it
'doesn\'t open autocomplete after non-word character'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note_note'
).
native
.
send_keys
(
"@
#{
user
.
username
[
0
..
2
]
}
!"
)
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
end
it
'doesn\'t open autocomplete if there is no space before'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note_note'
).
native
.
send_keys
(
"hello:
#{
user
.
username
[
0
..
2
]
}
"
)
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
end
def
expect_to_wrap
(
should_wrap
,
item
,
note
,
value
)
def
expect_to_wrap
(
should_wrap
,
item
,
note
,
value
)
expect
(
item
).
to
have_content
(
value
)
expect
(
item
).
to
have_content
(
value
)
expect
(
item
).
not_to
have_content
(
"
\"
#{
value
}
\"
"
)
expect
(
item
).
not_to
have_content
(
"
\"
#{
value
}
\"
"
)
...
@@ -89,12 +102,4 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -89,12 +102,4 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
end
end
end
end
it
'doesnt open autocomplete after non-word character'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note_note'
).
native
.
send_keys
(
"@
#{
user
.
username
[
0
..
2
]
}
!"
)
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
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