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
57c72455
Commit
57c72455
authored
Jan 23, 2015
by
Chulki Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add api version property on hipchat service
parent
bb8c1cad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/controllers/projects/services_controller.rb
app/controllers/projects/services_controller.rb
+1
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+4
-2
No files found.
app/controllers/projects/services_controller.rb
View file @
57c72455
class
Projects::ServicesController
<
Projects
::
ApplicationController
ALLOWED_PARAMS
=
[
:title
,
:token
,
:type
,
:active
,
:api_key
,
:subdomain
,
ALLOWED_PARAMS
=
[
:title
,
:token
,
:type
,
:active
,
:api_key
,
:
api_version
,
:
subdomain
,
:room
,
:recipients
,
:project_url
,
:webhook
,
:user_key
,
:device
,
:priority
,
:sound
,
:bamboo_url
,
:username
,
:password
,
:build_key
,
:server
,
:teamcity_url
,
:build_type
,
...
...
app/models/project_services/hipchat_service.rb
View file @
57c72455
...
...
@@ -20,7 +20,7 @@
class
HipchatService
<
Service
MAX_COMMITS
=
3
prop_accessor
:token
,
:room
,
:server
,
:notify
,
:color
prop_accessor
:token
,
:room
,
:server
,
:notify
,
:color
,
:api_version
validates
:token
,
presence:
true
,
if: :activated?
def
title
...
...
@@ -41,6 +41,8 @@ class HipchatService < Service
{
type:
'text'
,
name:
'room'
,
placeholder:
'Room name or ID'
},
{
type:
'checkbox'
,
name:
'notify'
},
{
type:
'select'
,
name:
'color'
,
choices:
[
'yellow'
,
'red'
,
'green'
,
'purple'
,
'gray'
,
'random'
]
},
{
type:
'text'
,
name:
'api_version'
,
placeholder:
'Leave blank for default (v2)'
},
{
type:
'text'
,
name:
'server'
,
placeholder:
'Leave blank for default. https://hipchat.example.com'
}
]
...
...
@@ -60,7 +62,7 @@ class HipchatService < Service
private
def
gate
options
=
{
api_version:
'v2'
}
options
=
{
api_version:
api_version
||
'v2'
}
options
[
:server_url
]
=
server
unless
server
.
blank?
@gate
||=
HipChat
::
Client
.
new
(
token
,
options
)
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