DEV: Use component references for user menu (#456)
See 9b41700f87
for context.
Passing a reference works before and after that change, so there is no need to introduce a discourse-compatibility entry.
This commit is contained in:
parent
7562925e0d
commit
996c5ea493
|
@ -1,3 +0,0 @@
|
||||||
import templateOnly from "@ember/component/template-only";
|
|
||||||
// TODO: colocate this component's template
|
|
||||||
export default templateOnly();
|
|
|
@ -6,6 +6,7 @@ import Notification from "discourse/models/notification";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import Topic from "discourse/models/topic";
|
import Topic from "discourse/models/topic";
|
||||||
|
import UserMenuAssignsListEmptyState from "./assigns-list-empty-state";
|
||||||
|
|
||||||
export default class UserMenuAssignNotificationsList extends UserMenuNotificationsList {
|
export default class UserMenuAssignNotificationsList extends UserMenuNotificationsList {
|
||||||
get dismissTypes() {
|
get dismissTypes() {
|
||||||
|
@ -33,7 +34,7 @@ export default class UserMenuAssignNotificationsList extends UserMenuNotificatio
|
||||||
}
|
}
|
||||||
|
|
||||||
get emptyStateComponent() {
|
get emptyStateComponent() {
|
||||||
return "user-menu/assigns-list-empty-state";
|
return UserMenuAssignsListEmptyState;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchItems() {
|
async fetchItems() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
|
import UserMenuAssignNotificationsList from "../components/user-menu/assigns-list";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "assign-user-menu",
|
name: "assign-user-menu",
|
||||||
|
@ -17,26 +18,15 @@ export default {
|
||||||
}
|
}
|
||||||
api.registerUserMenuTab((UserMenuTab) => {
|
api.registerUserMenuTab((UserMenuTab) => {
|
||||||
return class extends UserMenuTab {
|
return class extends UserMenuTab {
|
||||||
get id() {
|
id = "assign-list";
|
||||||
return "assign-list";
|
panelComponent = UserMenuAssignNotificationsList;
|
||||||
}
|
icon = "user-plus";
|
||||||
|
notificationTypes = ["assigned"];
|
||||||
get panelComponent() {
|
|
||||||
return "user-menu/assigns-list";
|
|
||||||
}
|
|
||||||
|
|
||||||
get icon() {
|
|
||||||
return "user-plus";
|
|
||||||
}
|
|
||||||
|
|
||||||
get count() {
|
get count() {
|
||||||
return this.getUnreadCountForType("assigned");
|
return this.getUnreadCountForType("assigned");
|
||||||
}
|
}
|
||||||
|
|
||||||
get notificationTypes() {
|
|
||||||
return ["assigned"];
|
|
||||||
}
|
|
||||||
|
|
||||||
get linkWhenActive() {
|
get linkWhenActive() {
|
||||||
return `${this.currentUser.path}/activity/assigned`;
|
return `${this.currentUser.path}/activity/assigned`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue