Commit 4a6eab3b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '32714-snippets-ux-improvement-empty-state' into 'master'

Part 2 - Update snippets empty state text and buttons

Closes #32714

See merge request gitlab-org/gitlab!24764
parents 4c94998b 737c824f
- button_path = local_assigns.fetch(:button_path, false) - button_path = local_assigns.fetch(:button_path, false)
.row.empty-state .row.empty-state.mt-0
.col-12 .col-12
.svg-content .svg-content
= image_tag 'illustrations/snippets_empty.svg' = image_tag 'illustrations/snippets_empty.svg'
.text-content .text-content.text-center.pt-0
- if current_user - if current_user
%h4 %h4
= s_('SnippetsEmptyState|Snippets are small pieces of code or notes that you want to keep.') = s_('SnippetsEmptyState|Code snippets')
%p %p.mb-0
= s_('SnippetsEmptyState|They can be either public or private.') = s_('SnippetsEmptyState|Store, share, and embed small pieces of code and text.')
.text-center .mt-2<
- if button_path - if button_path
= link_to s_('SnippetsEmptyState|New snippet'), button_path, class: 'btn btn-success', title: s_('SnippetsEmptyState|New snippet'), id: 'new_snippet_link' = 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|Documentation'), help_page_path('user/snippets.md'), class: 'btn btn-default', title: s_('SnippetsEmptyState|Documentation')
= link_to s_('SnippetsEmptyState|Explore public snippets'), explore_snippets_path, class: 'btn btn-default', title: s_('SnippetsEmptyState|Explore public snippets')
- else - else
%h4.text-center= s_('SnippetsEmptyState|There are no snippets to show.') %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
...@@ -17597,7 +17597,10 @@ msgstr "" ...@@ -17597,7 +17597,10 @@ msgstr ""
msgid "Snippets" msgid "Snippets"
msgstr "" msgstr ""
msgid "SnippetsEmptyState|Explore public snippets" msgid "SnippetsEmptyState|Code snippets"
msgstr ""
msgid "SnippetsEmptyState|Documentation"
msgstr "" msgstr ""
msgid "SnippetsEmptyState|New snippet" msgid "SnippetsEmptyState|New snippet"
...@@ -17606,15 +17609,12 @@ msgstr "" ...@@ -17606,15 +17609,12 @@ msgstr ""
msgid "SnippetsEmptyState|No snippets found" msgid "SnippetsEmptyState|No snippets found"
msgstr "" 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 "" msgstr ""
msgid "SnippetsEmptyState|There are no snippets to show." msgid "SnippetsEmptyState|There are no snippets to show."
msgstr "" msgstr ""
msgid "SnippetsEmptyState|They can be either public or private."
msgstr ""
msgid "Snowplow" msgid "Snowplow"
msgstr "" msgstr ""
......
...@@ -32,7 +32,7 @@ describe 'Dashboard snippets' do ...@@ -32,7 +32,7 @@ describe 'Dashboard snippets' do
it 'shows the empty state when there are no snippets' do it 'shows the empty state when there are no snippets' do
element = page.find('.row.empty-state') 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') expect(element.find('.svg-content img')['src']).to have_content('illustrations/snippets_empty')
end end
...@@ -40,6 +40,11 @@ describe 'Dashboard snippets' do ...@@ -40,6 +40,11 @@ describe 'Dashboard snippets' do
parent_element = page.find('.row.empty-state') parent_element = page.find('.row.empty-state')
expect(parent_element).to have_link('New snippet') expect(parent_element).to have_link('New snippet')
end 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 end
context 'filtering by visibility' do 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