Commit 894ede26 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'remove-second-primary-button-on-wiki-edit' into 'master'

Remove second primary button on wiki create and edit

Closes #43881

See merge request gitlab-org/gitlab-ce!19959
parents d06c3ac3 f07051a2
...@@ -23,9 +23,6 @@ ...@@ -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")
......
---
title: Remove second primary button on wiki edit
merge_request: 19959
author: George Tsiolis
type: changed
...@@ -3,6 +3,7 @@ require 'spec_helper' ...@@ -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 ...@@ -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
......
...@@ -44,13 +44,7 @@ describe "User creates wiki page" do ...@@ -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")
......
...@@ -26,12 +26,7 @@ describe 'User updates wiki page' do ...@@ -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')
......
...@@ -22,12 +22,7 @@ describe 'User views a wiki page' do ...@@ -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')
......
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