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
Boxiang Sun
gitlab-ce
Commits
69486116
Commit
69486116
authored
Dec 19, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Present all pipeline triggers using trigger presenter
parent
4d7f9351
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+2
-0
app/models/ci/trigger.rb
app/models/ci/trigger.rb
+1
-1
lib/api/triggers.rb
lib/api/triggers.rb
+3
-3
No files found.
app/controllers/projects/settings/ci_cd_controller.rb
View file @
69486116
...
@@ -99,7 +99,9 @@ module Projects
...
@@ -99,7 +99,9 @@ module Projects
def
define_triggers_variables
def
define_triggers_variables
@triggers
=
@project
.
triggers
@triggers
=
@project
.
triggers
.
present
(
current_user:
current_user
)
@trigger
=
::
Ci
::
Trigger
.
new
@trigger
=
::
Ci
::
Trigger
.
new
.
present
(
current_user:
current_user
)
end
end
def
define_badges_variables
def
define_badges_variables
...
...
app/models/ci/trigger.rb
View file @
69486116
...
@@ -30,7 +30,7 @@ module Ci
...
@@ -30,7 +30,7 @@ module Ci
end
end
def
short_token
def
short_token
token
[
0
...
4
]
token
[
0
...
4
]
if
token
.
present?
end
end
def
legacy?
def
legacy?
...
...
lib/api/triggers.rb
View file @
69486116
...
@@ -85,7 +85,7 @@ module API
...
@@ -85,7 +85,7 @@ module API
declared_params
(
include_missing:
false
).
merge
(
owner:
current_user
))
declared_params
(
include_missing:
false
).
merge
(
owner:
current_user
))
if
trigger
.
valid?
if
trigger
.
valid?
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
else
render_validation_error!
(
trigger
)
render_validation_error!
(
trigger
)
end
end
...
@@ -106,7 +106,7 @@ module API
...
@@ -106,7 +106,7 @@ module API
break
not_found!
(
'Trigger'
)
unless
trigger
break
not_found!
(
'Trigger'
)
unless
trigger
if
trigger
.
update
(
declared_params
(
include_missing:
false
))
if
trigger
.
update
(
declared_params
(
include_missing:
false
))
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
else
render_validation_error!
(
trigger
)
render_validation_error!
(
trigger
)
end
end
...
@@ -127,7 +127,7 @@ module API
...
@@ -127,7 +127,7 @@ module API
if
trigger
.
update
(
owner:
current_user
)
if
trigger
.
update
(
owner:
current_user
)
status
:ok
status
:ok
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
else
render_validation_error!
(
trigger
)
render_validation_error!
(
trigger
)
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