summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-07 04:02:19 +0900
committerKamil Trzcinski <ayufan@ayufan.eu>2017-04-07 16:17:27 +0200
commit2548c155eed13c806951a6303c85dbb0c5772ca3 (patch)
tree0df8ddb462937a6cb4043b2412442a099b2513a9 /app/controllers
parent7ccaa27f899dfbc96b23d98ee415b5daf80dd336 (diff)
downloadgitlab-ce-2548c155eed13c806951a6303c85dbb0c5772ca3.tar.gz
Add form for scheduled trigger
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/settings/ci_cd_controller.rb1
-rw-r--r--app/controllers/projects/triggers_controller.rb10
2 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb
index 6f009d61950..0ae4b4d3945 100644
--- a/app/controllers/projects/settings/ci_cd_controller.rb
+++ b/app/controllers/projects/settings/ci_cd_controller.rb
@@ -27,6 +27,7 @@ module Projects
def define_triggers_variables
@triggers = @project.triggers
@trigger = Ci::Trigger.new
+ @trigger.build_trigger_schedule
end
def define_badges_variables
diff --git a/app/controllers/projects/triggers_controller.rb b/app/controllers/projects/triggers_controller.rb
index c47198c5eb6..5ceeeb1c454 100644
--- a/app/controllers/projects/triggers_controller.rb
+++ b/app/controllers/projects/triggers_controller.rb
@@ -68,10 +68,16 @@ class Projects::TriggersController < Projects::ApplicationController
end
def create_params
- params.require(:trigger).permit(:description)
+ params.require(:trigger).permit(
+ :description, :ref, :trigger_schedule_on,
+ trigger_schedule_attributes: [ :cron, :cron_timezone ]
+ )
end
def update_params
- params.require(:trigger).permit(:description)
+ params.require(:trigger).permit(
+ :description, :ref, :trigger_schedule_on,
+ trigger_schedule_attributes: [ :cron, :cron_timezone ]
+ )
end
end