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
fc18e96d
Commit
fc18e96d
authored
Nov 20, 2015
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor creation of system notes for Issue/MR labels. #2296
parent
97afb84b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
issuable_base_service.rb
app/services/issuable_base_service.rb
+7
-10
No files found.
app/services/issuable_base_service.rb
View file @
fc18e96d
...
@@ -53,15 +53,7 @@ class IssuableBaseService < BaseService
...
@@ -53,15 +53,7 @@ class IssuableBaseService < BaseService
if
params
.
present?
&&
issuable
.
update_attributes
(
params
.
merge
(
updated_by:
current_user
))
if
params
.
present?
&&
issuable
.
update_attributes
(
params
.
merge
(
updated_by:
current_user
))
issuable
.
reset_events_cache
issuable
.
reset_events_cache
handle_common_system_notes
(
issuable
,
old_labels:
old_labels
)
if
issuable
.
labels
!=
old_labels
create_labels_note
(
issuable
,
issuable
.
labels
-
old_labels
,
old_labels
-
issuable
.
labels
)
end
handle_common_system_notes
(
issuable
)
handle_changes
(
issuable
)
handle_changes
(
issuable
)
issuable
.
create_new_cross_references!
(
current_user
)
issuable
.
create_new_cross_references!
(
current_user
)
execute_hooks
(
issuable
,
'update'
)
execute_hooks
(
issuable
,
'update'
)
...
@@ -79,7 +71,7 @@ class IssuableBaseService < BaseService
...
@@ -79,7 +71,7 @@ class IssuableBaseService < BaseService
end
end
end
end
def
handle_common_system_notes
(
issuable
)
def
handle_common_system_notes
(
issuable
,
options
=
{}
)
if
issuable
.
previous_changes
.
include?
(
'title'
)
if
issuable
.
previous_changes
.
include?
(
'title'
)
create_title_change_note
(
issuable
,
issuable
.
previous_changes
[
'title'
].
first
)
create_title_change_note
(
issuable
,
issuable
.
previous_changes
[
'title'
].
first
)
end
end
...
@@ -87,5 +79,10 @@ class IssuableBaseService < BaseService
...
@@ -87,5 +79,10 @@ class IssuableBaseService < BaseService
if
issuable
.
previous_changes
.
include?
(
'description'
)
&&
issuable
.
tasks?
if
issuable
.
previous_changes
.
include?
(
'description'
)
&&
issuable
.
tasks?
create_task_status_note
(
issuable
)
create_task_status_note
(
issuable
)
end
end
old_labels
=
options
[
:old_labels
]
if
old_labels
&&
(
issuable
.
labels
!=
old_labels
)
create_labels_note
(
issuable
,
issuable
.
labels
-
old_labels
,
old_labels
-
issuable
.
labels
)
end
end
end
end
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