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
a3cfd4b4
Commit
a3cfd4b4
authored
Jun 21, 2018
by
Kushal Pandya
Committed by
Mark Chao
Jul 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `&` support for epics autocompletion
parent
499fb780
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+7
-0
ee/app/assets/javascripts/gfm_auto_complete_ee.js
ee/app/assets/javascripts/gfm_auto_complete_ee.js
+37
-0
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
a3cfd4b4
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
// EE-specific
import
setupAutoCompleteEpics
from
'
ee/gfm_auto_complete_ee
'
;
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
...
...
@@ -51,6 +55,9 @@ class GfmAutoComplete {
if
(
this
.
enableMap
.
mergeRequests
)
this
.
setupMergeRequests
(
$input
);
if
(
this
.
enableMap
.
labels
)
this
.
setupLabels
(
$input
);
// EE-specific
if
(
this
.
enableMap
.
epics
)
setupAutoCompleteEpics
(
$input
,
this
.
getDefaultCallbacks
());
// We don't instantiate the quick actions autocomplete for note and issue/MR edit forms
$input
.
filter
(
'
[data-supports-quick-actions="true"]
'
).
atwho
({
at
:
'
/
'
,
...
...
ee/app/assets/javascripts/gfm_auto_complete_ee.js
0 → 100644
View file @
a3cfd4b4
import
$
from
'
jquery
'
;
import
GfmAutoComplete
from
'
~/gfm_auto_complete
'
;
const
setupAutoCompleteEpics
=
(
$input
,
defaultCallbacks
)
=>
{
$input
.
atwho
({
at
:
'
&
'
,
alias
:
'
epics
'
,
searchKey
:
'
search
'
,
displayTpl
(
value
)
{
let
tmpl
=
GfmAutoComplete
.
Loading
.
template
;
if
(
value
.
title
!=
null
)
{
tmpl
=
GfmAutoComplete
.
Issues
.
template
;
}
return
tmpl
;
},
data
:
GfmAutoComplete
.
defaultLoadingData
,
// eslint-disable-next-line no-template-curly-in-string
insertTpl
:
'
${atwho-at}${id}
'
,
callbacks
:
{
...
defaultCallbacks
,
beforeSave
(
merges
)
{
return
$
.
map
(
merges
,
(
m
)
=>
{
if
(
m
.
title
==
null
)
{
return
m
;
}
return
{
id
:
m
.
iid
,
title
:
m
.
title
.
replace
(
/<
(?:
.|
\n)
*
?
>/gm
,
''
),
search
:
`
${
m
.
iid
}
${
m
.
title
}
`
,
};
});
},
},
});
};
export
default
setupAutoCompleteEpics
;
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