Commit 749f29e3 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'zj-remove-wiki-get-formatted-data' into 'master'

Remove WikiService#get_formatted_data RPC

See merge request gitlab-org/gitlab!19627
parents b16a9e29 f6c1663f
...@@ -160,12 +160,6 @@ class ProjectWiki ...@@ -160,12 +160,6 @@ class ProjectWiki
update_project_activity update_project_activity
end end
def page_formatted_data(page)
page_title, page_dir = page_title_and_dir(page.title)
wiki.page_formatted_data(title: page_title, dir: page_dir, version: page.version)
end
def page_title_and_dir(title) def page_title_and_dir(title)
return unless title return unless title
......
...@@ -112,11 +112,6 @@ class WikiPage ...@@ -112,11 +112,6 @@ class WikiPage
wiki.page_title_and_dir(slug)&.last.to_s wiki.page_title_and_dir(slug)&.last.to_s
end end
# The processed/formatted content of this page.
def formatted_content
@attributes[:formatted_content] ||= @wiki.page_formatted_data(@page)
end
# The markup format for the page. # The markup format for the page.
def format def format
@attributes[:format] || :markdown @attributes[:format] || :markdown
......
...@@ -133,14 +133,6 @@ module Gitlab ...@@ -133,14 +133,6 @@ module Gitlab
GollumSlug.generate(title, format) GollumSlug.generate(title, format)
end end
def page_formatted_data(title:, dir: nil, version: nil)
version = version&.id
wrapped_gitaly_errors do
gitaly_wiki_client.get_formatted_data(title: title, dir: dir, version: version)
end
end
private private
def gitaly_wiki_client def gitaly_wiki_client
......
...@@ -179,18 +179,6 @@ module Gitlab ...@@ -179,18 +179,6 @@ module Gitlab
wiki_file wiki_file
end end
def get_formatted_data(title:, dir: nil, version: nil)
request = Gitaly::WikiGetFormattedDataRequest.new(
repository: @gitaly_repo,
title: encode_binary(title),
revision: encode_binary(version),
directory: encode_binary(dir)
)
response = GitalyClient.call(@repository.storage, :wiki_service, :wiki_get_formatted_data, request, timeout: GitalyClient.medium_timeout)
response.reduce([]) { |memo, msg| memo << msg.data }.join
end
private private
# If a block is given and the yielded value is truthy, iteration will be # If a block is given and the yielded value is truthy, iteration will be
......
...@@ -563,17 +563,6 @@ describe WikiPage do ...@@ -563,17 +563,6 @@ describe WikiPage do
end end
end end
describe '#formatted_content' do
it 'returns processed content of the page' do
subject.create({ title: "RDoc", content: "*bold*", format: "rdoc" })
page = wiki.find_page('RDoc')
expect(page.formatted_content).to eq("\n<p><strong>bold</strong></p>\n")
destroy_page('RDoc')
end
end
describe '#hook_attrs' do describe '#hook_attrs' do
it 'adds absolute urls for images in the content' do it 'adds absolute urls for images in the content' do
create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)") create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)")
......
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