diff --git a/.eslintignore b/.eslintignore
index 1605e483e9e..d6ce39636bd 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -7,4 +7,5 @@
/vendor/
karma.config.js
webpack.config.js
+svg.config.js
/app/assets/javascripts/locale/**/*.js
diff --git a/app/assets/images/icons.json b/app/assets/images/icons.json
new file mode 100644
index 00000000000..e5da75faf38
--- /dev/null
+++ b/app/assets/images/icons.json
@@ -0,0 +1 @@
+{"iconCount":134,"icons":["abuse","account","admin","angle-double-left","angle-down","angle-left","angle-right","angle-up","appearance","applications","approval","arrow-right","assignee","bold","book","branch","calendar","cancel","chevron-down","chevron-left","chevron-right","chevron-up","clock","code","comment-dots","comment-next","comment","comments","commit","credit-card","disk","doc_code","doc_image","doc_text","download","duplicate","earth","eye-slash","eye","file-additions","file-deletion","file-modified","filter","folder","fork","geo-nodes","git-merge","group","history","home","hook","issue-block","issue-child","issue-close","issue-duplicate","issue-new","issue-open-m","issue-open","issue-parent","issues","key-2","key","label","labels","leave","level-up","license","link","list-bulleted","list-numbered","location-dot","location","lock-open","lock","log","mail","merge-request-close-m","merge-request-close","messages","mobile-issue-close","monitor","more","notifications-off","notifications","overview","pencil","pipeline","play","plus-square-o","plus-square","plus","preferences","profile","project","push-rules","question-o","question","quote","redo","remove","repeat","retry","scale","screen-full","screen-normal","search","settings","shield","slight-frown","slight-smile","smile","smiley","snippet","spam","star-o","star","stop","talic","task-done","template","thump-down","thump-up","timer","todo-add","todo-done","token","unapproval","unassignee","unlink","user","users","volume-up","warning","work"]}
\ No newline at end of file
diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg
new file mode 100644
index 00000000000..5c3a9962bd3
--- /dev/null
+++ b/app/assets/images/icons.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/assets/images/illustrations/issues.svg b/app/assets/images/illustrations/issues.svg
new file mode 100644
index 00000000000..c8e0504732d
--- /dev/null
+++ b/app/assets/images/illustrations/issues.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/assets/images/illustrations/labels.svg b/app/assets/images/illustrations/labels.svg
new file mode 100644
index 00000000000..3a2d521323b
--- /dev/null
+++ b/app/assets/images/illustrations/labels.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/views/shared/empty_states/icons/_merge_requests.svg b/app/assets/images/illustrations/merge_requests.svg
similarity index 99%
rename from app/views/shared/empty_states/icons/_merge_requests.svg
rename to app/assets/images/illustrations/merge_requests.svg
index e77f6319a95..b9b8f0058e6 100644
--- a/app/views/shared/empty_states/icons/_merge_requests.svg
+++ b/app/assets/images/illustrations/merge_requests.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/app/views/shared/empty_states/monitoring/_getting_started.svg b/app/assets/images/illustrations/monitoring/getting_started.svg
similarity index 100%
rename from app/views/shared/empty_states/monitoring/_getting_started.svg
rename to app/assets/images/illustrations/monitoring/getting_started.svg
diff --git a/app/views/shared/empty_states/monitoring/_loading.svg b/app/assets/images/illustrations/monitoring/loading.svg
similarity index 100%
rename from app/views/shared/empty_states/monitoring/_loading.svg
rename to app/assets/images/illustrations/monitoring/loading.svg
diff --git a/app/views/shared/empty_states/monitoring/_unable_to_connect.svg b/app/assets/images/illustrations/monitoring/unable_to_connect.svg
similarity index 100%
rename from app/views/shared/empty_states/monitoring/_unable_to_connect.svg
rename to app/assets/images/illustrations/monitoring/unable_to_connect.svg
diff --git a/app/assets/images/illustrations/pipelines_empty.svg b/app/assets/images/illustrations/pipelines_empty.svg
new file mode 100644
index 00000000000..f3107c8f062
--- /dev/null
+++ b/app/assets/images/illustrations/pipelines_empty.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/assets/images/illustrations/pipelines_failed.svg b/app/assets/images/illustrations/pipelines_failed.svg
new file mode 100644
index 00000000000..8daf7da86ed
--- /dev/null
+++ b/app/assets/images/illustrations/pipelines_failed.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/views/shared/empty_states/icons/_priority_labels.svg b/app/assets/images/illustrations/priority_labels.svg
similarity index 75%
rename from app/views/shared/empty_states/icons/_priority_labels.svg
rename to app/assets/images/illustrations/priority_labels.svg
index 7282c2b215e..b79c551d3d7 100644
--- a/app/views/shared/empty_states/icons/_priority_labels.svg
+++ b/app/assets/images/illustrations/priority_labels.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/app/assets/images/illustrations/todos_all_done.svg b/app/assets/images/illustrations/todos_all_done.svg
new file mode 100644
index 00000000000..6387497a6fb
--- /dev/null
+++ b/app/assets/images/illustrations/todos_all_done.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/assets/images/illustrations/todos_empty.svg b/app/assets/images/illustrations/todos_empty.svg
new file mode 100644
index 00000000000..4de6cb403b9
--- /dev/null
+++ b/app/assets/images/illustrations/todos_empty.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/assets/images/sprite.symbol.html b/app/assets/images/sprite.symbol.html
new file mode 100644
index 00000000000..d928d3f73b8
--- /dev/null
+++ b/app/assets/images/sprite.symbol.html
@@ -0,0 +1,3297 @@
+
+
+
This preview features two methods of using the generated sprite in conjunction with inline SVG. Please have a look at the HTML source for further details and be aware of the following constraints:
The embedded sprite (A) slightly differs from the generated external one. Please see the documentation for details on how to create such an embeddable sprite.
+
Internet Explorer up to version 11 doesn't support external sprites for use with inline SVG. For IE 9-11, you may polyfill this functionality with SVG for Everybody.
+
+
+
+
+
+
+
A) Inline SVG with embedded sprite
+
+
+
+
+
+
+
+
+
+
abuse
+
+
+
+
+
+
+
+
+
account
+
+
+
+
+
+
+
+
+
admin
+
+
+
+
+
+
+
+
+
angle-double-left
+
+
+
+
+
+
+
+
+
angle-down
+
+
+
+
+
+
+
+
+
angle-left
+
+
+
+
+
+
+
+
+
angle-right
+
+
+
+
+
+
+
+
+
angle-up
+
+
+
+
+
+
+
+
+
appearance
+
+
+
+
+
+
+
+
+
applications
+
+
+
+
+
+
+
+
+
approval
+
+
+
+
+
+
+
+
+
arrow-right
+
+
+
+
+
+
+
+
+
assignee
+
+
+
+
+
+
+
+
+
bold
+
+
+
+
+
+
+
+
+
book
+
+
+
+
+
+
+
+
+
branch
+
+
+
+
+
+
+
+
+
calendar
+
+
+
+
+
+
+
+
+
cancel
+
+
+
+
+
+
+
+
+
chevron-down
+
+
+
+
+
+
+
+
+
chevron-left
+
+
+
+
+
+
+
+
+
chevron-right
+
+
+
+
+
+
+
+
+
chevron-up
+
+
+
+
+
+
+
+
+
clock
+
+
+
+
+
+
+
+
+
code
+
+
+
+
+
+
+
+
+
comment
+
+
+
+
+
+
+
+
+
comment-dots
+
+
+
+
+
+
+
+
+
comment-next
+
+
+
+
+
+
+
+
+
comments
+
+
+
+
+
+
+
+
+
commit
+
+
+
+
+
+
+
+
+
credit-card
+
+
+
+
+
+
+
+
+
disk
+
+
+
+
+
+
+
+
+
doc_code
+
+
+
+
+
+
+
+
+
doc_image
+
+
+
+
+
+
+
+
+
doc_text
+
+
+
+
+
+
+
+
+
download
+
+
+
+
+
+
+
+
+
duplicate
+
+
+
+
+
+
+
+
+
earth
+
+
+
+
+
+
+
+
+
eye
+
+
+
+
+
+
+
+
+
eye-slash
+
+
+
+
+
+
+
+
+
file-additions
+
+
+
+
+
+
+
+
+
file-deletion
+
+
+
+
+
+
+
+
+
file-modified
+
+
+
+
+
+
+
+
+
filter
+
+
+
+
+
+
+
+
+
folder
+
+
+
+
+
+
+
+
+
fork
+
+
+
+
+
+
+
+
+
git-merge
+
+
+
+
+
+
+
+
+
group
+
+
+
+
+
+
+
+
+
history
+
+
+
+
+
+
+
+
+
home
+
+
+
+
+
+
+
+
+
hook
+
+
+
+
+
+
+
+
+
issue-block
+
+
+
+
+
+
+
+
+
issue-child
+
+
+
+
+
+
+
+
+
issue-close
+
+
+
+
+
+
+
+
+
issue-duplicate
+
+
+
+
+
+
+
+
+
issue-new
+
+
+
+
+
+
+
+
+
issue-open
+
+
+
+
+
+
+
+
+
issue-open-m
+
+
+
+
+
+
+
+
+
issue-parent
+
+
+
+
+
+
+
+
+
issues
+
+
+
+
+
+
+
+
+
key
+
+
+
+
+
+
+
+
+
key-2
+
+
+
+
+
+
+
+
+
label
+
+
+
+
+
+
+
+
+
labels
+
+
+
+
+
+
+
+
+
leave
+
+
+
+
+
+
+
+
+
level-up
+
+
+
+
+
+
+
+
+
license
+
+
+
+
+
+
+
+
+
link
+
+
+
+
+
+
+
+
+
list-bulleted
+
+
+
+
+
+
+
+
+
list-numbered
+
+
+
+
+
+
+
+
+
location
+
+
+
+
+
+
+
+
+
location-dot
+
+
+
+
+
+
+
+
+
lock
+
+
+
+
+
+
+
+
+
lock-open
+
+
+
+
+
+
+
+
+
log
+
+
+
+
+
+
+
+
+
mail
+
+
+
+
+
+
+
+
+
merge-request-close
+
+
+
+
+
+
+
+
+
merge-request-close-m
+
+
+
+
+
+
+
+
+
messages
+
+
+
+
+
+
+
+
+
mobile-issue-close
+
+
+
+
+
+
+
+
+
monitor
+
+
+
+
+
+
+
+
+
more
+
+
+
+
+
+
+
+
+
notifications
+
+
+
+
+
+
+
+
+
notifications-off
+
+
+
+
+
+
+
+
+
overview
+
+
+
+
+
+
+
+
+
pencil
+
+
+
+
+
+
+
+
+
pipeline
+
+
+
+
+
+
+
+
+
play
+
+
+
+
+
+
+
+
+
plus
+
+
+
+
+
+
+
+
+
plus-square
+
+
+
+
+
+
+
+
+
plus-square-o
+
+
+
+
+
+
+
+
+
preferences
+
+
+
+
+
+
+
+
+
profile
+
+
+
+
+
+
+
+
+
project
+
+
+
+
+
+
+
+
+
push-rules
+
+
+
+
+
+
+
+
+
question
+
+
+
+
+
+
+
+
+
question-o
+
+
+
+
+
+
+
+
+
quote
+
+
+
+
+
+
+
+
+
redo
+
+
+
+
+
+
+
+
+
remove
+
+
+
+
+
+
+
+
+
repeat
+
+
+
+
+
+
+
+
+
retry
+
+
+
+
+
+
+
+
+
scale
+
+
+
+
+
+
+
+
+
screen-full
+
+
+
+
+
+
+
+
+
screen-normal
+
+
+
+
+
+
+
+
+
search
+
+
+
+
+
+
+
+
+
settings
+
+
+
+
+
+
+
+
+
shield
+
+
+
+
+
+
+
+
+
slight-frown
+
+
+
+
+
+
+
+
+
slight-smile
+
+
+
+
+
+
+
+
+
smile
+
+
+
+
+
+
+
+
+
smiley
+
+
+
+
+
+
+
+
+
snippet
+
+
+
+
+
+
+
+
+
spam
+
+
+
+
+
+
+
+
+
star
+
+
+
+
+
+
+
+
+
star-o
+
+
+
+
+
+
+
+
+
stop
+
+
+
+
+
+
+
+
+
talic
+
+
+
+
+
+
+
+
+
task-done
+
+
+
+
+
+
+
+
+
template
+
+
+
+
+
+
+
+
+
thump-down
+
+
+
+
+
+
+
+
+
thump-up
+
+
+
+
+
+
+
+
+
timer
+
+
+
+
+
+
+
+
+
todo-add
+
+
+
+
+
+
+
+
+
todo-done
+
+
+
+
+
+
+
+
+
token
+
+
+
+
+
+
+
+
+
unapproval
+
+
+
+
+
+
+
+
+
unassignee
+
+
+
+
+
+
+
+
+
unlink
+
+
+
+
+
+
+
+
+
user
+
+
+
+
+
+
+
+
+
users
+
+
+
+
+
+
+
+
+
volume-up
+
+
+
+
+
+
+
+
+
warning
+
+
+
+
+
+
+
+
+
work
+
+
+
+
+
+
+
+
+
+
+
B) Inline SVG with external sprite (IE 9-11 with polyfill only)
"#{image_path('icons.svg')}##{icon_name}" } ), class: css_classes)
+ end
+
def audit_icon(names, options = {})
case names
when "standard"
diff --git a/app/helpers/system_note_helper.rb b/app/helpers/system_note_helper.rb
index c98f65c7644..d7eaf6ce24d 100644
--- a/app/helpers/system_note_helper.rb
+++ b/app/helpers/system_note_helper.rb
@@ -1,25 +1,25 @@
module SystemNoteHelper
ICON_NAMES_BY_ACTION = {
- 'commit' => 'icon_commit',
- 'description' => 'icon_edit',
- 'merge' => 'icon_merge',
- 'merged' => 'icon_merged',
- 'opened' => 'icon_status_open',
- 'closed' => 'icon_status_closed',
- 'time_tracking' => 'icon_stopwatch',
- 'assignee' => 'icon_user',
- 'title' => 'icon_edit',
- 'task' => 'icon_check_square_o',
- 'label' => 'icon_tags',
- 'cross_reference' => 'icon_random',
- 'branch' => 'icon_code_fork',
- 'confidential' => 'icon_eye_slash',
- 'visible' => 'icon_eye',
- 'milestone' => 'icon_clock_o',
- 'discussion' => 'icon_comment_o',
- 'moved' => 'icon_arrow_circle_o_right',
- 'outdated' => 'icon_edit',
- 'duplicate' => 'icon_clone'
+ 'commit' => 'commit',
+ 'description' => 'pencil',
+ 'merge' => 'git-merge',
+ 'merged' => 'git-merge',
+ 'opened' => 'issue-open',
+ 'closed' => 'issue-close',
+ 'time_tracking' => 'timer',
+ 'assignee' => 'user',
+ 'title' => 'pencil',
+ 'task' => 'task-done',
+ 'label' => 'label',
+ 'cross_reference' => 'comment-dots',
+ 'branch' => 'fork',
+ 'confidential' => 'eye-slash',
+ 'visible' => 'eye',
+ 'milestone' => 'clock',
+ 'discussion' => 'comment',
+ 'moved' => 'arrow-right',
+ 'outdated' => 'pencil',
+ 'duplicate' => 'issue-duplicate'
}.freeze
def system_note_icon_name(note)
@@ -28,7 +28,7 @@ def system_note_icon_name(note)
def icon_for_system_note(note)
icon_name = system_note_icon_name(note)
- custom_icon(icon_name) if icon_name
+ sprite_icon(icon_name) if icon_name
end
extend self
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml
index 9b615ec999e..f62a0cd681e 100644
--- a/app/views/dashboard/todos/index.html.haml
+++ b/app/views/dashboard/todos/index.html.haml
@@ -77,13 +77,14 @@
%ul.content-list.todos-list
= render @todos
= paginate @todos, theme: "gitlab"
- .js-nothing-here-container.todos-all-done.hidden
- = render "shared/empty_states/icons/todos_all_done.svg"
+ .js-nothing-here-container.todos-all-done.hidden.svg-content
+ = image_tag 'illustrations/todos_all_done.svg'
%h4.text-center
You're all done!
- elsif current_user.todos.any?
.todos-all-done
- = render "shared/empty_states/icons/todos_all_done.svg"
+ .svg-content
+ = image_tag 'illustrations/todos_all_done.svg'
- if todos_filter_empty?
%h4.text-center
= Gitlab.config.gitlab.no_todos_messages.sample
@@ -99,8 +100,8 @@
There are no todos to show.
- else
.todos-empty
- .todos-empty-hero
- = render "shared/empty_states/icons/todos_empty.svg"
+ .todos-empty-hero.svg-content
+ = image_tag 'illustrations/todos_empty.svg'
.todos-empty-content
%h4
Todos let you see what you should do next.
diff --git a/app/views/help/show.html.haml b/app/views/help/show.html.haml
index c07c148a12a..d6789baea28 100644
--- a/app/views/help/show.html.haml
+++ b/app/views/help/show.html.haml
@@ -1,3 +1,5 @@
+- content_for :page_specific_javascripts do
+ = webpack_bundle_tag 'help'
- page_title @path.split("/").reverse.map(&:humanize)
.documentation.wiki.prepend-top-default
= markdown @markdown
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml
index 615238b94ad..9eef006b6a8 100644
--- a/app/views/layouts/nav/sidebar/_admin.html.haml
+++ b/app/views/layouts/nav/sidebar/_admin.html.haml
@@ -9,7 +9,7 @@
= nav_link(controller: %w(dashboard admin projects users groups jobs runners cohorts conversational_development_index), html_options: {class: 'home'}) do
= link_to admin_root_path, class: 'shortcuts-tree' do
.nav-icon-container
- = custom_icon('overview')
+ = sprite_icon('overview')
%span.nav-item-name
Overview
@@ -55,7 +55,7 @@
= nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles)) do
= link_to admin_system_info_path do
.nav-icon-container
- = custom_icon('monitoring')
+ = sprite_icon('monitor')
%span.nav-item-name
Monitoring
@@ -89,7 +89,7 @@
= nav_link(controller: :broadcast_messages) do
= link_to admin_broadcast_messages_path do
.nav-icon-container
- = custom_icon('messages')
+ = sprite_icon('messages')
%span.nav-item-name
Messages
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -101,7 +101,7 @@
= nav_link(controller: [:hooks, :hook_logs]) do
= link_to admin_hooks_path do
.nav-icon-container
- = custom_icon('system_hooks')
+ = sprite_icon('hook')
%span.nav-item-name
System Hooks
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -113,7 +113,7 @@
= nav_link(controller: :applications) do
= link_to admin_applications_path do
.nav-icon-container
- = custom_icon('applications')
+ = sprite_icon('applications')
%span.nav-item-name
Applications
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -125,7 +125,7 @@
= nav_link(controller: :abuse_reports) do
= link_to admin_abuse_reports_path do
.nav-icon-container
- = custom_icon('abuse_reports')
+ = sprite_icon('slight-frown')
%span.nav-item-name
Abuse Reports
%span.badge.count= number_with_delimiter(AbuseReport.count(:all))
@@ -140,7 +140,7 @@
= nav_link(controller: :spam_logs) do
= link_to admin_spam_logs_path do
.nav-icon-container
- = custom_icon('spam_logs')
+ = sprite_icon('spam')
%span.nav-item-name
Spam Logs
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -152,7 +152,7 @@
= nav_link(controller: :deploy_keys) do
= link_to admin_deploy_keys_path do
.nav-icon-container
- = custom_icon('key')
+ = sprite_icon('key')
%span.nav-item-name
Deploy Keys
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -164,7 +164,7 @@
= nav_link(controller: :services) do
= link_to admin_application_settings_services_path do
.nav-icon-container
- = custom_icon('service_templates')
+ = sprite_icon('template')
%span.nav-item-name
Service Templates
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -176,7 +176,7 @@
= nav_link(controller: :labels) do
= link_to admin_labels_path do
.nav-icon-container
- = custom_icon('labels')
+ = sprite_icon('labels')
%span.nav-item-name
Labels
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -188,7 +188,7 @@
= nav_link(controller: :appearances) do
= link_to admin_appearances_path do
.nav-icon-container
- = custom_icon('appearance')
+ = sprite_icon('appearance')
%span.nav-item-name
Appearance
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -200,7 +200,7 @@
= nav_link(controller: :application_settings) do
= link_to admin_application_settings_path do
.nav-icon-container
- = custom_icon('settings')
+ = sprite_icon('settings')
%span.nav-item-name
Settings
%ul.sidebar-sub-level-items.is-fly-out-only
diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml
index cb44c012f56..8cba495f7e4 100644
--- a/app/views/layouts/nav/sidebar/_group.html.haml
+++ b/app/views/layouts/nav/sidebar/_group.html.haml
@@ -13,7 +13,7 @@
= nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: 'home' }) do
= link_to group_path(@group) do
.nav-icon-container
- = custom_icon('project')
+ = sprite_icon('project')
%span.nav-item-name
Overview
@@ -36,7 +36,7 @@
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index']) do
= link_to issues_group_path(@group) do
.nav-icon-container
- = custom_icon('issues')
+ = sprite_icon('issues')
%span.nav-item-name
Issues
%span.badge.count= number_with_delimiter(issues.count)
@@ -66,7 +66,7 @@
= nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do
.nav-icon-container
- = custom_icon('mr_bold')
+ = sprite_icon('git-merge')
%span.nav-item-name
Merge Requests
%span.badge.count= number_with_delimiter(merge_requests.count)
@@ -79,7 +79,7 @@
= nav_link(path: 'group_members#index') do
= link_to group_group_members_path(@group) do
.nav-icon-container
- = custom_icon('members')
+ = sprite_icon('users')
%span.nav-item-name
Members
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -91,7 +91,7 @@
= nav_link(path: %w[groups#projects groups#edit ci_cd#show]) do
= link_to edit_group_path(@group) do
.nav-icon-container
- = custom_icon('settings')
+ = sprite_icon('settings')
%span.nav-item-name
Settings
%ul.sidebar-sub-level-items
diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml
index 2c402591f62..a015c94c60e 100644
--- a/app/views/layouts/nav/sidebar/_profile.html.haml
+++ b/app/views/layouts/nav/sidebar/_profile.html.haml
@@ -9,7 +9,7 @@
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path do
.nav-icon-container
- = custom_icon('profile')
+ = sprite_icon('profile')
%span.nav-item-name
Profile
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -20,7 +20,7 @@
= nav_link(controller: [:accounts, :two_factor_auths]) do
= link_to profile_account_path do
.nav-icon-container
- = custom_icon('account')
+ = sprite_icon('account')
%span.nav-item-name
Account
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -32,7 +32,7 @@
= nav_link(controller: 'oauth/applications') do
= link_to applications_profile_path do
.nav-icon-container
- = custom_icon('applications')
+ = sprite_icon('applications')
%span.nav-item-name
Applications
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -43,7 +43,7 @@
= nav_link(controller: :chat_names) do
= link_to profile_chat_names_path do
.nav-icon-container
- = custom_icon('chat')
+ = sprite_icon('comment')
%span.nav-item-name
Chat
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -54,7 +54,7 @@
= nav_link(controller: :personal_access_tokens) do
= link_to profile_personal_access_tokens_path do
.nav-icon-container
- = custom_icon('access_tokens')
+ = sprite_icon('token')
%span.nav-item-name
Access Tokens
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -65,7 +65,7 @@
= nav_link(controller: :emails) do
= link_to profile_emails_path do
.nav-icon-container
- = custom_icon('emails')
+ = sprite_icon('mail')
%span.nav-item-name
Emails
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -77,7 +77,7 @@
= nav_link(controller: :passwords) do
= link_to edit_profile_password_path do
.nav-icon-container
- = custom_icon('lock')
+ = sprite_icon('lock')
%span.nav-item-name
Password
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -88,7 +88,7 @@
= nav_link(controller: :notifications) do
= link_to profile_notifications_path do
.nav-icon-container
- = custom_icon('notifications')
+ = sprite_icon('notifications')
%span.nav-item-name
Notifications
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -99,7 +99,7 @@
= nav_link(controller: :keys) do
= link_to profile_keys_path do
.nav-icon-container
- = custom_icon('key')
+ = sprite_icon('key')
%span.nav-item-name
SSH Keys
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -110,7 +110,7 @@
= nav_link(controller: :gpg_keys) do
= link_to profile_gpg_keys_path do
.nav-icon-container
- = custom_icon('key_2')
+ = sprite_icon('key-2')
%span.nav-item-name
GPG Keys
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -121,7 +121,7 @@
= nav_link(controller: :preferences) do
= link_to profile_preferences_path do
.nav-icon-container
- = custom_icon('preferences')
+ = sprite_icon('preferences')
%span.nav-item-name
Preferences
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -132,7 +132,7 @@
= nav_link(path: 'profiles#audit_log') do
= link_to audit_log_profile_path do
.nav-icon-container
- = custom_icon('authentication_log')
+ = sprite_icon('log')
%span.nav-item-name
Authentication log
%ul.sidebar-sub-level-items.is-fly-out-only
diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml
index 8ec2e2c79fc..8765b814405 100644
--- a/app/views/layouts/nav/sidebar/_project.html.haml
+++ b/app/views/layouts/nav/sidebar/_project.html.haml
@@ -11,7 +11,7 @@
= nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do
= link_to project_path(@project), class: 'shortcuts-project' do
.nav-icon-container
- = custom_icon('project')
+ = sprite_icon('project')
%span.nav-item-name
Overview
@@ -38,7 +38,7 @@
= nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)) do
= link_to project_tree_path(@project), class: 'shortcuts-tree' do
.nav-icon-container
- = custom_icon('doc_text')
+ = sprite_icon('doc_text')
%span.nav-item-name
Repository
@@ -84,7 +84,7 @@
= nav_link(controller: %w[projects/registry/repositories]) do
= link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry' do
.nav-icon-container
- = custom_icon('container_registry')
+ = sprite_icon('disk')
%span.nav-item-name
Registry
@@ -92,7 +92,7 @@
= nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do
= link_to project_issues_path(@project), class: 'shortcuts-issues' do
.nav-icon-container
- = custom_icon('issues')
+ = sprite_icon('issues')
%span.nav-item-name
Issues
- if @project.issues_enabled?
@@ -132,7 +132,7 @@
= nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do
= link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests' do
.nav-icon-container
- = custom_icon('mr_bold')
+ = sprite_icon('git-merge')
%span.nav-item-name
Merge Requests
%span.badge.count.merge_counter.js-merge-counter
@@ -149,7 +149,7 @@
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :environments, :artifacts]) do
= link_to project_pipelines_path(@project), class: 'shortcuts-pipelines' do
.nav-icon-container
- = custom_icon('pipeline')
+ = sprite_icon('pipeline')
%span.nav-item-name
CI / CD
@@ -193,7 +193,7 @@
= nav_link(controller: :wikis) do
= link_to get_project_wiki_path(@project), class: 'shortcuts-wiki' do
.nav-icon-container
- = custom_icon('wiki')
+ = sprite_icon('book')
%span.nav-item-name
Wiki
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -206,7 +206,7 @@
= nav_link(controller: :snippets) do
= link_to project_snippets_path(@project), class: 'shortcuts-snippets' do
.nav-icon-container
- = custom_icon('snippets')
+ = sprite_icon('snippet')
%span.nav-item-name
Snippets
%ul.sidebar-sub-level-items.is-fly-out-only
@@ -219,7 +219,7 @@
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show pages#show]) do
= link_to edit_project_path(@project), class: 'shortcuts-tree' do
.nav-icon-container
- = custom_icon('settings')
+ = sprite_icon('settings')
%span.nav-item-name
Settings
@@ -263,7 +263,7 @@
= nav_link(path: %w[members#show]) do
= link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do
.nav-icon-container
- = custom_icon('members')
+ = sprite_icon('users')
%span.nav-item-name
Members
diff --git a/app/views/projects/commit/_pipelines_list.haml b/app/views/projects/commit/_pipelines_list.haml
index bef96786b73..49b0b314e1d 100644
--- a/app/views/projects/commit/_pipelines_list.haml
+++ b/app/views/projects/commit/_pipelines_list.haml
@@ -3,6 +3,8 @@
endpoint: endpoint,
"help-page-path" => help_page_path('ci/quick_start/README'),
"help-auto-devops-path" => help_page_path('topics/autodevops/index.md'),
+ "empty-state-svg-path" => image_path('illustrations/pipelines_empty.svg'),
+ "error-state-svg-path" => image_path('illustrations/pipelines_failed.svg'),
} }
- content_for :page_specific_javascripts do
diff --git a/app/views/projects/environments/metrics.html.haml b/app/views/projects/environments/metrics.html.haml
index e9e1ad9ef30..4a65b46f029 100644
--- a/app/views/projects/environments/metrics.html.haml
+++ b/app/views/projects/environments/metrics.html.haml
@@ -16,6 +16,9 @@
#prometheus-graphs{ data: { "settings-path": edit_project_service_path(@project, 'prometheus'),
"documentation-path": help_page_path('administration/monitoring/prometheus/index.md'),
+ "empty-getting-started-svg-path": image_path('illustrations/monitoring/getting_started'),
+ "empty-loading-svg-path": image_path('illustrations/monitoring/loading'),
+ "empty-unable-to-connect-svg-path": image_path('illustrations/monitoring/unable_to_connect'),
"additional-metrics": additional_metrics_project_environment_path(@project, @environment, format: :json),
"has-metrics": "#{@environment.has_metrics?}", deployment_endpoint: project_environment_deployments_path(@project, @environment, format: :json) } }
diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml
index 9fc15d20f34..4f53efcf791 100644
--- a/app/views/projects/pipelines/index.html.haml
+++ b/app/views/projects/pipelines/index.html.haml
@@ -5,10 +5,11 @@
%div{ 'class' => container_class }
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
-
#pipelines-list-vue{ data: { endpoint: project_pipelines_path(@project, format: :json),
"help-page-path" => help_page_path('ci/quick_start/README'),
"help-auto-devops-path" => help_page_path('topics/autodevops/index.md'),
+ "empty-state-svg-path" => image_path('illustrations/pipelines_empty.svg'),
+ "error-state-svg-path" => image_path('illustrations/pipelines_failed.svg'),
"new-pipeline-path" => new_project_pipeline_path(@project),
"can-create-pipeline" => can?(current_user, :create_pipeline, @project).to_s,
"all-path" => project_pipelines_path(@project),
@@ -17,7 +18,7 @@
"finished-path" => project_pipelines_path(@project, scope: :finished),
"branches-path" => project_pipelines_path(@project, scope: :branches),
"tags-path" => project_pipelines_path(@project, scope: :tags),
- "has-ci" => @project.has_ci?,
+ "has-ci" => @repository.gitlab_ci_yml,
"ci-lint-path" => ci_lint_path } }
= page_specific_javascript_bundle_tag('common_vue')
diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml
index 1a50b7d4b69..2e5e7911981 100644
--- a/app/views/shared/boards/_show.html.haml
+++ b/app/views/shared/boards/_show.html.haml
@@ -31,10 +31,10 @@
":board-id" => "boardId",
":key" => "_uid" }
= render "shared/boards/components/sidebar"
- %board-add-issues-modal{ "blank-state-image" => render('shared/empty_states/icons/issues.svg'),
- "new-issue-path" => new_project_issue_path(@project),
+ %board-add-issues-modal{ "new-issue-path" => new_project_issue_path(@project),
"milestone-path" => milestones_filter_dropdown_path,
"label-path" => labels_filter_path,
+ "empty-state-svg" => image_path('illustrations/issues.svg'),
":issue-link-base" => "issueLinkBase",
":root-path" => "rootPath",
":project-id" => @project.try(:id) }
diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml
index 68737e8da66..de26fa8bbf3 100644
--- a/app/views/shared/empty_states/_issues.html.haml
+++ b/app/views/shared/empty_states/_issues.html.haml
@@ -5,7 +5,7 @@
.row.empty-state
.col-xs-12
.svg-content
- = render 'shared/empty_states/icons/issues.svg'
+ = image_tag 'illustrations/issues.svg'
.col-xs-12.text-center
.text-content
- if has_button && current_user
diff --git a/app/views/shared/empty_states/_labels.html.haml b/app/views/shared/empty_states/_labels.html.haml
index bfda522f2f6..a65634dce53 100644
--- a/app/views/shared/empty_states/_labels.html.haml
+++ b/app/views/shared/empty_states/_labels.html.haml
@@ -1,7 +1,7 @@
.row.empty-state.labels
.col-xs-12
.svg-content
- = render 'shared/empty_states/icons/labels.svg'
+ = image_tag 'illustrations/labels.svg'
.col-xs-12.text-center
.text-content
%h4 Labels can be applied to issues and merge requests to categorize them.
diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml
index ff5741b6d61..67f906903e9 100644
--- a/app/views/shared/empty_states/_merge_requests.html.haml
+++ b/app/views/shared/empty_states/_merge_requests.html.haml
@@ -5,7 +5,7 @@
.row.empty-state.merge-requests
.col-xs-12
.svg-content
- = render 'shared/empty_states/icons/merge_requests.svg'
+ = image_tag 'illustrations/merge_requests.svg'
.col-xs-12.text-center
.text-content
- if has_button
diff --git a/app/views/shared/empty_states/_priority_labels.html.haml b/app/views/shared/empty_states/_priority_labels.html.haml
index bc268301a97..555cb4f4af9 100644
--- a/app/views/shared/empty_states/_priority_labels.html.haml
+++ b/app/views/shared/empty_states/_priority_labels.html.haml
@@ -1,3 +1,4 @@
.text-center
- = render 'shared/empty_states/icons/priority_labels.svg'
+ .svg-content
+ = image_tag 'illustrations/priority_labels.svg'
%p Star labels to start sorting by priority
diff --git a/app/views/shared/empty_states/icons/_issues.svg b/app/views/shared/empty_states/icons/_issues.svg
deleted file mode 100644
index 2e92bf19579..00000000000
--- a/app/views/shared/empty_states/icons/_issues.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/views/shared/empty_states/icons/_labels.svg b/app/views/shared/empty_states/icons/_labels.svg
deleted file mode 100644
index dc041a4a78b..00000000000
--- a/app/views/shared/empty_states/icons/_labels.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/views/shared/empty_states/icons/_pipelines_empty.svg b/app/views/shared/empty_states/icons/_pipelines_empty.svg
deleted file mode 100644
index 7c672538097..00000000000
--- a/app/views/shared/empty_states/icons/_pipelines_empty.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/views/shared/empty_states/icons/_pipelines_failed.svg b/app/views/shared/empty_states/icons/_pipelines_failed.svg
deleted file mode 100644
index 7dbabf7e4ef..00000000000
--- a/app/views/shared/empty_states/icons/_pipelines_failed.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/views/shared/empty_states/icons/_todos_all_done.svg b/app/views/shared/empty_states/icons/_todos_all_done.svg
deleted file mode 100644
index 94b5c2e0ea0..00000000000
--- a/app/views/shared/empty_states/icons/_todos_all_done.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/views/shared/empty_states/icons/_todos_empty.svg b/app/views/shared/empty_states/icons/_todos_empty.svg
deleted file mode 100644
index b1e661268fb..00000000000
--- a/app/views/shared/empty_states/icons/_todos_empty.svg
+++ /dev/null
@@ -1,110 +0,0 @@
-
diff --git a/app/views/shared/icons/_key_2.svg b/app/views/shared/icons/_key_2.svg
deleted file mode 100644
index 368b2876c60..00000000000
--- a/app/views/shared/icons/_key_2.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml
index 6c5c8cad270..db31b01a7d2 100644
--- a/config/dependency_decisions.yml
+++ b/config/dependency_decisions.yml
@@ -452,3 +452,15 @@
:why: https://github.com/jaredhanson/utils-merge/blob/v1.0.0/LICENSE
:versions: []
:when: 2017-09-16 05:18:26.193764000 Z
+- - :approve
+ - svg4everybody
+ - :who: Tim Zallmann
+ :why: CC0 1.0 - https://github.com/jonathantneal/svg4everybody/blob/master/LICENSE.md
+ :versions: []
+ :when: 2017-09-13 17:31:16.425819400 Z
+- - :approve
+ - gitlab-svgs
+ - :who: Tim Zallmann
+ :why: Our own library - https://gitlab.com/gitlab-org/gitlab-svgs
+ :versions: []
+ :when: 2017-09-19 14:36:32.795496000 Z
diff --git a/config/svg.config.js b/config/svg.config.js
new file mode 100644
index 00000000000..be72741abec
--- /dev/null
+++ b/config/svg.config.js
@@ -0,0 +1,48 @@
+/* eslint-disable no-commonjs */
+const path = require('path');
+const fs = require('fs');
+
+const sourcePath = path.join('node_modules', 'gitlab-svgs', 'dist');
+const sourcePathIllustrations = path.join('node_modules', 'gitlab-svgs', 'dist', 'illustrations');
+const destPath = path.normalize(path.join('app', 'assets', 'images'));
+
+// Actual Task copying the 2 files + all illustrations
+copyFileSync(path.join(sourcePath, 'icons.svg'), destPath);
+copyFileSync(path.join(sourcePath, 'icons.json'), destPath);
+copyFolderRecursiveSync(sourcePathIllustrations, destPath);
+
+// Helper Functions
+function copyFileSync(source, target) {
+ var targetFile = target;
+ //if target is a directory a new file with the same name will be created
+ if (fs.existsSync(target)) {
+ if (fs.lstatSync(target).isDirectory()) {
+ targetFile = path.join(target, path.basename(source));
+ }
+ }
+ console.log(`Copy SVG File : ${targetFile}`);
+ fs.writeFileSync(targetFile, fs.readFileSync(source));
+}
+
+function copyFolderRecursiveSync(source, target) {
+ var files = [];
+
+ //check if folder needs to be created or integrated
+ var targetFolder = path.join(target, path.basename(source));
+ if (!fs.existsSync(targetFolder)) {
+ fs.mkdirSync(targetFolder);
+ }
+
+ //copy
+ if (fs.lstatSync(source).isDirectory()) {
+ files = fs.readdirSync(source);
+ files.forEach(function (file) {
+ var curSource = path.join(source, file);
+ if (fs.lstatSync(curSource).isDirectory()) {
+ copyFolderRecursiveSync(curSource, targetFolder);
+ } else {
+ copyFileSync(curSource, targetFolder);
+ }
+ });
+ }
+}
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 6b0cd023291..3404715fe30 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -45,6 +45,7 @@ var config = {
group: './group.js',
groups: './groups/index.js',
groups_list: './groups_list.js',
+ help: './help/help.js',
how_to_merge: './how_to_merge.js',
issue_show: './issue_show/index.js',
integrations: './integrations',
diff --git a/doc/development/fe_guide/icons.md b/doc/development/fe_guide/icons.md
new file mode 100644
index 00000000000..a76e978bd26
--- /dev/null
+++ b/doc/development/fe_guide/icons.md
@@ -0,0 +1,40 @@
+# Icons
+
+We are using SVG Icons in GitLab with a SVG Sprite, due to this the icons are only loaded once and then referenced through an ID. The sprite SVG is located under `/assets/icons.svg`. Our goal is to replace one by one all inline SVG Icons (as those currently bloat the HTML) and also all Font Awesome usages.
+
+### Usage in HAML/Rails
+
+To use a sprite Icon in HAML or Rails we use a specific helper function :
+
+`sprite_icon(icon_name, size: nil, css_class: '')`
+
+**icon_name** Use the icon_name that you can find in the SVG Sprite (Overview is available under `/assets/sprite.symbol.html`).
+**size (optional)** Use one of the following sizes : 16,24,32,48,72 (this will be translated into a `s16` class)
+**css_class (optional)** If you want to add additional css classes
+
+**Example**
+
+`= sprite_icon('issues', size: 72, css_class: 'icon-danger')`
+
+**Output from example above**
+
+``
+
+### Usage in HTML/JS
+
+Please use the following function inside JS to render an icon :
+`gl.utils.spriteIcon(iconName)`
+
+## Adding a new icon to the sprite
+
+All Icons and Illustrations are managed in the [gitlab-svgs](https://gitlab.com/gitlab-org/gitlab-svgs) repository which is added as a dev-dependency.
+
+To upgrade to a new SVG Sprite version run `yarn upgrade https://gitlab.com/gitlab-org/gitlab-svgs` and then run `yarn run svg`. This task will copy the svg sprite and all illustrations in the correct folders.
+
+# SVG Illustrations
+
+Please use from now on for any SVG based illustrations simple `img` tags to show an illustration by simply using either `image_tag` or `image_path` helpers. Please use the class `svg-content` around it to ensure nice rendering. The illustrations are also organised in the [gitlab-svgs](https://gitlab.com/gitlab-org/gitlab-svgs) repository (as they are then automatically optimised).
+
+**Example**
+
+`= image_tag 'illustrations/merge_requests.svg'`
diff --git a/doc/development/fe_guide/index.md b/doc/development/fe_guide/index.md
index 64bcb4a0257..d84801f91d4 100644
--- a/doc/development/fe_guide/index.md
+++ b/doc/development/fe_guide/index.md
@@ -98,6 +98,11 @@ Vue specific design patterns and practices.
---
+## [Icons](icons.md)
+How we use SVG for our Icons.
+
+---
+
## Style Guides
### [JavaScript Style Guide](style_guide_js.md)
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index 9bcc579278f..3a666c2268b 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -20,6 +20,7 @@ def add_gon_variables
gon.gitlab_url = Gitlab.config.gitlab.url
gon.revision = Gitlab::REVISION
gon.gitlab_logo = ActionController::Base.helpers.asset_path('gitlab_logo.png')
+ gon.sprite_icons = ActionController::Base.helpers.asset_path('icons.svg')
if current_user
gon.current_user_id = current_user.id
diff --git a/package.json b/package.json
index feae6ca9748..5aa3ce3f757 100644
--- a/package.json
+++ b/package.json
@@ -8,6 +8,7 @@
"karma": "karma start config/karma.config.js --single-run",
"karma-coverage": "BABEL_ENV=coverage karma start config/karma.config.js --single-run",
"karma-start": "karma start config/karma.config.js",
+ "svg": "node config/svg.config.js",
"webpack": "webpack --config config/webpack.config.js",
"webpack-prod": "NODE_ENV=production webpack --config config/webpack.config.js"
},
@@ -28,7 +29,7 @@
"css-loader": "^0.28.0",
"d3": "^3.5.11",
"deckar01-task_list": "^2.0.0",
- "document-register-element": "^1.3.0",
+ "document-register-element": "1.3.0",
"dropzone": "^4.2.0",
"emoji-unicode-version": "^0.2.1",
"eslint-plugin-html": "^2.0.1",
@@ -53,6 +54,7 @@
"react-dev-utils": "^0.5.2",
"select2": "3.5.2-browserify",
"sql.js": "^0.4.0",
+ "svg4everybody": "2.1.9",
"three": "^0.84.0",
"three-orbit-controls": "^82.1.0",
"three-stl-loader": "^1.0.4",
@@ -78,6 +80,7 @@
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jasmine": "^2.1.0",
"eslint-plugin-promise": "^3.5.0",
+ "gitlab-svgs": "https://gitlab.com/gitlab-org/gitlab-svgs.git",
"istanbul": "^0.4.5",
"jasmine-core": "^2.6.3",
"jasmine-jquery": "^2.1.1",
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb
index 91c8faea7fd..3d79dac284f 100644
--- a/spec/helpers/icons_helper_spec.rb
+++ b/spec/helpers/icons_helper_spec.rb
@@ -16,6 +16,25 @@
end
end
+ describe 'sprite_icon' do
+ icon_name = 'clock'
+
+ it 'returns svg icon html' do
+ expect(sprite_icon(icon_name).to_s)
+ .to eq ""
+ end
+
+ it 'returns svg icon html + size classes' do
+ expect(sprite_icon(icon_name, size: 72).to_s)
+ .to eq ""
+ end
+
+ it 'returns svg icon html + size classes + additional class' do
+ expect(sprite_icon(icon_name, size: 72, css_class: 'icon-danger').to_s)
+ .to eq ""
+ end
+ end
+
describe 'file_type_icon_class' do
it 'returns folder class' do
expect(file_type_icon_class('folder', 0, 'folder_name')).to eq 'folder'
diff --git a/spec/javascripts/commit/pipelines/pipelines_spec.js b/spec/javascripts/commit/pipelines/pipelines_spec.js
index 454f187ccbc..9fc047b1f5e 100644
--- a/spec/javascripts/commit/pipelines/pipelines_spec.js
+++ b/spec/javascripts/commit/pipelines/pipelines_spec.js
@@ -29,6 +29,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
propsData: {
endpoint: 'endpoint',
helpPagePath: 'foo',
+ emptyStateSvgPath: 'foo',
+ errorStateSvgPath: 'foo',
autoDevopsHelpPath: 'foo',
},
}).$mount();
@@ -65,6 +67,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
propsData: {
endpoint: 'endpoint',
helpPagePath: 'foo',
+ emptyStateSvgPath: 'foo',
+ errorStateSvgPath: 'foo',
autoDevopsHelpPath: 'foo',
},
}).$mount();
@@ -117,6 +121,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
propsData: {
endpoint: 'endpoint',
helpPagePath: 'foo',
+ emptyStateSvgPath: 'foo',
+ errorStateSvgPath: 'foo',
autoDevopsHelpPath: 'foo',
},
}).$mount();
@@ -139,6 +145,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
propsData: {
endpoint: 'endpoint',
helpPagePath: 'foo',
+ emptyStateSvgPath: 'foo',
+ errorStateSvgPath: 'foo',
autoDevopsHelpPath: 'foo',
},
}).$mount();
diff --git a/spec/javascripts/fixtures/pipelines.html.haml b/spec/javascripts/fixtures/pipelines.html.haml
index 418a38a0e2e..97b0c25c923 100644
--- a/spec/javascripts/fixtures/pipelines.html.haml
+++ b/spec/javascripts/fixtures/pipelines.html.haml
@@ -2,6 +2,8 @@
#pipelines-list-vue{ data: { endpoint: 'foo',
"css-class" => 'foo',
"help-page-path" => 'foo',
+ "empty-state-svg-path" => 'foo',
+ "error-state-svg-path" => 'foo',
"new-pipeline-path" => 'foo',
"can-create-pipeline" => 'true',
"all-path" => 'foo',
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js
index fd5b7d4e5da..787b405de47 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js
+++ b/spec/javascripts/lib/utils/common_utils_spec.js
@@ -411,5 +411,15 @@ describe('common_utils', () => {
commonUtils.ajaxPost(requestURL, data);
expect(ajaxSpy.calls.allArgs()[0][0].type).toEqual('POST');
});
+
+ describe('gl.utils.spriteIcon', () => {
+ beforeEach(() => {
+ window.gon.sprite_icons = 'icons.svg';
+ });
+
+ it('should return the svg for a linked icon', () => {
+ expect(gl.utils.spriteIcon('test')).toEqual('');
+ });
+ });
});
});
diff --git a/spec/javascripts/monitoring/dashboard_state_spec.js b/spec/javascripts/monitoring/dashboard_state_spec.js
index e8f7042e131..3319eeb3f31 100644
--- a/spec/javascripts/monitoring/dashboard_state_spec.js
+++ b/spec/javascripts/monitoring/dashboard_state_spec.js
@@ -21,6 +21,9 @@ describe('EmptyState', () => {
selectedState: 'gettingStarted',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.currentState).toBe(component.states.gettingStarted);
@@ -31,6 +34,9 @@ describe('EmptyState', () => {
selectedState: 'gettingStarted',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.buttonPath).toEqual(statePaths.settingsPath);
@@ -42,6 +48,9 @@ describe('EmptyState', () => {
selectedState: 'loading',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.buttonPath).toEqual(statePaths.documentationPath);
@@ -53,6 +62,9 @@ describe('EmptyState', () => {
selectedState: 'unableToConnect',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.showButtonDescription).toEqual(true);
@@ -63,6 +75,9 @@ describe('EmptyState', () => {
selectedState: 'loading',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.showButtonDescription).toEqual(false);
@@ -74,6 +89,9 @@ describe('EmptyState', () => {
selectedState: 'gettingStarted',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.$el.querySelector('svg')).toBeDefined();
@@ -87,6 +105,9 @@ describe('EmptyState', () => {
selectedState: 'loading',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.$el.querySelector('svg')).toBeDefined();
@@ -100,6 +121,9 @@ describe('EmptyState', () => {
selectedState: 'unableToConnect',
settingsPath: statePaths.settingsPath,
documentationPath: statePaths.documentationPath,
+ emptyGettingStartedSvgPath: 'foo',
+ emptyLoadingSvgPath: 'foo',
+ emptyUnableToConnectSvgPath: 'foo',
});
expect(component.$el.querySelector('svg')).toBeDefined();
diff --git a/spec/javascripts/pipelines/empty_state_spec.js b/spec/javascripts/pipelines/empty_state_spec.js
index bb47a28d9fe..6611b74594f 100644
--- a/spec/javascripts/pipelines/empty_state_spec.js
+++ b/spec/javascripts/pipelines/empty_state_spec.js
@@ -11,6 +11,7 @@ describe('Pipelines Empty State', () => {
component = new EmptyStateComponent({
propsData: {
helpPagePath: 'foo',
+ emptyStateSvgPath: 'foo',
},
}).$mount();
});
diff --git a/spec/javascripts/pipelines/error_state_spec.js b/spec/javascripts/pipelines/error_state_spec.js
index f667d351f72..a402857a4d1 100644
--- a/spec/javascripts/pipelines/error_state_spec.js
+++ b/spec/javascripts/pipelines/error_state_spec.js
@@ -8,7 +8,11 @@ describe('Pipelines Error State', () => {
beforeEach(() => {
ErrorStateComponent = Vue.extend(errorStateComp);
- component = new ErrorStateComponent().$mount();
+ component = new ErrorStateComponent({
+ propsData: {
+ errorStateSvgPath: 'foo',
+ },
+ }).$mount();
});
it('should render error state SVG', () => {
diff --git a/symbol/icons.svg b/symbol/icons.svg
new file mode 100644
index 00000000000..433bd2aca0d
--- /dev/null
+++ b/symbol/icons.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/symbol/sprite.symbol.html b/symbol/sprite.symbol.html
new file mode 100644
index 00000000000..a2289014093
--- /dev/null
+++ b/symbol/sprite.symbol.html
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+ SVG <symbol> sprite preview | svg-sprite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
SVG <symbol> sprite preview
+
This preview features two methods of using the generated sprite in conjunction with inline SVG. Please have a look at the HTML source for further details and be aware of the following constraints:
The embedded sprite (A) slightly differs from the generated external one. Please see the documentation for details on how to create such an embeddable sprite.
+
Internet Explorer up to version 11 doesn't support external sprites for use with inline SVG. For IE 9-11, you may polyfill this functionality with SVG for Everybody.
+
+
+
+
+
+
+
A) Inline SVG with embedded sprite
+
+
+
+
+
+
+
+
+
+
clock_o
+
+
+
+
+
+
+
+
+
commit
+
+
+
+
+
+
+
+
+
project
+
+
+
+
+
+
+
+
+
+
+
B) Inline SVG with external sprite (IE 9-11 with polyfill only)