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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
386478d8
Commit
386478d8
authored
Jul 27, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move color-logic into HipchatService#HipchatService
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
255162e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+5
-1
No files found.
app/models/project_services/hipchat_service.rb
View file @
386478d8
...
@@ -68,7 +68,7 @@ class HipchatService < Service
...
@@ -68,7 +68,7 @@ class HipchatService < Service
end
end
def
message_options
(
data
=
nil
)
def
message_options
(
data
=
nil
)
{
notify:
notify
.
present?
&&
notify
==
'1'
,
color:
build_status_color
(
data
)
||
color
||
'yellow'
}
{
notify:
notify
.
present?
&&
notify
==
'1'
,
color:
message_color
(
data
)
}
end
end
def
create_message
(
data
)
def
create_message
(
data
)
...
@@ -240,6 +240,10 @@ class HipchatService < Service
...
@@ -240,6 +240,10 @@ class HipchatService < Service
"
#{
project_link
}
: Commit
#{
commit_link
}
of
#{
branch_link
}
#{
ref_type
}
by
#{
user_name
}
#{
humanized_status
(
status
)
}
in
#{
duration
}
second(s)"
"
#{
project_link
}
: Commit
#{
commit_link
}
of
#{
branch_link
}
#{
ref_type
}
by
#{
user_name
}
#{
humanized_status
(
status
)
}
in
#{
duration
}
second(s)"
end
end
def
message_color
(
data
)
build_status_color
(
data
)
||
color
||
'yellow'
end
def
build_status_color
(
data
)
def
build_status_color
(
data
)
return
unless
data
&&
data
[
:object_kind
]
==
'build'
return
unless
data
&&
data
[
:object_kind
]
==
'build'
...
...
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