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
Léo-Paul Géneau
gitlab-ce
Commits
71e6a93d
Commit
71e6a93d
authored
Dec 11, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change default values
parent
e3657501
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
11 deletions
+29
-11
app/models/project_services/builds_email_service.rb
app/models/project_services/builds_email_service.rb
+6
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+6
-1
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+11
-7
app/models/project_services/slack_service.rb
app/models/project_services/slack_service.rb
+6
-1
app/models/service.rb
app/models/service.rb
+0
-1
No files found.
app/models/project_services/builds_email_service.rb
View file @
71e6a93d
...
@@ -24,7 +24,12 @@ class BuildsEmailService < Service
...
@@ -24,7 +24,12 @@ class BuildsEmailService < Service
boolean_accessor
:notify_only_broken_builds
boolean_accessor
:notify_only_broken_builds
validates
:recipients
,
presence:
true
,
if: :activated?
validates
:recipients
,
presence:
true
,
if: :activated?
default_value_for
:notify_only_broken_builds
,
true
def
initialize_properties
if
properties
.
nil?
self
.
properties
=
{}
self
.
notify_only_broken_builds
=
true
end
end
def
title
def
title
'Builds emails'
'Builds emails'
...
...
app/models/project_services/hipchat_service.rb
View file @
71e6a93d
...
@@ -25,7 +25,12 @@ class HipchatService < Service
...
@@ -25,7 +25,12 @@ class HipchatService < Service
boolean_accessor
:notify_only_broken_builds
boolean_accessor
:notify_only_broken_builds
validates
:token
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
default_value_for
:notify_only_broken_builds
,
true
def
initialize_properties
if
properties
.
nil?
self
.
properties
=
{}
self
.
notify_only_broken_builds
=
true
end
end
def
title
def
title
'HipChat'
'HipChat'
...
...
app/models/project_services/issue_tracker_service.rb
View file @
71e6a93d
...
@@ -56,12 +56,16 @@ class IssueTrackerService < Service
...
@@ -56,12 +56,16 @@ class IssueTrackerService < Service
end
end
def
initialize_properties
def
initialize_properties
if
new_record
?
if
properties
.
nil
?
if
enabled_in_gitlab_config
if
enabled_in_gitlab_config
self
.
title
=
issues_tracker
[
'title'
]
self
.
properties
=
{
self
.
project_url
=
add_issues_tracker_id
(
issues_tracker
[
'project_url'
])
title:
issues_tracker
[
'title'
],
self
.
issues_url
=
add_issues_tracker_id
(
issues_tracker
[
'issues_url'
])
project_url:
add_issues_tracker_id
(
issues_tracker
[
'project_url'
]),
self
.
new_issue_url
=
add_issues_tracker_id
(
issues_tracker
[
'new_issue_url'
])
issues_url:
add_issues_tracker_id
(
issues_tracker
[
'issues_url'
]),
new_issue_url:
add_issues_tracker_id
(
issues_tracker
[
'new_issue_url'
])
}
else
self
.
properties
=
{}
end
end
end
end
end
end
...
...
app/models/project_services/slack_service.rb
View file @
71e6a93d
...
@@ -23,7 +23,12 @@ class SlackService < Service
...
@@ -23,7 +23,12 @@ class SlackService < Service
boolean_accessor
:notify_only_broken_builds
boolean_accessor
:notify_only_broken_builds
validates
:webhook
,
presence:
true
,
if: :activated?
validates
:webhook
,
presence:
true
,
if: :activated?
default_value_for
:notify_only_broken_builds
,
true
def
initialize_properties
if
properties
.
nil?
self
.
properties
=
{}
self
.
notify_only_broken_builds
=
true
end
end
def
title
def
title
'Slack'
'Slack'
...
...
app/models/service.rb
View file @
71e6a93d
...
@@ -31,7 +31,6 @@ class Service < ActiveRecord::Base
...
@@ -31,7 +31,6 @@ class Service < ActiveRecord::Base
default_value_for
:tag_push_events
,
true
default_value_for
:tag_push_events
,
true
default_value_for
:note_events
,
true
default_value_for
:note_events
,
true
default_value_for
:build_events
,
true
default_value_for
:build_events
,
true
default_value_for
:properties
,
{}
after_initialize
:initialize_properties
after_initialize
:initialize_properties
...
...
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