0
0

Remove unused ApplicationHelper#visibility_icon helper method (#32644)

This commit is contained in:
Matt Jankowski 2024-10-24 04:02:54 -04:00 committed by GitHub
parent d11231a420
commit 745c4f900a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 34 deletions

View File

@ -120,18 +120,6 @@ module ApplicationHelper
inline_svg_tag 'check.svg' inline_svg_tag 'check.svg'
end end
def visibility_icon(status)
if status.public_visibility?
material_symbol('globe', title: I18n.t('statuses.visibilities.public'))
elsif status.unlisted_visibility?
material_symbol('lock_open', title: I18n.t('statuses.visibilities.unlisted'))
elsif status.private_visibility? || status.limited_visibility?
material_symbol('lock', title: I18n.t('statuses.visibilities.private'))
elsif status.direct_visibility?
material_symbol('alternate_email', title: I18n.t('statuses.visibilities.direct'))
end
end
def interrelationships_icon(relationships, account_id) def interrelationships_icon(relationships, account_id)
if relationships.following[account_id] && relationships.followed_by[account_id] if relationships.following[account_id] && relationships.followed_by[account_id]
material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive') material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive')

View File

@ -227,28 +227,6 @@ RSpec.describe ApplicationHelper do
end end
end end
describe 'visibility_icon' do
it 'returns a globe icon for a public visible status' do
result = helper.visibility_icon Status.new(visibility: 'public')
expect(result).to match(/globe/)
end
it 'returns an unlock icon for a unlisted visible status' do
result = helper.visibility_icon Status.new(visibility: 'unlisted')
expect(result).to match(/lock_open/)
end
it 'returns a lock icon for a private visible status' do
result = helper.visibility_icon Status.new(visibility: 'private')
expect(result).to match(/lock/)
end
it 'returns an at icon for a direct visible status' do
result = helper.visibility_icon Status.new(visibility: 'direct')
expect(result).to match(/alternate_email/)
end
end
describe 'title' do describe 'title' do
it 'returns site title on production environment' do it 'returns site title on production environment' do
Setting.site_title = 'site title' Setting.site_title = 'site title'