diff options
| author | Gabriel Mazetto <brodock@gmail.com> | 2017-05-05 14:11:28 +0200 |
|---|---|---|
| committer | Gabriel Mazetto <brodock@gmail.com> | 2017-05-12 23:26:48 +0100 |
| commit | 2e97db051ca52d464382df0c84562fbc5e67b956 (patch) | |
| tree | db050f0bb9cb9edb9031d62509ab9ef4278fbccf /app | |
| parent | f661980904f718440cc700b7d1f38ea8bf0e5480 (diff) | |
| download | gitlab-ce-2e97db051ca52d464382df0c84562fbc5e67b956.tar.gz | |
Make the new repository_update_events configurable in System Hooks UI
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/admin/hooks_controller.rb | 1 | ||||
| -rw-r--r-- | app/models/hooks/system_hook.rb | 3 | ||||
| -rw-r--r-- | app/views/admin/hooks/_form.html.haml | 9 | ||||
| -rw-r--r-- | app/views/admin/hooks/index.html.haml | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb index a119934febc..ccfe553c89e 100644 --- a/app/controllers/admin/hooks_controller.rb +++ b/app/controllers/admin/hooks_controller.rb @@ -60,6 +60,7 @@ class Admin::HooksController < Admin::ApplicationController :enable_ssl_verification, :push_events, :tag_push_events, + :repository_update_events, :token, :url ) diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index f97debb7113..c645805c6da 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -1,6 +1,9 @@ class SystemHook < WebHook scope :repository_update_hooks, -> { where(repository_update_events: true) } + default_value_for :push_events, false + default_value_for :repository_update_events, true + def async_execute(data, hook_name) Sidekiq::Client.enqueue(SystemHookWorker, id, data, hook_name) end diff --git a/app/views/admin/hooks/_form.html.haml b/app/views/admin/hooks/_form.html.haml index 6217d5fb135..7f7377b1da1 100644 --- a/app/views/admin/hooks/_form.html.haml +++ b/app/views/admin/hooks/_form.html.haml @@ -18,12 +18,19 @@ or adding ssh key. But you can also enable extra triggers like Push events. .prepend-top-default + = form.check_box :repository_update_events, class: 'pull-left' + .prepend-left-20 + = form.label :repository_update_events, class: 'list-label' do + %strong Repository update events + %p.light + This url will be triggered when repository is updated + %div = form.check_box :push_events, class: 'pull-left' .prepend-left-20 = form.label :push_events, class: 'list-label' do %strong Push events %p.light - This url will be triggered by a push to the repository + This url will be triggered for each branch updated to the repository %div = form.check_box :tag_push_events, class: 'pull-left' .prepend-left-20 diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 71117758921..43df8b62367 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -27,7 +27,7 @@ = link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm' .monospace= hook.url %div - - %w(push_events tag_push_events issues_events note_events merge_requests_events build_events).each do |trigger| + - %w(push_events tag_push_events issues_events note_events merge_requests_events build_events repository_update_events).each do |trigger| - if hook.send(trigger) %span.label.label-gray= trigger.titleize %span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'} |
