Skip to content

Commit

Permalink
Fix refinery_icon_tag and deprecate this helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez committed Mar 21, 2018
1 parent b577193 commit 0a6ac9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/app/helpers/refinery/tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def refinery_help_tag(title='Tip')
# This is just a quick wrapper to render an image tag that lives inside refinery/icons.
# They are all 16x16 so this is the default but is able to be overriden with supplied options.
def refinery_icon_tag(filename, options = {})
Refinery.deprecate('Refinery::TagHelper.refinery_icon_tag', when: '4.1', replacement: 'Refinery::TagHelper.action_icon')

filename = "#{filename}.png" unless filename.split('.').many?
path = image_path "refinery/icons/#{filename}", skip_pipeline: true
image_tag path, {:width => 16, :height => 16}.merge(options)
Expand Down
2 changes: 1 addition & 1 deletion core/spec/helpers/refinery/tag_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Refinery
end

it "wraps image_tag with some options preset" do
expect(helper.refinery_icon_tag("ugis.ozols.jpg")).to xml_eq(%Q{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
expect(helper.refinery_icon_tag("ugis.ozols.jpg", { alt: "Ugis.ozols"})).to xml_eq(%Q{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
end
end

Expand Down

2 comments on commit 0a6ac9a

@parndt
Copy link
Member

@parndt parndt commented on 0a6ac9a Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why deprecate it?

@bricesanchez
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unused in our main project.

Please sign in to comment.