Commit b7b5cc99 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '211408-update-more-pages-button-on-wiki-page' into 'master'

Update "More Pages" button on Wiki Page

See merge request gitlab-org/gitlab!27499
parents 806841e2 6ca86272
......@@ -17,5 +17,6 @@
%ul.wiki-pages
= render @sidebar_wiki_entries, context: 'sidebar'
.block.w-100
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|More Pages")
- if @sidebar_wiki_entries&.length.to_i >= 15
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|View All Pages")
---
title: Update More Pages button on Wiki Page
merge_request: 27499
author:
type: changed
......@@ -22747,9 +22747,6 @@ msgstr ""
msgid "Wiki|Edit Page"
msgstr ""
msgid "Wiki|More Pages"
msgstr ""
msgid "Wiki|New page"
msgstr ""
......@@ -22768,6 +22765,9 @@ msgstr ""
msgid "Wiki|Title"
msgstr ""
msgid "Wiki|View All Pages"
msgstr ""
msgid "Wiki|Wiki Pages"
msgstr ""
......
......@@ -312,7 +312,6 @@ describe "User creates wiki page" do
visit(project_wikis_path(project))
expect(page).to have_content('another')
expect(page).to have_content('More Pages')
end
context 'when there is a customized sidebar' do
......@@ -324,10 +323,23 @@ describe "User creates wiki page" do
visit(project_wikis_path(project))
expect(page).to have_content('My customized sidebar')
expect(page).to have_content('More Pages')
expect(page).not_to have_content('Another')
end
end
end
context 'when there are more than 15 existing pages' do
before do
create(:wiki_page, wiki: wiki, attrs: { title: 'home', content: 'home' })
(1..14).each { |i| create(:wiki_page, wiki: wiki, attrs: { title: "page-#{i}", content: "page #{i}" }) }
end
it 'renders a default sidebar when there is no customized sidebar' do
visit(project_wikis_path(project))
expect(page).to have_content('View All Pages')
expect(page).to have_content('page 1')
end
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