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
78681194
Commit
78681194
authored
Jan 07, 2019
by
Jarka Košanová
Committed by
Lin Jen-Shin
Jan 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename methods to make more sense
parent
330389ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
app/services/quick_actions/interpret_service.rb
app/services/quick_actions/interpret_service.rb
+13
-13
ee/spec/services/ee/notes/quick_actions_service_spec.rb
ee/spec/services/ee/notes/quick_actions_service_spec.rb
+1
-1
No files found.
app/services/quick_actions/interpret_service.rb
View file @
78681194
...
...
@@ -669,26 +669,24 @@ module QuickActions
end
def
parent
project
||
issuable_
group
project
||
group
end
def
issuable_
group
strong_memoize
(
:
issuable_
group
)
do
def
group
strong_memoize
(
:group
)
do
issuable
.
group
if
issuable
.
respond_to?
(
:group
)
end
end
def
find_labels
(
label
_reference
s
=
nil
)
labels
_params
=
{
include_ancestor_groups:
true
}
labels
_params
[
:project_id
]
=
project
.
id
if
project
labels_params
[
:group_id
]
=
issuable_group
.
id
if
issuable_
group
labels_params
[
:name
]
=
label_references
.
split
if
label_reference
s
def
find_labels
(
label
s_param
s
=
nil
)
finder
_params
=
{
include_ancestor_groups:
true
}
finder
_params
[
:project_id
]
=
project
.
id
if
project
finder_params
[
:group_id
]
=
group
.
id
if
group
finder_params
[
:name
]
=
labels_params
.
split
if
labels_param
s
result
=
LabelsFinder
.
new
(
current_user
,
labels
_params
).
execute
result
=
LabelsFinder
.
new
(
current_user
,
finder
_params
).
execute
return
result
unless
label_references
extract_references
(
label_references
,
:label
)
|
result
extract_references
(
labels_params
,
:label
)
|
result
end
def
find_label_references
(
labels_param
)
...
...
@@ -719,9 +717,11 @@ module QuickActions
# rubocop: disable CodeReuse/ActiveRecord
def
extract_references
(
arg
,
type
)
return
[]
unless
arg
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
project
,
current_user
)
ext
.
analyze
(
arg
,
author:
current_user
,
group:
issuable_
group
)
ext
.
analyze
(
arg
,
author:
current_user
,
group:
group
)
ext
.
references
(
type
)
end
...
...
ee/spec/services/ee/notes/quick_actions_service_spec.rb
View file @
78681194
...
...
@@ -198,7 +198,7 @@ describe Notes::QuickActionsService do
end
end
describe
'/label'
do
describe
'/
un
label'
do
let
(
:project
)
{
nil
}
let!
(
:bug
)
{
create
(
:group_label
,
title:
'bug'
,
group:
group
)}
let!
(
:feature
)
{
create
(
:group_label
,
title:
'feature'
,
group:
group
)}
...
...
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