From 34435397254ddd37e19c012b5f881c8fdcc780e4 Mon Sep 17 00:00:00 2001 From: Kelv Date: Fri, 6 Dec 2024 07:16:13 +0800 Subject: [PATCH] DEV: Update more deprecated Font Awesome icon names (#325) * DEV: Update more deprecated Font Awesome icon names * update to square-check Co-authored-by: Jarek Radosz --------- Co-authored-by: Jarek Radosz --- .../components/solved-accept-answer-button.gjs | 2 +- .../components/solved-unaccept-answer-button.gjs | 2 +- .../connectors/user-summary-stat/solved-count.hbs | 2 +- .../initializers/extend-for-solved-button.js | 12 ++++++------ assets/stylesheets/mobile/solutions.scss | 2 +- db/fixtures/001_badges.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/javascripts/discourse/components/solved-accept-answer-button.gjs b/assets/javascripts/discourse/components/solved-accept-answer-button.gjs index c82b5ef..aa885ba 100644 --- a/assets/javascripts/discourse/components/solved-accept-answer-button.gjs +++ b/assets/javascripts/discourse/components/solved-accept-answer-button.gjs @@ -27,7 +27,7 @@ export default class SolvedAcceptAnswerButton extends Component { class="post-action-menu__solved-unaccepted unaccepted" ...attributes @action={{this.acceptAnswer}} - @icon="far-check-square" + @icon="far-square-check" @label={{if this.showLabel "solved.solution"}} @title="solved.accept_answer" /> diff --git a/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs b/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs index 8f690ae..7083d92 100644 --- a/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs +++ b/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs @@ -54,7 +54,7 @@ export default class SolvedUnacceptAnswerButton extends Component { class="post-action-menu__solved-accepted accepted fade-out" ...attributes @action={{this.unacceptAnswer}} - @icon="check-square" + @icon="square-check" @label="solved.solution" @title="solved.unaccept_answer" /> diff --git a/assets/javascripts/discourse/connectors/user-summary-stat/solved-count.hbs b/assets/javascripts/discourse/connectors/user-summary-stat/solved-count.hbs index 80e5c16..325eaa6 100644 --- a/assets/javascripts/discourse/connectors/user-summary-stat/solved-count.hbs +++ b/assets/javascripts/discourse/connectors/user-summary-stat/solved-count.hbs @@ -4,7 +4,7 @@ diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js b/assets/javascripts/discourse/initializers/extend-for-solved-button.js index d245c87..335a385 100644 --- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js +++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js @@ -21,7 +21,7 @@ function initializeWithApi(api) { TopicStatusIcons.addObject([ "has_accepted_answer", - "far-check-square", + "far-square-check", "solved", ]); @@ -136,7 +136,7 @@ function customizeWidgetPostMenu(api) { return { action: "acceptAnswer", - icon: "far-check-square", + icon: "far-square-check", className: "unaccepted", title: "solved.accept_answer", label: isOp ? "solved.solution" : null, @@ -146,7 +146,7 @@ function customizeWidgetPostMenu(api) { if (attrs.can_unaccept_answer) { return { action: "unacceptAnswer", - icon: "check-square", + icon: "square-check", title: "solved.unaccept_answer", className: "accepted fade-out", position: "first", @@ -195,7 +195,7 @@ export default { : formatUsername(username); return i18n("solved.accepted_html", { - icon: iconHTML("check-square", { class: "accepted" }), + icon: iconHTML("square-check", { class: "accepted" }), username_lower: username.toLowerCase(), username: displayedUser, post_path: `${this.url}/${postNumber}`, @@ -214,7 +214,7 @@ export default { openTag: "span", closeTag: "span", title: i18n("topic_statuses.solved.help"), - icon: "far-check-square", + icon: "far-square-check", key: "solved", }); } else if ( @@ -238,7 +238,7 @@ export default { withPluginApi("0.8.10", (api) => { api.replaceIcon( "notification.solved.accepted_notification", - "check-square" + "square-check" ); }); diff --git a/assets/stylesheets/mobile/solutions.scss b/assets/stylesheets/mobile/solutions.scss index 0b1335b..7b9494e 100644 --- a/assets/stylesheets/mobile/solutions.scss +++ b/assets/stylesheets/mobile/solutions.scss @@ -1,4 +1,4 @@ -#topic-title .d-icon-far-check-square { +#topic-title .d-icon-far-square-check { margin-top: 0.25em; } diff --git a/db/fixtures/001_badges.rb b/db/fixtures/001_badges.rb index 4bd6abe..d89ba24 100644 --- a/db/fixtures/001_badges.rb +++ b/db/fixtures/001_badges.rb @@ -17,7 +17,7 @@ SQL Badge.seed(:name) do |badge| badge.name = "Solved 1" - badge.default_icon = "check-square" + badge.default_icon = "square-check" badge.badge_type_id = BadgeType::Bronze badge.default_badge_grouping_id = BadgeGrouping::Community badge.query = first_solution_query @@ -51,7 +51,7 @@ end ].each do |name, level, count| Badge.seed(:name) do |badge| badge.name = name - badge.default_icon = "check-square" + badge.default_icon = "square-check" badge.badge_type_id = level badge.default_badge_grouping_id = BadgeGrouping::Community badge.query = solved_query_with_count(count)