Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
737c824f
Commit
737c824f
authored
Feb 10, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update snippets empty state text and buttons
Also updates the spec
parent
ad890526
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
14 deletions
+23
-14
app/views/shared/empty_states/_snippets.html.haml
app/views/shared/empty_states/_snippets.html.haml
+7
-8
changelogs/unreleased/32714-snippets-ux-improvement-empty-state.yml
.../unreleased/32714-snippets-ux-improvement-empty-state.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+5
-5
spec/features/dashboard/snippets_spec.rb
spec/features/dashboard/snippets_spec.rb
+6
-1
No files found.
app/views/shared/empty_states/_snippets.html.haml
View file @
737c824f
-
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.'
)
...
...
changelogs/unreleased/32714-snippets-ux-improvement-empty-state.yml
0 → 100644
View file @
737c824f
---
title
:
Update snippets empty state and remove explore snippets button
merge_request
:
24764
author
:
type
:
other
locale/gitlab.pot
View file @
737c824f
...
...
@@ -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|S
nippets are small pieces of code or notes that you want to keep
."
msgid "SnippetsEmptyState|S
tore, 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 ""
...
...
spec/features/dashboard/snippets_spec.rb
View file @
737c824f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment