DEV: Add icon aliases (#26300)

This commit is contained in:
Jordan Vidrine 2024-03-21 17:20:02 -05:00 committed by GitHub
parent 61bd7d5d11
commit af22154d80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 7 deletions

View File

@ -51,6 +51,9 @@ export const REPLACEMENTS = {
"notification.reaction": "bell", "notification.reaction": "bell",
"notification.votes_released": "plus", "notification.votes_released": "plus",
"notification.chat_quoted": "quote-right", "notification.chat_quoted": "quote-right",
"user_menu.replies": "reply",
"user_menu.drafts": "pencil-alt",
"sidebar.all_categories": "list",
}; };
export function replaceIcon(source, destination) { export function replaceIcon(source, destination) {

View File

@ -3,5 +3,5 @@
@content={{i18n "sidebar.all_categories"}} @content={{i18n "sidebar.all_categories"}}
@route="discovery.categories" @route="discovery.categories"
@prefixType="icon" @prefixType="icon"
@prefixValue="list" @prefixValue="sidebar.all_categories"
/> />

View File

@ -36,7 +36,7 @@ const CORE_TOP_TABS = [
class extends UserMenuTab { class extends UserMenuTab {
id = "replies"; id = "replies";
icon = "reply"; icon = "user_menu.replies";
panelComponent = UserMenuRepliesNotificationsList; panelComponent = UserMenuRepliesNotificationsList;
notificationTypes = [ notificationTypes = [
"mentioned", "mentioned",

View File

@ -54,7 +54,7 @@
<li class="drafts"> <li class="drafts">
<LinkTo @route="userActivity.drafts" @model={{this.currentUser}}> <LinkTo @route="userActivity.drafts" @model={{this.currentUser}}>
{{d-icon "pencil-alt"}} {{d-icon "user_menu.drafts"}}
<span class="item-label"> <span class="item-label">
{{#if this.currentUser.draft_count}} {{#if this.currentUser.draft_count}}
{{i18n "drafts.label_with_count" count=this.currentUser.draft_count}} {{i18n "drafts.label_with_count" count=this.currentUser.draft_count}}

View File

@ -502,18 +502,18 @@ acceptance("User menu", function (needs) {
"invites link not shown when the user can't invite" "invites link not shown when the user can't invite"
); );
const dratsLink = query("#quick-access-profile ul li.drafts a"); const draftsLink = query("#quick-access-profile ul li.drafts a");
assert.ok( assert.ok(
dratsLink.href.endsWith("/u/eviltrout/activity/drafts"), draftsLink.href.endsWith("/u/eviltrout/activity/drafts"),
"has a link to the drafts page of the user" "has a link to the drafts page of the user"
); );
assert.strictEqual( assert.strictEqual(
dratsLink.textContent.trim(), draftsLink.textContent.trim(),
I18n.t("drafts.label_with_count", { count: 13 }), I18n.t("drafts.label_with_count", { count: 13 }),
"drafts link has the right label with count of the user's drafts" "drafts link has the right label with count of the user's drafts"
); );
assert.ok( assert.ok(
dratsLink.querySelector(".d-icon-pencil-alt"), draftsLink.querySelector(".d-icon-user_menu\\.drafts"),
"drafts link has the right icon" "drafts link has the right icon"
); );