DEV: unsilence deprecation warning for old Font Awesome icons (#30028)

* DEV: unsilence deprecation warnings for old Font Awesome icon names

* update fa-user to user font awesome icon name
* update pencil-alt to pencil font awesome 6 icon name
This commit is contained in:
Kelv
2024-12-03 10:28:39 +08:00
committed by GitHub
parent 996f56d005
commit 435fbb7408
8 changed files with 16 additions and 21 deletions

View File

@@ -4,10 +4,6 @@ const DEPRECATION_WORKFLOW = [
handler: "silence",
matchId: "discourse.decorate-widget.hamburger-widget-links",
},
{
handler: "silence",
matchId: "discourse.fontawesome-6-upgrade",
},
{
handler: "silence",
matchId: "discourse.post-menu-widget-overrides",

View File

@@ -215,7 +215,7 @@ export default class AboutPage extends Component {
{{#if this.currentUser.admin}}
<p>
<LinkTo class="edit-about-page" @route="adminConfig.about">
{{dIcon "pencil-alt"}}
{{dIcon "pencil"}}
<span>{{i18n "about.edit"}}</span>
</LinkTo>
</p>

View File

@@ -35,7 +35,7 @@ export default class PostMenuEditButton extends Component {
}}
...attributes
@action={{@buttonActions.editPost}}
@icon={{if @post.wiki "far-edit" "pencil-alt"}}
@icon={{if @post.wiki "far-edit" "pencil"}}
@label={{if this.showLabel "post.controls.edit_action"}}
@title="post.controls.edit"
/>

View File

@@ -34,7 +34,7 @@ export default {
grant_count: 7,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -64,7 +64,7 @@ export default {
grant_count: 30,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -334,7 +334,7 @@ export default {
grant_count: 7,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -364,7 +364,7 @@ export default {
grant_count: 30,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -2462,7 +2462,7 @@ export default {
grant_count: 3,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -2758,7 +2758,7 @@ export default {
grant_count: 3,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -2837,7 +2837,7 @@ export default {
grant_count: 3,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -2907,7 +2907,7 @@ export default {
grant_count: 3,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -3195,7 +3195,7 @@ export default {
grant_count: 7,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,
@@ -3225,7 +3225,7 @@ export default {
grant_count: 30,
allow_title: true,
multiple_grant: false,
icon: "fa-user",
icon: "user",
image: null,
listable: true,
enabled: true,

View File

@@ -22,7 +22,7 @@
<%- if can_sign_up? %>
<a href="<%= path "/signup"%>" class='btn btn-primary btn-small sign-up-button'><%= I18n.t('sign_up') %></a>
<%- end %>
<a href="<%= path "/login"%>" class='btn btn-primary btn-small login-button btn-icon-text'><%= SvgSprite.raw_svg('fa-user') %><%= I18n.t('log_in') %></a>
<a href="<%= path "/login"%>" class='btn btn-primary btn-small login-button btn-icon-text'><%= SvgSprite.raw_svg('user') %><%= I18n.t('log_in') %></a>
</span>
<%- end %>
</div>

View File

@@ -12,7 +12,7 @@
<h1 class="title"><%= @title %></h1>
<%- if !@current_user %>
<a href="<%= path "/login" %>" class='btn btn-primary'><%= SvgSprite.raw_svg('fa-user') %><%= I18n.t('log_in') %></a>
<a href="<%= path "/login" %>" class='btn btn-primary'><%= SvgSprite.raw_svg('user') %><%= I18n.t('log_in') %></a>
<%- end %>
<%- if @group&.dig(:allow_membership_requests) %>

View File

@@ -58,7 +58,7 @@ SQL
b.trigger = Badge::Trigger::TrustLevelChange
# allow title for tl3 and above
b.default_allow_title = id > Badge::Member
b.default_icon = "fa-user"
b.default_icon = "user"
b.system = true
end
end

View File

@@ -523,8 +523,7 @@ License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL
new_name = remap_from_fa5(new_name)
if icon_name != new_name
# TODO: Enable message once core and official themes/plugins are updated
# Discourse.deprecate("The icon `#{icon_name}` is deprecated. Use `#{new_name}` instead.")
Discourse.deprecate("The icon `#{icon_name}` is deprecated. Use `#{new_name}` instead.")
return new_name
end