Commit 737c824f authored by Paul Slaughter's avatar Paul Slaughter

Update snippets empty state text and buttons

Also updates the spec
parent ad890526
- button_path = local_assigns.fetch(:button_path, false)
.row.empty-state
.row.empty-state.mt-0
.col-12
.svg-content
= image_tag 'illustrations/snippets_empty.svg'
.text-content
.text-content.text-center.pt-0
- if current_user
%h4
= s_('SnippetsEmptyState|Snippets are small pieces of code or notes that you want to keep.')
%p
= s_('SnippetsEmptyState|They can be either public or private.')
.text-center
= s_('SnippetsEmptyState|Code snippets')
%p.mb-0
= s_('SnippetsEmptyState|Store, share, and embed small pieces of code and text.')
.mt-2<
- if button_path
= link_to s_('SnippetsEmptyState|New snippet'), button_path, class: 'btn btn-success', title: s_('SnippetsEmptyState|New snippet'), id: 'new_snippet_link'
- unless current_page?(dashboard_snippets_path)
= link_to s_('SnippetsEmptyState|Explore public snippets'), explore_snippets_path, class: 'btn btn-default', title: s_('SnippetsEmptyState|Explore public snippets')
= link_to s_('SnippetsEmptyState|Documentation'), help_page_path('user/snippets.md'), class: 'btn btn-default', title: s_('SnippetsEmptyState|Documentation')
- else
%h4.text-center= s_('SnippetsEmptyState|There are no snippets to show.')
......
---
title: Update snippets empty state and remove explore snippets button
merge_request: 24764
author:
type: other
......@@ -17567,7 +17567,10 @@ msgstr ""
msgid "Snippets"
msgstr ""
msgid "SnippetsEmptyState|Explore public snippets"
msgid "SnippetsEmptyState|Code snippets"
msgstr ""
msgid "SnippetsEmptyState|Documentation"
msgstr ""
msgid "SnippetsEmptyState|New snippet"
......@@ -17576,15 +17579,12 @@ msgstr ""
msgid "SnippetsEmptyState|No snippets found"
msgstr ""
msgid "SnippetsEmptyState|Snippets are small pieces of code or notes that you want to keep."
msgid "SnippetsEmptyState|Store, share, and embed small pieces of code and text."
msgstr ""
msgid "SnippetsEmptyState|There are no snippets to show."
msgstr ""
msgid "SnippetsEmptyState|They can be either public or private."
msgstr ""
msgid "Snowplow"
msgstr ""
......
......@@ -32,7 +32,7 @@ describe 'Dashboard snippets' do
it 'shows the empty state when there are no snippets' do
element = page.find('.row.empty-state')
expect(element).to have_content("Snippets are small pieces of code or notes that you want to keep.")
expect(element).to have_content("Code snippets")
expect(element.find('.svg-content img')['src']).to have_content('illustrations/snippets_empty')
end
......@@ -40,6 +40,11 @@ describe 'Dashboard snippets' do
parent_element = page.find('.row.empty-state')
expect(parent_element).to have_link('New snippet')
end
it 'shows documentation button in main comment area' do
parent_element = page.find('.row.empty-state')
expect(parent_element).to have_link('Documentation', href: help_page_path('user/snippets.md'))
end
end
context 'filtering by visibility' do
......
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