diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2016-05-13 10:21:01 +0300 |
---|---|---|
committer | Gabriel Mazetto <gabriel@gitlab.com> | 2016-05-31 17:24:58 +0300 |
commit | aaaed331ba06d14f0e071e0933a250c61caabf94 (patch) | |
tree | 2cfdded6acef3d5d38ed35d1d351788864d30d1e /app | |
parent | ef4fedc18f5e2475aa36cc4327a76a496567c6fc (diff) |
Fix hook data for Wiki Page event
Added "wiki" section and removed "repository"
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_wiki.rb | 14 | ||||
-rw-r--r-- | app/services/wiki_pages/base_service.rb | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 339fb0b9f9d..415393d7368 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -27,6 +27,10 @@ class ProjectWiki @project.path_with_namespace + ".wiki" end + def web_url + Gitlab::Routing.url_helpers.namespace_project_wiki_url(@project.namespace, @project, :home) + end + def url_to_repo gitlab_shell.url_to_repo(path_with_namespace) end @@ -141,6 +145,16 @@ class ProjectWiki wiki end + + def hook_attrs + { + web_url: web_url, + git_ssh_url: ssh_url_to_repo, + git_http_url: http_url_to_repo, + path_with_namespace: path_with_namespace, + default_branch: default_branch, + } + end private diff --git a/app/services/wiki_pages/base_service.rb b/app/services/wiki_pages/base_service.rb index 9162f128602..4c0a2c6b4d8 100644 --- a/app/services/wiki_pages/base_service.rb +++ b/app/services/wiki_pages/base_service.rb @@ -6,9 +6,8 @@ module WikiPages object_kind: page.class.name.underscore, user: current_user.hook_attrs, project: @project.hook_attrs, - object_attributes: page.hook_attrs, - # DEPRECATED - repository: @project.hook_attrs.slice(:name, :url, :description, :homepage) + wiki: @project.wiki.hook_attrs, + object_attributes: page.hook_attrs } page_url = Gitlab::UrlBuilder.build(page) |