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
91b17b06
Commit
91b17b06
authored
Jul 12, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate related issue reference inserted when using autocomplete
Fix
https://gitlab.com/gitlab-org/gitlab-ee/issues/2914
parent
8bd15968
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
app/assets/javascripts/issuable/related_issues/components/add_issuable_form.vue
.../issuable/related_issues/components/add_issuable_form.vue
+2
-2
spec/javascripts/issuable/related_issues/components/add_issuable_form_spec.js
...uable/related_issues/components/add_issuable_form_spec.js
+26
-0
No files found.
app/assets/javascripts/issuable/related_issues/components/add_issuable_form.vue
View file @
91b17b06
...
...
@@ -85,12 +85,12 @@ export default {
mounted
()
{
const
$input
=
$
(
this
.
$refs
.
input
);
new
GfmAutoComplete
(
this
.
autoCompleteSources
).
setup
(
$input
,
{
this
.
gfmAutoComplete
=
new
GfmAutoComplete
(
this
.
autoCompleteSources
);
this
.
gfmAutoComplete
.
setup
(
$input
,
{
issues
:
true
,
});
$input
.
on
(
'
shown-issues.atwho
'
,
this
.
onAutoCompleteToggled
.
bind
(
this
,
true
));
$input
.
on
(
'
hidden-issues.atwho
'
,
this
.
onAutoCompleteToggled
.
bind
(
this
,
false
));
$input
.
on
(
'
inserted-issues.atwho
'
,
this
.
onInput
);
this
.
$refs
.
input
.
focus
();
},
...
...
spec/javascripts/issuable/related_issues/components/add_issuable_form_spec.js
View file @
91b17b06
...
...
@@ -198,6 +198,32 @@ describe('AddIssuableForm', () => {
});
});
it
(
'
when using the autocomplete
'
,
(
done
)
=>
{
const
$input
=
$
(
vm
.
$refs
.
input
);
vm
.
gfmAutoComplete
.
loadData
(
$input
,
'
#
'
,
[{
id
:
1
,
iid
:
111
,
title
:
'
foo
'
,
}]);
$input
.
val
(
'
#
'
)
.
trigger
(
'
input
'
)
.
trigger
(
'
click
'
);
$
(
'
.atwho-container li
'
).
trigger
(
'
click
'
);
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$refs
.
input
.
value
).
toEqual
(
''
);
expect
(
addIssuableFormInputSpy
.
calls
.
count
()).
toEqual
(
1
);
done
();
});
});
});
it
(
'
when submitting pending issues
'
,
()
=>
{
expect
(
addIssuableFormSubmitSpy
).
not
.
toHaveBeenCalled
();
...
...
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