Commit 001a28d0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dz-plugins-project-integrations' into 'master'

Show plugins list on system hooks page

Closes #40812

See merge request gitlab-org/gitlab-ce!17518
parents 4a341c6d 30b76e4b
= form_errors(hook) = form_errors(hook)
.form-group .form-group
= form.label :url, 'URL', class: 'control-label' = form.label :url, 'URL', class: 'label-light'
.col-sm-10
= form.text_field :url, class: 'form-control' = form.text_field :url, class: 'form-control'
.form-group .form-group
= form.label :token, 'Secret Token', class: 'control-label' = form.label :token, 'Secret Token', class: 'label-light'
.col-sm-10
= form.text_field :token, class: 'form-control' = form.text_field :token, class: 'form-control'
%p.help-block %p.help-block
Use this token to validate received payloads Use this token to validate received payloads
.form-group .form-group
= form.label :url, 'Trigger', class: 'control-label' = form.label :url, 'Trigger', class: 'label-light'
.col-sm-10.prepend-top-10 %ul.list-unstyled
%div %li
.help-block
System hook will be triggered on set of events like creating project System hook will be triggered on set of events like creating project
or adding ssh key. But you can also enable extra triggers like Push events. or adding ssh key. But you can also enable extra triggers like Push events.
...@@ -24,21 +23,21 @@ ...@@ -24,21 +23,21 @@
%strong Repository update events %strong Repository update events
%p.light %p.light
This URL will be triggered when repository is updated This URL will be triggered when repository is updated
%div %li
= form.check_box :push_events, class: 'pull-left' = form.check_box :push_events, class: 'pull-left'
.prepend-left-20 .prepend-left-20
= form.label :push_events, class: 'list-label' do = form.label :push_events, class: 'list-label' do
%strong Push events %strong Push events
%p.light %p.light
This URL will be triggered for each branch updated to the repository This URL will be triggered for each branch updated to the repository
%div %li
= form.check_box :tag_push_events, class: 'pull-left' = form.check_box :tag_push_events, class: 'pull-left'
.prepend-left-20 .prepend-left-20
= form.label :tag_push_events, class: 'list-label' do = form.label :tag_push_events, class: 'list-label' do
%strong Tag push events %strong Tag push events
%p.light %p.light
This URL will be triggered when a new tag is pushed to the repository This URL will be triggered when a new tag is pushed to the repository
%div %li
= form.check_box :merge_requests_events, class: 'pull-left' = form.check_box :merge_requests_events, class: 'pull-left'
.prepend-left-20 .prepend-left-20
= form.label :merge_requests_events, class: 'list-label' do = form.label :merge_requests_events, class: 'list-label' do
...@@ -46,8 +45,7 @@ ...@@ -46,8 +45,7 @@
%p.light %p.light
This URL will be triggered when a merge request is created/updated/merged This URL will be triggered when a merge request is created/updated/merged
.form-group .form-group
= form.label :enable_ssl_verification, 'SSL verification', class: 'control-label checkbox' = form.label :enable_ssl_verification, 'SSL verification', class: 'label-light checkbox'
.col-sm-10
.checkbox .checkbox
= form.label :enable_ssl_verification do = form.label :enable_ssl_verification do
= form.check_box :enable_ssl_verification = form.check_box :enable_ssl_verification
......
- page_title 'System Hooks' - page_title 'System Hooks'
%h3.page-title .row.prepend-top-default
System hooks .col-lg-4
%h4.prepend-top-0
%p.light = page_title
%p
#{link_to 'System hooks ', help_page_path('system_hooks/system_hooks'), class: 'vlink'} can be #{link_to 'System hooks ', help_page_path('system_hooks/system_hooks'), class: 'vlink'} can be
used for binding events when GitLab creates a User or Project. used for binding events when GitLab creates a User or Project.
%hr .col-lg-8.append-bottom-default
= form_for @hook, as: :hook, url: admin_hooks_path do |f|
= form_for @hook, as: :hook, url: admin_hooks_path, html: { class: 'form-horizontal' } do |f|
= render partial: 'form', locals: { form: f, hook: @hook } = render partial: 'form', locals: { form: f, hook: @hook }
.form-actions
= f.submit 'Add system hook', class: 'btn btn-create' = f.submit 'Add system hook', class: 'btn btn-create'
%hr
- if @hooks.any? %hr
- if @hooks.any?
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
System hooks (#{@hooks.count}) System hooks (#{@hooks.count})
...@@ -31,3 +31,5 @@ ...@@ -31,3 +31,5 @@
- if hook.public_send(event) - if hook.public_send(event)
%span.label.label-gray= event.to_s.titleize %span.label.label-gray= event.to_s.titleize
%span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'} %span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'}
= render 'shared/plugins/index'
- plugins = Gitlab::Plugin.files
.row.prepend-top-default
.col-lg-4
%h4.prepend-top-0
Plugins
%p
#{link_to 'Plugins', help_page_path('administration/plugins')} are similar to
system hooks but are executed as files instead of sending data to a URL.
.col-lg-8.append-bottom-default
- if plugins.any?
.panel.panel-default
.panel-heading
Plugins (#{plugins.count})
%ul.content-list
- plugins.each do |file|
%li
.monospace
= File.basename(file)
- else
%p.light-well.text-center
No plugins found.
---
title: Add plugins list to the system hooks page
merge_request: 17518
author:
type: added
...@@ -24,6 +24,16 @@ describe 'Admin::Hooks' do ...@@ -24,6 +24,16 @@ describe 'Admin::Hooks' do
visit admin_hooks_path visit admin_hooks_path
expect(page).to have_content(system_hook.url) expect(page).to have_content(system_hook.url)
end end
it 'renders plugins list as well' do
allow(Gitlab::Plugin).to receive(:files).and_return(['foo.rb', 'bar.clj'])
visit admin_hooks_path
expect(page).to have_content('Plugins')
expect(page).to have_content('foo.rb')
expect(page).to have_content('bar.clj')
end
end end
describe 'New Hook' do describe 'New Hook' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment