mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add icon aliases (#26300)
This commit is contained in:
parent
61bd7d5d11
commit
af22154d80
@ -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) {
|
||||||
|
@ -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"
|
||||||
/>
|
/>
|
@ -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",
|
||||||
|
@ -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}}
|
||||||
|
@ -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"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user