mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 09:12:45 +08:00
FIX: Missing sidebar section link icon for PM tags (#18481)
No tests cause a missing icon regression is not the end of the world and I don't feel like it will provide enough value as a regression test long term.
This commit is contained in:
parent
637b1211b5
commit
c0037dc0f0
|
@ -73,14 +73,10 @@ export default class MessageSectionLink {
|
|||
}
|
||||
|
||||
get prefixType() {
|
||||
if (this._isInbox) {
|
||||
return "icon";
|
||||
}
|
||||
return "icon";
|
||||
}
|
||||
|
||||
get prefixValue() {
|
||||
if (this._isInbox) {
|
||||
return "inbox";
|
||||
}
|
||||
return "inbox";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
export default class BaseTagSectionLink {
|
||||
constructor({ tagName }) {
|
||||
this.tagName = tagName;
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this.tagName;
|
||||
}
|
||||
|
||||
get text() {
|
||||
return this.tagName;
|
||||
}
|
||||
|
||||
get prefixType() {
|
||||
return "icon";
|
||||
}
|
||||
|
||||
get prefixValue() {
|
||||
return "tag";
|
||||
}
|
||||
}
|
|
@ -1,11 +1,9 @@
|
|||
export default class PMTagSectionLink {
|
||||
constructor({ tagName, currentUser }) {
|
||||
this.tagName = tagName;
|
||||
this.currentUser = currentUser;
|
||||
}
|
||||
import BaseTagSectionLink from "discourse/lib/sidebar/user/tags-section/base-tag-section-link";
|
||||
|
||||
get name() {
|
||||
return this.tagName;
|
||||
export default class PMTagSectionLink extends BaseTagSectionLink {
|
||||
constructor({ currentUser }) {
|
||||
super(...arguments);
|
||||
this.currentUser = currentUser;
|
||||
}
|
||||
|
||||
get models() {
|
||||
|
@ -15,8 +13,4 @@ export default class PMTagSectionLink {
|
|||
get route() {
|
||||
return "userPrivateMessages.tagsShow";
|
||||
}
|
||||
|
||||
get text() {
|
||||
return this.tagName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,14 @@ import I18n from "I18n";
|
|||
import { tracked } from "@glimmer/tracking";
|
||||
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import BaseTagSectionLink from "discourse/lib/sidebar/user/tags-section/base-tag-section-link";
|
||||
|
||||
export default class TagSectionLink {
|
||||
export default class TagSectionLink extends BaseTagSectionLink {
|
||||
@tracked totalUnread = 0;
|
||||
@tracked totalNew = 0;
|
||||
|
||||
constructor({ tagName, topicTrackingState }) {
|
||||
this.tagName = tagName;
|
||||
constructor({ topicTrackingState }) {
|
||||
super(...arguments);
|
||||
this.topicTrackingState = topicTrackingState;
|
||||
this.refreshCounts();
|
||||
}
|
||||
|
@ -27,10 +28,6 @@ export default class TagSectionLink {
|
|||
}
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this.tagName;
|
||||
}
|
||||
|
||||
get models() {
|
||||
return [this.tagName];
|
||||
}
|
||||
|
@ -49,10 +46,6 @@ export default class TagSectionLink {
|
|||
return "tag.show tag.showNew tag.showUnread tag.showTop";
|
||||
}
|
||||
|
||||
get text() {
|
||||
return this.tagName;
|
||||
}
|
||||
|
||||
get badgeText() {
|
||||
if (this.totalUnread > 0) {
|
||||
return I18n.t("sidebar.unread_count", {
|
||||
|
@ -64,12 +57,4 @@ export default class TagSectionLink {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
get prefixType() {
|
||||
return "icon";
|
||||
}
|
||||
|
||||
get prefixValue() {
|
||||
return "tag";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user