From f07051a2b6df683f11f366342b5ed15bfc1f80ba Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Fri, 15 Feb 2019 23:23:17 +0000 Subject: [PATCH] Remove second primary button on wiki create and edit --- app/views/projects/wikis/edit.html.haml | 3 --- .../remove-second-primary-button-on-wiki-edit.yml | 5 +++++ spec/features/projects/wiki/markdown_preview_spec.rb | 5 ++--- .../features/projects/wiki/user_creates_wiki_page_spec.rb | 8 +------- .../features/projects/wiki/user_updates_wiki_page_spec.rb | 7 +------ spec/features/projects/wiki/user_views_wiki_page_spec.rb | 7 +------ 6 files changed, 10 insertions(+), 25 deletions(-) create mode 100644 changelogs/unreleased/remove-second-primary-button-on-wiki-edit.yml diff --git a/app/views/projects/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml index 26671a7b7d2..1277ea6c743 100644 --- a/app/views/projects/wikis/edit.html.haml +++ b/app/views/projects/wikis/edit.html.haml @@ -23,9 +23,6 @@ = s_("Wiki|Create Page") .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? = link_to project_wiki_history_path(@project, @page), class: "btn" do = s_("Wiki|Page history") diff --git a/changelogs/unreleased/remove-second-primary-button-on-wiki-edit.yml b/changelogs/unreleased/remove-second-primary-button-on-wiki-edit.yml new file mode 100644 index 00000000000..045fbbb48b7 --- /dev/null +++ b/changelogs/unreleased/remove-second-primary-button-on-wiki-edit.yml @@ -0,0 +1,5 @@ +--- +title: Remove second primary button on wiki edit +merge_request: 19959 +author: George Tsiolis +type: changed diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index 3b469fee867..49244c53a91 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe 'Projects > Wiki > User previews markdown changes', :js do let(:user) { create(:user) } 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 <<-HEREDOC [regular link](regular) @@ -18,9 +19,7 @@ describe 'Projects > Wiki > User previews markdown changes', :js do sign_in(user) - visit project_path(project) - find('.shortcuts-wiki').click - click_link "Create your first page" + visit project_wiki_path(project, wiki_page) end context "while creating a new wiki page" do diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index 48a0d675f2d..b1a7f167977 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -44,13 +44,7 @@ describe "User creates wiki page" do end it "shows non-escaped link in the pages list", :js do - click_link("New page") - - page.within("#modal-new-wiki") do - fill_in(:new_wiki_path, with: "one/two/three-test") - - click_on("Create page") - end + fill_in(:wiki_title, with: "one/two/three-test") page.within(".wiki-form") do fill_in(:wiki_content, with: "wiki content") diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index f76e577b0d6..dbf8af3e5bb 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -26,12 +26,7 @@ describe 'User updates wiki page' do end it 'updates a page that has a path', :js do - click_on('New page') - - page.within('#modal-new-wiki') do - fill_in(:new_wiki_path, with: 'one/two/three-test') - click_on('Create page') - end + fill_in(:wiki_title, with: 'one/two/three-test') page.within '.wiki-form' do fill_in(:wiki_content, with: 'wiki content') diff --git a/spec/features/projects/wiki/user_views_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_page_spec.rb index d4691b669c1..6e28ec0d7b2 100644 --- a/spec/features/projects/wiki/user_views_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_page_spec.rb @@ -22,12 +22,7 @@ describe 'User views a wiki page' do visit(project_wikis_path(project)) click_link "Create your first page" - click_on('New page') - - page.within('#modal-new-wiki') do - fill_in(:new_wiki_path, with: 'one/two/three-test') - click_on('Create page') - end + fill_in(:wiki_title, with: 'one/two/three-test') page.within('.wiki-form') do fill_in(:wiki_content, with: 'wiki content')