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
aff5f1f2
Commit
aff5f1f2
authored
Apr 06, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to re-use existing methods
Instead of introducing new ones
parent
abaf1ec4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
11 deletions
+3
-11
app/helpers/services_helper.rb
app/helpers/services_helper.rb
+1
-9
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+1
-1
app/views/projects/services/alerts/_help.html.haml
app/views/projects/services/alerts/_help.html.haml
+1
-1
No files found.
app/helpers/services_helper.rb
View file @
aff5f1f2
# frozen_string_literal: true
module
ServicesHelper
def
service_form_url
(
service
,
project:
nil
)
if
project
.
present?
project_service_path
(
project
,
service
.
to_param
)
else
admin_application_settings_integration_path
(
service
.
to_param
)
end
end
def
service_event_description
(
event
)
case
event
when
"push"
,
"push_events"
...
...
@@ -82,7 +74,7 @@ module ServicesHelper
def
scoped_integration_path
(
integration
)
if
@project
.
present?
project_se
ttings_integration
_path
(
@project
,
integration
)
project_se
rvice
_path
(
@project
,
integration
)
elsif
@group
.
present?
group_settings_integration_path
(
@group
,
integration
)
else
...
...
app/views/projects/services/_form.html.haml
View file @
aff5f1f2
...
...
@@ -10,7 +10,7 @@
-
if
@service
.
respond_to?
(
:detailed_description
)
%p
=
@service
.
detailed_description
.col-lg-9
=
form_for
(
@service
,
as: :service
,
url:
s
ervice_form_url
(
@service
,
project:
@project
),
method: :put
,
html:
{
class:
'gl-show-field-errors integration-settings-form js-integration-settings-form'
,
data:
{
'can-test'
=>
@service
.
can_test?
,
'test-url'
=>
test_project_service_path
(
@project
,
@service
)
}
})
do
|
form
|
=
form_for
(
@service
,
as: :service
,
url:
s
coped_integration_path
(
@service
),
method: :put
,
html:
{
class:
'gl-show-field-errors integration-settings-form js-integration-settings-form'
,
data:
{
'can-test'
=>
@service
.
can_test?
,
'test-url'
=>
test_project_service_path
(
@project
,
@service
)
}
})
do
|
form
|
=
render
'shared/service_settings'
,
form:
form
,
service:
@service
-
if
@service
.
editable?
.footer-block.row-content-block
...
...
app/views/projects/services/alerts/_help.html.haml
View file @
aff5f1f2
.js-alerts-service-settings
{
data:
{
activated:
@service
.
activated?
.
to_s
,
form_path:
s
ervice_form_url
(
@service
,
project:
@project
),
form_path:
s
coped_integration_path
(
@service
),
authorization_key:
@service
.
token
,
url:
@service
.
url
,
learn_more_url:
'https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html'
}
}
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