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
e3306d4a
Commit
e3306d4a
authored
Dec 09, 2020
by
Martin Wortschack
Committed by
Rémy Coutable
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated icon helper in favor of sprite_icon
parent
708e5e6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
33 deletions
+0
-33
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+0
-16
doc/development/fe_guide/icons.md
doc/development/fe_guide/icons.md
+0
-2
spec/helpers/icons_helper_spec.rb
spec/helpers/icons_helper_spec.rb
+0
-15
No files found.
app/helpers/icons_helper.rb
View file @
e3306d4a
...
...
@@ -8,22 +8,6 @@ module IconsHelper
DEFAULT_ICON_SIZE
=
16
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
# font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls.
# @deprecated use sprite_icon to render a SVG icon
def
icon
(
names
,
options
=
{})
if
(
options
.
keys
&
%w[aria-hidden aria-label data-hidden]
).
empty?
# Add 'aria-hidden' and 'data-hidden' if they are not set in options.
options
[
'aria-hidden'
]
=
true
options
[
'data-hidden'
]
=
true
end
options
.
include?
(
:base
)
?
fa_stacked_icon
(
names
,
options
)
:
fa_icon
(
names
,
options
)
end
def
custom_icon
(
icon_name
,
size:
DEFAULT_ICON_SIZE
)
memoized_icon
(
"
#{
icon_name
}
_
#{
size
}
"
)
do
# We can't simply do the below, because there are some .erb SVGs.
...
...
doc/development/fe_guide/icons.md
View file @
e3306d4a
...
...
@@ -48,8 +48,6 @@ sprite_icon(icon_name, size: nil, css_class: '')
</svg>
```
**Please note:**
The
`icon(icon_name, options: {})`
helper function is deprecated and should not be used anymore.
### Usage in Vue
[
GitLab UI
](
https://gitlab-org.gitlab.io/gitlab-ui/
)
, our components library, provides a component to display sprite icons.
...
...
spec/helpers/icons_helper_spec.rb
View file @
e3306d4a
...
...
@@ -5,21 +5,6 @@ require 'spec_helper'
RSpec
.
describe
IconsHelper
do
let
(
:icons_path
)
{
ActionController
::
Base
.
helpers
.
image_path
(
"icons.svg"
)
}
describe
'icon'
do
it
'returns aria-hidden by default'
do
star
=
icon
(
'star'
)
expect
(
star
[
'aria-hidden'
]).
to
eq
'aria-hidden'
end
it
'does not return aria-hidden if aria-label is set'
do
up
=
icon
(
'up'
,
'aria-label'
=>
'up'
)
expect
(
up
[
'aria-hidden'
]).
to
be_nil
expect
(
up
[
'aria-label'
]).
to
eq
'aria-label'
end
end
describe
'sprite_icon_path'
do
it
'returns relative path'
do
expect
(
sprite_icon_path
).
to
eq
(
icons_path
)
...
...
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