diff --git a/app/views/shared/wikis/_main_links.html.haml b/app/views/shared/wikis/_main_links.html.haml index 4c18d1ad295f9a64891171cd7edec2792a85f3c1..8568c36559a91420e6cb9c89f7243f7741bc7fa5 100644 --- a/app/views/shared/wikis/_main_links.html.haml +++ b/app/views/shared/wikis/_main_links.html.haml @@ -1,9 +1,6 @@ - if @page&.persisted? - - if can?(current_user, :create_wiki, @wiki.container) - = link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-success", role: "button", data: { qa_selector: 'new_page_button' } do - = s_("Wiki|New page") = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button", role: "button", data: { qa_selector: 'page_history_button' } do = s_("Wiki|Page history") - - if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding - = link_to wiki_page_path(@wiki, @page, action: :edit), class: "btn gl-button js-wiki-edit", role: "button", data: { qa_selector: 'edit_page_button' } do - = _("Edit") + - if can?(current_user, :create_wiki, @wiki.container) + = link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-success btn-inverted", role: "button", data: { qa_selector: 'new_page_button' } do + = s_("Wiki|New page") diff --git a/app/views/shared/wikis/show.html.haml b/app/views/shared/wikis/show.html.haml index afad4b01521c86e7083bc980c5f42b5705edc468..a2e45ce6b5d9c60b64490c3c754db2a49d09ec56 100644 --- a/app/views/shared/wikis/show.html.haml +++ b/app/views/shared/wikis/show.html.haml @@ -20,7 +20,11 @@ = (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe .gl-mt-5.gl-mb-3 - %h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page.human_title + .gl-display-flex.gl-justify-content-space-between + %h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page.human_title + %div + - 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 js-wiki-edit', data: { qa_selector: 'edit_page_button' } .js-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 } } = render_wiki_content(@page) diff --git a/changelogs/unreleased/wiki-editor-ux-debt-1.yml b/changelogs/unreleased/wiki-editor-ux-debt-1.yml new file mode 100644 index 0000000000000000000000000000000000000000..60f16c315bb30f090bf7fa32f66622a2830b89da --- /dev/null +++ b/changelogs/unreleased/wiki-editor-ux-debt-1.yml @@ -0,0 +1,5 @@ +--- +title: Move wiki edit button inline with wiki title +merge_request: 44391 +author: +type: changed diff --git a/qa/qa/page/project/wiki/show.rb b/qa/qa/page/project/wiki/show.rb index cdd18e420d17c0cad04fbc32efb4aa5f10489717..61b0d202a769672a3b146da5837db98efca800e0 100644 --- a/qa/qa/page/project/wiki/show.rb +++ b/qa/qa/page/project/wiki/show.rb @@ -11,12 +11,12 @@ class Show < Base view 'app/views/shared/wikis/show.html.haml' do element :wiki_page_title element :wiki_page_content + element :edit_page_button end view 'app/views/shared/wikis/_main_links.html.haml' do element :new_page_button element :page_history_button - element :edit_page_button end view 'app/views/shared/empty_states/_wikis.html.haml' do