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
d23fbbc6
Commit
d23fbbc6
authored
Jul 21, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build noteables in AutocompleteSourcesController#target
parent
4779c43e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
app/controllers/projects/autocomplete_sources_controller.rb
app/controllers/projects/autocomplete_sources_controller.rb
+2
-2
app/services/projects/autocomplete_service.rb
app/services/projects/autocomplete_service.rb
+1
-9
No files found.
app/controllers/projects/autocomplete_sources_controller.rb
View file @
d23fbbc6
...
...
@@ -34,9 +34,9 @@ class Projects::AutocompleteSourcesController < Projects::ApplicationController
def
target
case
params
[
:type
]
&
.
downcase
when
'issue'
IssuesFinder
.
new
(
current_user
,
project_id:
@project
.
id
).
find_by
(
iid:
params
[
:type_id
])
IssuesFinder
.
new
(
current_user
,
project_id:
@project
.
id
).
find_by
(
iid:
params
[
:type_id
])
||
@project
.
issues
.
build
when
'mergerequest'
MergeRequestsFinder
.
new
(
current_user
,
project_id:
@project
.
id
).
find_by
(
iid:
params
[
:type_id
])
MergeRequestsFinder
.
new
(
current_user
,
project_id:
@project
.
id
).
find_by
(
iid:
params
[
:type_id
])
||
@project
.
merge_requests
.
build
when
'commit'
@project
.
commit
(
params
[
:type_id
])
end
...
...
app/services/projects/autocomplete_service.rb
View file @
d23fbbc6
...
...
@@ -47,15 +47,7 @@ module Projects
end
def
commands
(
noteable
,
type
)
noteable
||=
case
type
when
'Issue'
@project
.
issues
.
build
when
'MergeRequest'
@project
.
merge_requests
.
build
end
return
[]
unless
noteable
&
.
is_a?
(
Issuable
)
return
[]
unless
noteable
QuickActions
::
InterpretService
.
new
(
project
,
current_user
).
available_commands
(
noteable
)
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