Implement wiki page async load

In this commit we're removing the ff `wiki_async_load` to
globally enable the feature to load every wiki page async.

Changelog: added
parent e3d05294
...@@ -308,8 +308,7 @@ module WikiActions ...@@ -308,8 +308,7 @@ module WikiActions
end end
def load_content? def load_content?
return false if %w[history destroy diff].include?(params[:action]) return false if %w[history destroy diff show].include?(params[:action])
return false if params[:action] == 'show' && Feature.enabled?(:wiki_async_load, container, default_enabled: :yaml)
true true
end end
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
- if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding - if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding
= link_to sprite_icon('pencil', css_class: 'gl-icon'), wiki_page_path(@wiki, @page, action: :edit), title: 'Edit', role: "button", class: 'btn gl-button btn-icon btn-default js-wiki-edit', data: { qa_selector: 'edit_page_button', testid: 'wiki_edit_button' } = link_to sprite_icon('pencil', css_class: 'gl-icon'), wiki_page_path(@wiki, @page, action: :edit), title: 'Edit', role: "button", class: 'btn gl-button btn-icon btn-default js-wiki-edit', data: { qa_selector: 'edit_page_button', testid: 'wiki_edit_button' }
- if Feature.enabled?(:wiki_async_load, @wiki.container, default_enabled: :yaml)
.js-async-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json, get_wiki_content_url: wiki_page_render_api_endpoint(@page) } } .js-async-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json, get_wiki_content_url: wiki_page_render_api_endpoint(@page) } }
- else
= render 'shared/wikis/wiki_content'
= render 'shared/wikis/sidebar' = render 'shared/wikis/sidebar'
---
name: wiki_async_load
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82394
rollout_issue_url:
milestone: '14.9'
type: development
group: group::editor
default_enabled: false
...@@ -14,7 +14,6 @@ RSpec.describe 'Group wikis', :js do ...@@ -14,7 +14,6 @@ RSpec.describe 'Group wikis', :js do
wiki.container.add_owner(user) wiki.container.add_owner(user)
end end
shared_examples 'wiki feature tests' do
it_behaves_like 'User creates wiki page' it_behaves_like 'User creates wiki page'
it_behaves_like 'User deletes wiki page' it_behaves_like 'User deletes wiki page'
it_behaves_like 'User previews wiki changes' it_behaves_like 'User previews wiki changes'
...@@ -25,15 +24,4 @@ RSpec.describe 'Group wikis', :js do ...@@ -25,15 +24,4 @@ RSpec.describe 'Group wikis', :js do
it_behaves_like 'User views wiki pages' it_behaves_like 'User views wiki pages'
it_behaves_like 'User views wiki sidebar' it_behaves_like 'User views wiki sidebar'
it_behaves_like 'User views Git access wiki page' it_behaves_like 'User views Git access wiki page'
end
it_behaves_like 'wiki feature tests'
context 'when feature flag :wiki_async_load is disabled' do
before do
stub_feature_flags(wiki_async_load: false)
end
it_behaves_like 'wiki feature tests'
end
end end
...@@ -8,7 +8,6 @@ RSpec.describe 'Project wikis', :js do ...@@ -8,7 +8,6 @@ RSpec.describe 'Project wikis', :js do
let(:wiki) { create(:project_wiki, user: user, project: project) } let(:wiki) { create(:project_wiki, user: user, project: project) }
let(:project) { create(:project, namespace: user.namespace, creator: user) } let(:project) { create(:project, namespace: user.namespace, creator: user) }
shared_examples 'wiki feature tests' do
it_behaves_like 'User creates wiki page' it_behaves_like 'User creates wiki page'
it_behaves_like 'User deletes wiki page' it_behaves_like 'User deletes wiki page'
it_behaves_like 'User previews wiki changes' it_behaves_like 'User previews wiki changes'
...@@ -19,15 +18,4 @@ RSpec.describe 'Project wikis', :js do ...@@ -19,15 +18,4 @@ RSpec.describe 'Project wikis', :js do
it_behaves_like 'User views wiki pages' it_behaves_like 'User views wiki pages'
it_behaves_like 'User views wiki sidebar' it_behaves_like 'User views wiki sidebar'
it_behaves_like 'User views Git access wiki page' it_behaves_like 'User views Git access wiki page'
end
it_behaves_like 'wiki feature tests'
context 'when feature flag :wiki_async_load is disabled' do
before do
stub_feature_flags(wiki_async_load: false)
end
it_behaves_like 'wiki feature tests'
end
end end
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