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
cf41cf1f
Commit
cf41cf1f
authored
Jun 19, 2017
by
Clement Ho
Committed by
Eric Eastwood
Jun 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '33594-disable-autocomplete-on-snippet-comments' into 'master'
Disable autocomplete on snippets comments Closes #33594 See merge request !12108
parent
024c0f77
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
3 deletions
+56
-3
dispatcher.js
app/assets/javascripts/dispatcher.js
+12
-1
_zen.html.haml
app/views/projects/_zen.html.haml
+13
-0
_form.html.haml
app/views/shared/notes/_form.html.haml
+13
-0
_notes_with_form.html.haml
app/views/shared/notes/_notes_with_form.html.haml
+1
-1
snippets_spec.rb
spec/features/projects/snippets_spec.rb
+1
-1
notes_on_personal_snippets_spec.rb
spec/features/snippets/notes_on_personal_snippets_spec.rb
+16
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
cf41cf1f
...
...
@@ -80,7 +80,18 @@ import initSettingsPanels from './settings_panels';
path
=
page
.
split
(
':'
);
shortcut_handler
=
null
;
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
).
setup
();
$
(
'.js-gfm-input'
).
each
((
i
,
el
)
=>
{
const
gfm
=
new
GfmAutoComplete
(
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
);
const
enableGFM
=
gl
.
utils
.
convertPermissionToBoolean
(
el
.
dataset
.
supportsAutocomplete
);
gfm
.
setup
(
$
(
el
),
{
emojis
:
true
,
members
:
enableGFM
,
issues
:
enableGFM
,
milestones
:
enableGFM
,
mergeRequests
:
enableGFM
,
labels
:
enableGFM
,
});
});
function
initBlob
()
{
new
LineHighlighter
();
...
...
app/views/projects/_zen.html.haml
View file @
cf41cf1f
-
@gfm_form
=
true
-
current_text
||=
nil
<
<<<<<<
HEAD
-
supports_slash_commands
=
local_assigns
.
fetch
(
:supports_slash_commands
,
false
)
.zen-backdrop
-
classes
<<
' js-gfm-input js-autosize markdown-area'
-
if
defined?
(
f
)
&&
f
=
f
.
text_area
attr
,
class:
classes
,
placeholder:
placeholder
,
data:
{
supports_slash_commands:
supports_slash_commands
}
==
=====
-
supports_autocomplete
=
local_assigns
.
fetch
(
:supports_autocomplete
,
true
)
-
supports_quick_actions
=
local_assigns
.
fetch
(
:supports_quick_actions
,
false
)
.zen-backdrop
-
classes
<<
' js-gfm-input js-autosize markdown-area'
-
if
defined?
(
f
)
&&
f
=
f
.
text_area
attr
,
class:
classes
,
placeholder:
placeholder
,
data:
{
supports_quick_actions:
supports_quick_actions
,
supports_autocomplete:
supports_autocomplete
}
>
>>>>>> be2ea8f... Merge branch '33594-disable-autocomplete-on-snippet-comments' into 'master'
-
else
=
text_area_tag
attr
,
current_text
,
class:
classes
,
placeholder:
placeholder
%a
.zen-control.zen-control-leave.js-zen-leave
{
href:
"#"
}
...
...
app/views/shared/notes/_form.html.haml
View file @
cf41cf1f
<
<<<<<<
HEAD
-
supports_slash_commands
=
note_supports_slash_commands?
(
@note
)
-
if
supports_slash_commands
-
preview_url
=
preview_markdown_path
(
@project
,
slash_commands_target_type:
@note
.
noteable_type
,
slash_commands_target_id:
@note
.
noteable_id
)
==
=====
-
supports_autocomplete
=
local_assigns
.
fetch
(
:supports_autocomplete
,
true
)
-
supports_quick_actions
=
note_supports_quick_actions?
(
@note
)
-
if
supports_quick_actions
-
preview_url
=
preview_markdown_path
(
@project
,
quick_actions_target_type:
@note
.
noteable_type
,
quick_actions_target_id:
@note
.
noteable_id
)
>
>>>>>> be2ea8f... Merge branch '33594-disable-autocomplete-on-snippet-comments' into 'master'
-
else
-
preview_url
=
preview_markdown_path
(
@project
)
...
...
@@ -27,8 +34,14 @@
attr: :note
,
classes:
'note-textarea js-note-text'
,
placeholder:
"Write a comment or drag your files here..."
,
<<<<<<<
HEAD
supports_slash_commands: supports_slash_commands
=
render
'shared/notes/hints'
,
supports_slash_commands:
supports_slash_commands
==
=====
supports_quick_actions: supports_quick_actions,
supports_autocomplete: supports_autocomplete
=
render
'shared/notes/hints'
,
supports_quick_actions:
supports_quick_actions
>>>>>>> be2ea8f... Merge branch '33594-disable-autocomplete-on-snippet-comments' into 'master'
.error-alert
.note-form-actions.clearfix
...
...
app/views/shared/notes/_notes_with_form.html.haml
View file @
cf41cf1f
...
...
@@ -12,7 +12,7 @@
%a
.author_link
{
href:
user_path
(
current_user
)
}
=
image_tag
avatar_icon
(
current_user
),
alt:
current_user
.
to_reference
,
class:
'avatar s40'
.timeline-content.timeline-content-form
=
render
"shared/notes/form"
,
view:
diff_view
=
render
"shared/notes/form"
,
view:
diff_view
,
supports_autocomplete:
autocomplete
-
elsif
!
current_user
.disabled-comment.text-center.prepend-top-default
Please
...
...
spec/features/projects/snippets_spec.rb
View file @
cf41cf1f
require
'spec_helper'
describe
'Project snippets'
,
feature:
true
do
describe
'Project snippets'
,
:js
,
feature:
true
do
context
'when the project has snippets'
do
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let!
(
:snippets
)
{
create_list
(
:project_snippet
,
2
,
:public
,
author:
project
.
owner
,
project:
project
)
}
...
...
spec/features/snippets/notes_on_personal_snippets_spec.rb
View file @
cf41cf1f
...
...
@@ -70,6 +70,22 @@ describe 'Comments on personal snippets', :js, feature: true do
expect
(
find
(
'div#notes'
)).
to
have_content
(
'This is awesome!'
)
end
it
'should not have autocomplete'
do
wait_for_requests
request_count_before
=
page
.
driver
.
network_traffic
.
count
find
(
'#note_note'
).
native
.
send_keys
(
''
)
fill_in
'note[note]'
,
with:
'@'
wait_for_requests
request_count_after
=
page
.
driver
.
network_traffic
.
count
# This selector probably won't be in place even if autocomplete was enabled
# but we want to make sure
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
expect
(
request_count_before
).
to
eq
(
request_count_after
)
end
end
context
'when editing a note'
do
...
...
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