DEV: update more deprecated font awesome icon names (#30123)
* update more deprecated font awesome icon names * add migration to remove deprecated default for badges.icon
This commit is contained in:
parent
8a89a77248
commit
1ca90c3070
|
@ -62,7 +62,7 @@ export default class GroupCardContents extends CardContentsBase.extend(
|
|||
this.setProperties({ group });
|
||||
|
||||
if (!group.flair_url && !group.flair_bg_color) {
|
||||
group.set("flair_url", "fa-users");
|
||||
group.set("flair_url", "users");
|
||||
}
|
||||
|
||||
if (group.can_see_members && group.members.length < maxMembersToDisplay) {
|
||||
|
|
|
@ -215,7 +215,7 @@ acceptance(
|
|||
visible: true,
|
||||
public_admission: true,
|
||||
public_exit: false,
|
||||
flair_url: "fa-circle-half-stroke",
|
||||
flair_url: "circle-half-stroke",
|
||||
is_group_owner: true,
|
||||
mentionable: true,
|
||||
messageable: true,
|
||||
|
|
|
@ -70,7 +70,7 @@ acceptance("Search - Full Page", function (needs) {
|
|||
grant_count: 0,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
image: null,
|
||||
listable: true,
|
||||
enabled: true,
|
||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
|||
grant_count: 11,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 8,
|
||||
|
@ -75,7 +75,7 @@ export default {
|
|||
grant_count: 10,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-gear",
|
||||
icon: "gear",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 8,
|
||||
|
@ -89,7 +89,7 @@ export default {
|
|||
grant_count: 29,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 4,
|
||||
|
@ -103,7 +103,7 @@ export default {
|
|||
grant_count: 200,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 8,
|
||||
|
@ -118,7 +118,7 @@ export default {
|
|||
grant_count: 9,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-bug",
|
||||
icon: "bug",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 7,
|
||||
|
@ -132,7 +132,7 @@ export default {
|
|||
grant_count: 0,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 8,
|
||||
|
@ -146,7 +146,7 @@ export default {
|
|||
grant_count: 467,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 4,
|
||||
|
@ -161,7 +161,7 @@ export default {
|
|||
grant_count: 183,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-bug",
|
||||
icon: "bug",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 7,
|
||||
|
@ -175,7 +175,7 @@ export default {
|
|||
grant_count: 4,
|
||||
allow_title: true,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 4,
|
||||
|
@ -189,7 +189,7 @@ export default {
|
|||
grant_count: 278,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -203,7 +203,7 @@ export default {
|
|||
grant_count: 5834,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 4,
|
||||
|
@ -217,7 +217,7 @@ export default {
|
|||
grant_count: 60,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -231,7 +231,7 @@ export default {
|
|||
grant_count: 22,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 3,
|
||||
|
@ -245,7 +245,7 @@ export default {
|
|||
grant_count: 2,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 3,
|
||||
|
@ -259,7 +259,7 @@ export default {
|
|||
grant_count: 2387,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -273,7 +273,7 @@ export default {
|
|||
grant_count: 285,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -287,7 +287,7 @@ export default {
|
|||
grant_count: 42,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 2,
|
||||
|
@ -301,7 +301,7 @@ export default {
|
|||
grant_count: 1718,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 2,
|
||||
|
@ -315,7 +315,7 @@ export default {
|
|||
grant_count: 270,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -330,7 +330,7 @@ export default {
|
|||
grant_count: 545,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -344,7 +344,7 @@ export default {
|
|||
grant_count: 397,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -358,7 +358,7 @@ export default {
|
|||
grant_count: 259,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 3,
|
||||
|
@ -372,7 +372,7 @@ export default {
|
|||
grant_count: 933,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 2,
|
||||
|
@ -396,7 +396,7 @@ export default {
|
|||
grant_count: 545,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -419,7 +419,7 @@ export default {
|
|||
grant_count: 10,
|
||||
allow_title: true,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -437,7 +437,7 @@ export default {
|
|||
grant_count: 545,
|
||||
allow_title: false,
|
||||
multiple_grant: false,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
|
@ -1714,7 +1714,7 @@ export default {
|
|||
{
|
||||
id: 1,
|
||||
name: "Only icon",
|
||||
icon: "fa-rocket",
|
||||
icon: "rocket",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
|
@ -1724,7 +1724,7 @@ export default {
|
|||
{
|
||||
id: 3,
|
||||
name: "Both image and icon",
|
||||
icon: "fa-rocket",
|
||||
icon: "rocket",
|
||||
image_url: "/images/avatar.png?3",
|
||||
multiple_grant: true,
|
||||
query: "SELECT 1",
|
||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
|||
visible: true,
|
||||
public_admission: true,
|
||||
public_exit: false,
|
||||
flair_url: "fa-circle-half-stroke",
|
||||
flair_url: "circle-half-stroke",
|
||||
is_group_owner: true,
|
||||
mentionable: true,
|
||||
messageable: true,
|
||||
|
@ -66,7 +66,7 @@ export default {
|
|||
visible: true,
|
||||
public_admission: true,
|
||||
public_exit: false,
|
||||
flair_url: "fa-circle-half-stroke",
|
||||
flair_url: "circle-half-stroke",
|
||||
is_group_owner: true,
|
||||
mentionable: true,
|
||||
messageable: true,
|
||||
|
@ -260,7 +260,7 @@ export default {
|
|||
},
|
||||
},
|
||||
"/groups/discourse/posts.json": {
|
||||
"posts": [
|
||||
posts: [
|
||||
{
|
||||
id: 94607,
|
||||
cooked:
|
||||
|
@ -1319,8 +1319,8 @@ export default {
|
|||
avatar_template:
|
||||
"/user_avatar/meta.discourse.org/codinghorror/{size}/5297.png",
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
"/groups/alternative-group.json": {
|
||||
group: {
|
||||
|
@ -1334,7 +1334,7 @@ export default {
|
|||
has_messages: true,
|
||||
public_admission: true,
|
||||
public_exit: false,
|
||||
flair_url: "fa-circle-half-stroke",
|
||||
flair_url: "circle-half-stroke",
|
||||
is_group_owner: true,
|
||||
mentionable: true,
|
||||
messageable: true,
|
||||
|
|
|
@ -49,7 +49,7 @@ export default {
|
|||
grant_count: 14,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
image: null,
|
||||
listable: true,
|
||||
enabled: true,
|
||||
|
@ -349,7 +349,7 @@ export default {
|
|||
grant_count: 14,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
image: null,
|
||||
listable: true,
|
||||
enabled: true,
|
||||
|
@ -3210,7 +3210,7 @@ export default {
|
|||
grant_count: 14,
|
||||
allow_title: false,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
icon: "certificate",
|
||||
image: null,
|
||||
listable: true,
|
||||
enabled: true,
|
||||
|
|
|
@ -9,28 +9,28 @@ function setupSiteGroups(that) {
|
|||
{
|
||||
id: 1,
|
||||
name: "admins",
|
||||
flair_url: "fa-bars",
|
||||
flair_url: "bars",
|
||||
flair_bg_color: "CC000A",
|
||||
flair_color: "FFFFFA",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "staff",
|
||||
flair_url: "fa-bars",
|
||||
flair_url: "bars",
|
||||
flair_bg_color: "CC0005",
|
||||
flair_color: "FFFFF5",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "trust_level_1",
|
||||
flair_url: "fa-dice-one",
|
||||
flair_url: "dice-one",
|
||||
flair_bg_color: "CC0001",
|
||||
flair_color: "FFFFF1",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "trust_level_2",
|
||||
flair_url: "fa-dice-two",
|
||||
flair_url: "dice-two",
|
||||
flair_bg_color: "CC0002",
|
||||
flair_color: "FFFFF2",
|
||||
},
|
||||
|
@ -159,7 +159,7 @@ module("Integration | Component | user-avatar-flair", function (hooks) {
|
|||
moderator: false,
|
||||
trust_level: 3,
|
||||
flair_name: "Band Geeks",
|
||||
flair_url: "fa-xmark",
|
||||
flair_url: "xmark",
|
||||
flair_bg_color: "123456",
|
||||
flair_color: "B0B0B0",
|
||||
flair_group_id: 41,
|
||||
|
|
|
@ -8,7 +8,7 @@ module("Integration | Component | Widget | avatar-flair", function (hooks) {
|
|||
|
||||
test("avatar flair with an icon", async function (assert) {
|
||||
this.set("args", {
|
||||
flair_url: "fa-bars",
|
||||
flair_url: "bars",
|
||||
flair_bg_color: "CC0000",
|
||||
flair_color: "FFFFFF",
|
||||
});
|
||||
|
|
|
@ -252,7 +252,7 @@ class Badge < ActiveRecord::Base
|
|||
def default_icon=(val)
|
||||
if self.image_upload_id.blank?
|
||||
self.icon ||= val
|
||||
self.icon = val if self.icon == "fa-certificate"
|
||||
self.icon = val if self.icon == "certificate"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -353,7 +353,7 @@ end
|
|||
# updated_at :datetime not null
|
||||
# allow_title :boolean default(FALSE), not null
|
||||
# multiple_grant :boolean default(FALSE), not null
|
||||
# icon :string default("fa-certificate")
|
||||
# icon :string default("certificate")
|
||||
# listable :boolean default(TRUE)
|
||||
# target_posts :boolean default(FALSE)
|
||||
# query :text
|
||||
|
@ -363,9 +363,9 @@ end
|
|||
# trigger :integer
|
||||
# show_posts :boolean default(FALSE), not null
|
||||
# system :boolean default(FALSE), not null
|
||||
# show_in_post_header :boolean default(FALSE), not null
|
||||
# long_description :text
|
||||
# image_upload_id :integer
|
||||
# show_in_post_header :boolean default(FALSE), not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<form method="post">
|
||||
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
|
||||
<%= button_tag(type: "submit", class: "btn btn-primary") do %>
|
||||
<%= SvgSprite.raw_svg('fa-plug') %><%= t 'login.omniauth_confirm_button' %>
|
||||
<%= SvgSprite.raw_svg('plug') %><%= t 'login.omniauth_confirm_button' %>
|
||||
<% end %>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -156,7 +156,7 @@ end
|
|||
Badge.seed do |b|
|
||||
b.id = id
|
||||
b.name = name
|
||||
b.default_icon = "fa-user-plus"
|
||||
b.default_icon = "user-plus"
|
||||
b.badge_type_id = type
|
||||
b.multiple_grant = false
|
||||
b.target_posts = false
|
||||
|
@ -339,7 +339,7 @@ end
|
|||
Badge.seed do |b|
|
||||
b.id = id
|
||||
b.name = name
|
||||
b.default_icon = "fa-heart"
|
||||
b.default_icon = "heart"
|
||||
b.badge_type_id = level
|
||||
b.query = BadgeQueries.liked_posts(post_count, like_count)
|
||||
b.default_badge_grouping_id = BadgeGrouping::Community
|
||||
|
@ -357,7 +357,7 @@ end
|
|||
Badge.seed do |b|
|
||||
b.id = id
|
||||
b.name = name
|
||||
b.default_icon = "fa-heart"
|
||||
b.default_icon = "heart"
|
||||
b.badge_type_id = level
|
||||
b.query = BadgeQueries.liked_back(count, ratio)
|
||||
b.default_badge_grouping_id = BadgeGrouping::Community
|
||||
|
@ -375,7 +375,7 @@ end
|
|||
Badge.seed do |b|
|
||||
b.id = id
|
||||
b.name = name
|
||||
b.default_icon = "fa-heart"
|
||||
b.default_icon = "heart"
|
||||
b.badge_type_id = level
|
||||
b.query = BadgeQueries.like_rate_limit(count)
|
||||
b.default_badge_grouping_id = BadgeGrouping::Community
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
class ChangeDefaultForBadgesIcon < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
change_column_default :badges, :icon, from: "fa-certificate", to: "certificate"
|
||||
|
||||
up_only { execute <<~SQL }
|
||||
UPDATE badges
|
||||
SET icon = 'certificate'
|
||||
WHERE icon = 'fa-certificate';
|
||||
SQL
|
||||
end
|
||||
end
|
|
@ -667,7 +667,7 @@ export default class ChatMessage extends Component {
|
|||
<div class="stop-streaming-btn-container">
|
||||
<DButton
|
||||
class="stop-streaming-btn"
|
||||
@icon="stop-circle"
|
||||
@icon="circle-stop"
|
||||
@label="cancel"
|
||||
@action={{fn this.stopMessageStreaming @message}}
|
||||
/>
|
||||
|
|
|
@ -24,7 +24,7 @@ register_svg_icon "clipboard"
|
|||
register_svg_icon "file-audio"
|
||||
register_svg_icon "file-video"
|
||||
register_svg_icon "file-image"
|
||||
register_svg_icon "stop-circle"
|
||||
register_svg_icon "circle-stop"
|
||||
|
||||
# route: /admin/plugins/chat
|
||||
add_admin_route "chat.admin.title", "chat", use_new_show_route: true
|
||||
|
|
|
@ -26,13 +26,12 @@ RSpec.describe SvgSprite do
|
|||
end
|
||||
|
||||
it "can search for a specific FA icon" do
|
||||
expect(SvgSprite.search("fa-heart")).to match(/heart/)
|
||||
expect(SvgSprite.search("poo-storm")).to match(/poo-storm/)
|
||||
expect(SvgSprite.search("this-is-not-an-icon")).to eq(false)
|
||||
end
|
||||
|
||||
it "can get a raw SVG for an icon" do
|
||||
expect(SvgSprite.raw_svg("fa-heart")).to match(/svg.*svg/) # SVG inside SVG
|
||||
expect(SvgSprite.raw_svg("heart")).to match(/svg.*svg/) # SVG inside SVG
|
||||
expect(SvgSprite.raw_svg("this-is-not-an-icon")).to eq("")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue