mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 02:43:08 -05:00
Pull invitee accepted notification behaviour into its own class
This commit is contained in:
committed by
Robin Ward
parent
7c52ba1431
commit
a3254b8446
@@ -31,7 +31,6 @@ export const DefaultNotificationItem =
|
||||
url() {
|
||||
const attrs = this.attrs;
|
||||
const data = attrs.data;
|
||||
const notificationTypes = this.site.notification_types;
|
||||
|
||||
const badgeId = data.badge_id;
|
||||
if (badgeId) {
|
||||
@@ -55,10 +54,6 @@ export const DefaultNotificationItem =
|
||||
return postUrl(attrs.slug, topicId, attrs.post_number);
|
||||
}
|
||||
|
||||
if (attrs.notification_type === notificationTypes.invitee_accepted) {
|
||||
return userPath(data.display_username);
|
||||
}
|
||||
|
||||
if (data.group_id) {
|
||||
return userPath(data.username + "/messages/group/" + data.group_name);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { createWidgetFrom } from "discourse/widgets/widget";
|
||||
import { DefaultNotificationItem } from "discourse/widgets/default-notification-item";
|
||||
import { postUrl } from "discourse/lib/utilities";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
|
||||
createWidgetFrom(DefaultNotificationItem, "invitee-accepted-notification-item", {
|
||||
url() {
|
||||
const attrs = this.attrs;
|
||||
const data = attrs.data;
|
||||
|
||||
return userPath(data.display_username);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user