Commit ba81c912 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'patch/wiki_page_events' into 'master'

Enable Wiki Page events from Webhook admin UI in a Project

* Added UI to enable page wiki events
* Documentation for this event in Webhooks page

Fixes #17506

--- 

![new_webhook_UI](/uploads/63ef24b4ccef13ac7a5fda83e9ce64ad/new_webhook_UI.png)

See merge request !4135
parents 9951243b ab17e4b7
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.9.0 (unreleased) v 8.9.0 (unreleased)
- Allow enabling wiki page events from Webhook management UI
- Allow forking projects with restricted visibility level - Allow forking projects with restricted visibility level
- Improve note validation to prevent errors when creating invalid note via API - Improve note validation to prevent errors when creating invalid note via API
- Redesign navigation for project pages - Redesign navigation for project pages
......
...@@ -63,7 +63,8 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -63,7 +63,8 @@ class Projects::HooksController < Projects::ApplicationController
:push_events, :push_events,
:tag_push_events, :tag_push_events,
:token, :token,
:url :url,
:wiki_page_events
) )
end end
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.col-md-8.col-lg-7 .col-md-8.col-lg-7
%strong.light-header= hook.url %strong.light-header= hook.url
%div %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 wiki_page_events).each do |trigger|
- if hook.send(trigger) - if hook.send(trigger)
%span.label.label-gray.deploy-project-label= trigger.titleize %span.label.label-gray.deploy-project-label= trigger.titleize
.col-md-4.col-lg-5.text-right-lg.prepend-top-5 .col-md-4.col-lg-5.text-right-lg.prepend-top-5
......
...@@ -64,6 +64,13 @@ ...@@ -64,6 +64,13 @@
Build events Build events
%p.light %p.light
This url will be triggered when the build status changes This url will be triggered when the build status changes
%div
= f.check_box :wiki_page_events, class: 'pull-left'
.prepend-left-20
= f.label :wiki_page_events, class: 'label-light append-bottom-0' do
Wiki Page events
%p.light
This url will be triggered when a wiki page is created/updated
.form-group .form-group
= f.label :enable_ssl_verification, "SSL verification", class: "label-light" = f.label :enable_ssl_verification, "SSL verification", class: "label-light"
%div %div
......
...@@ -695,6 +695,60 @@ X-Gitlab-Event: Merge Request Hook ...@@ -695,6 +695,60 @@ X-Gitlab-Event: Merge Request Hook
} }
``` ```
## Wiki Page events
Triggered when a wiki page is created or edited.
**Request Header**:
```
X-Gitlab-Event: Wiki Page Hook
```
**Request Body**:
```json
{
"object_kind": "wiki_page",
"user": {
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon"
},
"project": {
"name": "awesome-project",
"description": "This is awesome",
"web_url": "http://example.com/root/awesome-project",
"avatar_url": null,
"git_ssh_url": "git@example.com:root/test-project.git",
"git_http_url": "http://example.com/root/awesome-project.git",
"namespace": "root",
"visibility_level": 0,
"path_with_namespace": "root/awesome-project",
"default_branch": "master",
"homepage": "http://example.com/root/awesome-project",
"url": "git@example.com:root/awesome-project.git",
"ssh_url": "git@example.com:root/awesome-project.git",
"http_url": "http://example.com/root/awesome-project.git"
},
"object_attributes": {
"title": "Awesome",
"content": "awesome content goes here",
"format": "markdown",
"message": "adding an awesome page to the wiki",
"slug": "awesome",
"url": "http://example.com/root/awesome-project/wikis/awesome",
"action": "create"
},
"repository": {
"name": "awesome-project",
"url": "git@example.com:root/awesome-project.git",
"description": "test",
"homepage": "http://example.com/root/awesome-project"
}
}
```
#### Example webhook receiver #### Example webhook receiver
If you want to see GitLab's webhooks in action for testing purposes you can use If you want to see GitLab's webhooks in action for testing purposes you can use
......
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