Remove second primary button on wiki create and edit

This commit is contained in:
George Tsiolis 2019-02-15 23:23:17 +00:00 committed by Fatih Acet
parent d06c3ac3ff
commit f07051a2b6
6 changed files with 10 additions and 25 deletions

View file

@ -23,9 +23,6 @@
= s_("Wiki|Create Page") = s_("Wiki|Create Page")
.nav-controls .nav-controls
- if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-success", "data-toggle" => "modal" do
= s_("Wiki|New page")
- if @page.persisted? - if @page.persisted?
= link_to project_wiki_history_path(@project, @page), class: "btn" do = link_to project_wiki_history_path(@project, @page), class: "btn" do
= s_("Wiki|Page history") = s_("Wiki|Page history")

View file

@ -0,0 +1,5 @@
---
title: Remove second primary button on wiki edit
merge_request: 19959
author: George Tsiolis
type: changed

View file

@ -3,6 +3,7 @@ require 'spec_helper'
describe 'Projects > Wiki > User previews markdown changes', :js do describe 'Projects > Wiki > User previews markdown changes', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) }
let(:wiki_content) do let(:wiki_content) do
<<-HEREDOC <<-HEREDOC
[regular link](regular) [regular link](regular)
@ -18,9 +19,7 @@ describe 'Projects > Wiki > User previews markdown changes', :js do
sign_in(user) sign_in(user)
visit project_path(project) visit project_wiki_path(project, wiki_page)
find('.shortcuts-wiki').click
click_link "Create your first page"
end end
context "while creating a new wiki page" do context "while creating a new wiki page" do

View file

@ -44,13 +44,7 @@ describe "User creates wiki page" do
end end
it "shows non-escaped link in the pages list", :js do it "shows non-escaped link in the pages list", :js do
click_link("New page") fill_in(:wiki_title, with: "one/two/three-test")
page.within("#modal-new-wiki") do
fill_in(:new_wiki_path, with: "one/two/three-test")
click_on("Create page")
end
page.within(".wiki-form") do page.within(".wiki-form") do
fill_in(:wiki_content, with: "wiki content") fill_in(:wiki_content, with: "wiki content")

View file

@ -26,12 +26,7 @@ describe 'User updates wiki page' do
end end
it 'updates a page that has a path', :js do it 'updates a page that has a path', :js do
click_on('New page') fill_in(:wiki_title, with: 'one/two/three-test')
page.within('#modal-new-wiki') do
fill_in(:new_wiki_path, with: 'one/two/three-test')
click_on('Create page')
end
page.within '.wiki-form' do page.within '.wiki-form' do
fill_in(:wiki_content, with: 'wiki content') fill_in(:wiki_content, with: 'wiki content')

View file

@ -22,12 +22,7 @@ describe 'User views a wiki page' do
visit(project_wikis_path(project)) visit(project_wikis_path(project))
click_link "Create your first page" click_link "Create your first page"
click_on('New page') fill_in(:wiki_title, with: 'one/two/three-test')
page.within('#modal-new-wiki') do
fill_in(:new_wiki_path, with: 'one/two/three-test')
click_on('Create page')
end
page.within('.wiki-form') do page.within('.wiki-form') do
fill_in(:wiki_content, with: 'wiki content') fill_in(:wiki_content, with: 'wiki content')